Concept

SparseLinearAlgebraTraits_d::Matrix

Definition

SparseLinearAlgebraTraits_d::Matrix is a concept of a sparse matrix class.

Refines

LinearAlgebraTraits_d::Matrix

Types

SparseLinearAlgebraTraits_d::Matrix::NT

Creation

SparseLinearAlgebraTraits_d::Matrix M ( int dimension);
Create a square matrix initialized with zeros.

SparseLinearAlgebraTraits_d::Matrix M ( int rows, int columns);
Create a rectangular matrix initialized with zeros.

Operations

int M.row_dimension () const Return the matrix number of rows.
int M.column_dimension () const Return the matrix number of columns.
NT M.get_coef ( int row, int column) const
Read access to a matrix coefficient.
Preconditions: 
0 <= row < row_dimension(). 0 <= column < column_dimension().
void M.add_coef ( int row, int column, NT value)
Write access to a matrix coefficient: a_ij <- a_ij + val.
Preconditions: 
0 <= row < row_dimension(). 0 <= column < column_dimension().
void M.set_coef ( int row, int column, NT value, bool new_coef = false)
Write access to a matrix coefficient: a_ij <- val.
Optimization: Caller can optimize this call by setting new_coef to true if the coefficient does not already exist in the matrix.
Preconditions: 
0 <= i < row_dimension(). 0 <= j < column_dimension().

Has Models

Eigen_sparse_matrix<T>
Eigen_sparse_symmetric_matrix<T>
OpenNL::SparseMatrix<T> in OpenNL package

See Also

SparseLinearAlgebraTraits_d
SparseLinearAlgebraTraits_d::Vector