Defined in File DynamicMatrix.hpp
The DynamicMatrix class represents a matrix that is optimized for sparse matrices and internally uses a graph data structure. DynamicMatrix should be used when changes to the structure of the matrix are frequent.
Public Functions
Default constructor
Constructs the Matrix with size dimension x dimension.
dimension – Defines how many rows and columns this matrix has.
zero – The zero element (default is 0.0).
Constructs the Matrix with size nRows x nCols.
nRows – Number of rows.
nCols – Number of columns.
zero – The zero element (default is 0.0).
Constructs the dimension x dimension Matrix from the elements at position positions with values @values.
dimension – Defines how many rows and columns this matrix has.
triplets – The nonzero elements.
zero – The zero element (default is 0.0).
Constructs the nRows x nCols Matrix from the elements at position positions with values @values.
nRows – Defines how many rows this matrix has.
nCols – Defines how many columns this matrix has.
triplets – The nonzero elements.
zero – The zero element (default is 0.0).
Compares this matrix to other and returns true if the shape and zero element are the same as well as all entries, otherwise returns false.
other –
Compares this matrix to other and returns true if the shape and zero element are the same as well as all entries are the same (within the absolute error range of eps), otherwise returns false.
other –
eps –
Compares this matrix to other and returns false if the shape and zero element are the same as well as all entries, otherwise returns true.
other –
Returns the zero element of the matrix.
i – The row index.
Number of non-zeros in row i.
Set the matrix at position (i, j) to value.
Adds this matrix to other and returns the result.
The sum of this matrix and other.
Adds other to this matrix.
Reference to this matrix.
Subtracts other from this matrix and returns the result.
The difference of this matrix and other.
Subtracts other from this matrix.
Reference to this matrix.
Multiplies this matrix with a scalar specified in scalar and returns the result.
The result of multiplying this matrix with scalar.
Multiplies this matrix with a scalar specified in scalar.
Reference to this matrix.
Multiplies this matrix with vector and returns the result.
The result of multiplying this matrix with vector.
Multiplies this matrix with other and returns the result in a new matrix.
The result of multiplying this matrix with other.
Divides this matrix by a divisor specified in divisor and returns the result in a new matrix.
The result of dividing this matrix by divisor.
Divides this matrix by a divisor specified in divisor.
Reference to this matrix.
Transposes this matrix and returns it.
Extracts a matrix with rows and columns specified by rowIndices and columnIndices from this matrix. The order of rows and columns is equal to the order in rowIndices and columnIndices. It is also possible to specify a row or column more than once to get duplicates.
rowIndices –
columnIndices –
Assign the contents of the matrix source to this matrix at rows and columns specified by rowIndices and columnIndices. That is, entry (i,j) of source is assigned to entry (rowIndices[i], columnIndices[j]) of this matrix. Note that the dimensions of @rowIndices and columnIndices must coincide with the number of rows and columns of source.
rowIndices –
columnIndices –
source –
Applies the unary function unaryElementFunction to each value in the matrix. Note that it must hold that the function applied to the zero element of this matrix returns the zero element.
unaryElementFunction –
Iterate over all non-zero elements of row row in the matrix and call handle(index row, index column, double value)
Iterate in parallel over all non-zero elements of row row in the matrix and call handler(index column, double value)
Iterate over all elements in row i in the matrix and call handle(index column, double value)
Iterate in parallel over all elements (including zeros) of row row in the matrix and call handler(index column, double value)
Iterate over all elements (including zeros) of the matrix in row order and call handler (lambda closure).
Iterate in parallel over all elements (including zeros) in row order and call handle (lambda closure) on elements of the matrix.
Public Static Functions
Computes A^T * B.
A –
B –
Computes A * B^T.
A –
B –
Computes matrix^T * vector
matrix –
vector –
Returns the (weighted) adjacency matrix of the (weighted) Graph graph.
graph –
Creates a diagonal matrix with dimension equal to the dimension of the Vector diagonalElements. The values on the diagonal are the ones stored in diagonalElements (i.e. D(i,i) = diagonalElements[i]).
diagonalElements –
Returns the (weighted) incidence matrix of the (weighted) Graph graph.
graph –
Returns the (weighted) Laplacian matrix of the (weighteD) Graph graph.
graph –
Returns the (weighted) normalized Laplacian matrix of the (weighted) Graph graph
graph –