public interface Matrix
Modifier and Type | Interface and Description |
---|---|
static interface |
Matrix.Element
An element of the matrix.
|
static interface |
Matrix.ElementHandler
Handler used to iterate a matrix and get values.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int i,
int j,
double value)
Add value at row
i and column j . |
Matrix.Element |
addAndGetElement(int i,
int j,
double value)
Add value at row
i and column j and get an #Element to later update the element. |
default void |
addValue(int i,
int j,
double value)
Deprecated.
Use
add(int, int, double) instead. |
Matrix |
copy(MatrixFactory factory)
Copy this matrix using another implementation.
|
static Matrix |
createFromColumn(double[] c,
MatrixFactory matrixFactory)
Utility method for creating a single column matrix from a java array.
|
LUDecomposition |
decomposeLU()
Get LU decomposition utility class for this matrix.
|
int |
getColumnCount()
Get column count.
|
default int |
getM()
Deprecated.
Use
getRowCount() instead. |
default int |
getN()
Deprecated.
Use
getColumnCount() instead. |
int |
getRowCount()
Get row count.
|
void |
iterateNonZeroValue(Matrix.ElementHandler handler)
Iterate over non zero values of the matrix.
|
void |
iterateNonZeroValueOfColumn(int j,
Matrix.ElementHandler handler)
Iterate over non zero values of the
j column of the matrix. |
void |
print(PrintStream out)
Print the matrix to a stream.
|
void |
print(PrintStream out,
List<String> rowNames,
List<String> columnNames)
Print the matrix to a stream.
|
void |
reset()
Fill matrix with zeros.
|
void |
set(int i,
int j,
double value)
Set value at row
i and column j . |
default void |
setValue(int i,
int j,
double value)
Deprecated.
Use
set(int, int, double) instead. |
Matrix |
times(Matrix other)
Multiply the matrix by another one (this*other).
|
Matrix |
to(MatrixFactory factory)
Copy this matrix using another implementation.
|
DenseMatrix |
toDense()
Copy this matrix using a dense implementation.
|
com.powsybl.math.matrix.SparseMatrix |
toSparse()
Copy this matrix using a sparse implementation.
|
static Matrix createFromColumn(double[] c, MatrixFactory matrixFactory)
c
- a column arraymatrixFactory
- matrix factory to allow creating the matrix with different implementations.int getRowCount()
@Deprecated default int getM()
getRowCount()
instead.int getColumnCount()
@Deprecated default int getN()
getColumnCount()
instead.void set(int i, int j, double value)
i
and column j
.i
- row indexj
- column indexvalue
- the value to set at row i
and column j
@Deprecated default void setValue(int i, int j, double value)
set(int, int, double)
instead.void add(int i, int j, double value)
i
and column j
.i
- row indexj
- column indexvalue
- the value to add at row i
and column j
Matrix.Element addAndGetElement(int i, int j, double value)
i
and column j
and get an #Element
to later update the element.i
- row indexj
- column indexvalue
- the value to add at row i
and column j
i
and column j
@Deprecated default void addValue(int i, int j, double value)
add(int, int, double)
instead.void reset()
LUDecomposition decomposeLU()
Matrix times(Matrix other)
other
- the other matrixvoid iterateNonZeroValue(Matrix.ElementHandler handler)
Matrix.ElementHandler.onElement(int, int, double)
is called.handler
- the element handlervoid iterateNonZeroValueOfColumn(int j, Matrix.ElementHandler handler)
j
column of the matrix. At each non zero value Matrix.ElementHandler.onElement(int, int, double)
is called.j
- column indexhandler
- the element handlerDenseMatrix toDense()
com.powsybl.math.matrix.SparseMatrix toSparse()
Matrix to(MatrixFactory factory)
factory
- a matrix factory to create the copy.Matrix copy(MatrixFactory factory)
factory
- a matrix factory to create the copy.void print(PrintStream out, List<String> rowNames, List<String> columnNames)
out
- the streamrowNames
- row namescolumnNames
- column namesvoid print(PrintStream out)
out
- the streamCopyright © 2020. All rights reserved.