CGAL::Taucs_matrix<T>

Definition

The class Taucs_matrix is a C++ wrapper around TAUCS' matrix type taucs_ccs_matrix.

This kind of matrix can be either symmetric or not. Symmetric matrices store only the lower triangle.

#include <CGAL/Taucs_matrix.h>

Is Model for the Concepts

Model of the SparseLinearAlgebraTraits_d::Matrix concept.

Parameters

The full template declaration is:

template<class T>
struct Taucs_matrix;

Parameters


T: Number type. Tested with T = taucs_single or taucs_double. May also work with T = taucs_dcomplex and taucs_scomplex.

Types

Taucs_matrix<T>::NT

Creation

Taucs_matrix<T> M ( int dim, bool is_symmetric = false);
Create a square matrix initialized with zeros.
Parameters: 
dim: Matrix dimension. is_symmetric: Symmetric/hermitian?.

Taucs_matrix<T> M ( int rows, int columns, bool is_symmetric = false);
Create a rectangular matrix initialized with zeros.
Precondition: rows == columns if is_symmetric is true.
Parameters: 
rows: Number of rows. columns: Number of columns. is_symmetric: Symmetric/hermitian?.

Operations

int M.row_dimension () const Return the matrix number of rows.
int M.column_dimension () const Return the matrix number of columns.
T M.get_coef ( int i, int j) const Read access to a matrix coefficient.
Preconditions: 
0 <= i < row_dimension(). 0 <= j < column_dimension().
void M.set_coef ( int i, int j, T val, bool new_coef = false)
Write access to a matrix coefficient: a_ij <- val.
Optimizations: For symmetric matrices, Taucs_matrix stores only the lower triangle set_coef() does nothing if (i, j) belongs to the upper triangle. 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().
void M.add_coef ( int i, int j, T val)
Write access to a matrix coefficient: a_ij <- a_ij + val.
Optimization: For symmetric matrices, Taucs_matrix stores only the lower triangle add_coef() does nothing if (i, j) belongs to the upper triangle.
Preconditions: 
0 <= i < row_dimension(). 0 <= j < column_dimension().
const taucs_ccs_matrix* M.get_taucs_matrix () const Construct and return the TAUCS matrix wrapped by this object. The TAUCS matrix returned by this method is valid only until the next call to get_coef(), set_coef() or add_coef().

See Also

CGAL::Taucs_solver_traits<T>
CGAL::Taucs_symmetric_solver_traits<T>
CGAL::Taucs_symmetric_matrix<T>
CGAL::Taucs_vector<T>