Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
limbo::solvers::MatrixCSR< T, I, StartingIndex > Struct Template Reference

Compressed sparse row (CSR) matrix. More...

#include <Solvers.h>

Public Types

typedef T value_type
 value type
 
typedef I index_type
 index type
 

Public Member Functions

 MatrixCSR ()
 constructor
 
 MatrixCSR (MatrixCSR const &rhs)
 copy constructor
 
MatrixCSRoperator= (MatrixCSR const &rhs)
 assignment
 
 ~MatrixCSR ()
 destructor
 
void initialize (index_type nr, index_type nc, index_type nv)
 Initialize matrix. More...
 
void reset ()
 Destroy matrix and recycle memory.
 
void copy (MatrixCSR const &rhs)
 copy object More...
 
value_type at (index_type i, index_type j) const
 get element More...
 
void set (index_type nr, index_type nc, LinearConstraint< value_type > const *vConstraint)
 Set from array of constraints. More...
 

Public Attributes

value_typevElement
 Flatten data values. A real or complex array that contains the non-zero elements of A. Values of the non-zero elements of A are mapped into the values array using the row-major storage mapping described above.
 
index_typevColumn
 Element i of the integer array columns is the number of the column in A that contains the i-th value in the values array.
 
index_typevRowBeginIndex
 Element j of this integer array gives the index of the element in the values array that is first non-zero element in a row j of A. Note that this index is equal to vRowBeginIndex(j) - vRowBeginIndex(1)+StartingIndex.
 
index_type numRows
 number of rows, not in the CSR format
 
index_type numColumns
 number of columns, not in the CSR format
 
index_type numElements
 number of non-zero elements
 

Static Public Attributes

static index_type s_startingIndex = StartingIndex
 starting index, like zero-based indexing or one-based indexing
 

Detailed Description

template<typename T, typename I, int StartingIndex = 1>
struct limbo::solvers::MatrixCSR< T, I, StartingIndex >

Compressed sparse row (CSR) matrix.

Template Parameters
Tvalue type
Iindex type
StartingIndexzero-based indexing or one-based indexing

Definition at line 82 of file Solvers.h.

Member Function Documentation

template<typename T, typename I, int StartingIndex = 1>
value_type limbo::solvers::MatrixCSR< T, I, StartingIndex >::at ( index_type  i,
index_type  j 
) const
inline

get element

Parameters
irow index, starting from 0
jcolumn index, starting from 0
Returns
element found

Definition at line 1813 of file Solvers.h.

template<typename T, typename I, int StartingIndex = 1>
void limbo::solvers::MatrixCSR< T, I, StartingIndex >::copy ( MatrixCSR< T, I, StartingIndex > const &  rhs)
inline

copy object

Parameters
rhsright hand side

Definition at line 1792 of file Solvers.h.

template<typename T, typename I, int StartingIndex = 1>
void limbo::solvers::MatrixCSR< T, I, StartingIndex >::initialize ( index_type  nr,
index_type  nc,
index_type  nv 
)
inline

Initialize matrix.

Parameters
nrnumber of rows
ncnumber of columns
nvnumber of non-zero values

Definition at line 1762 of file Solvers.h.

template<typename T, typename I, int StartingIndex = 1>
void limbo::solvers::MatrixCSR< T, I, StartingIndex >::set ( index_type  nr,
index_type  nc,
LinearConstraint< value_type > const *  vConstraint 
)
inline

Set from array of constraints.

Parameters
nrnumber of rows, i.e, number of constraints
ncnumber of columns, i.e., number of variables
vConstraintarray of constraints

Definition at line 1838 of file Solvers.h.


The documentation for this struct was generated from the following file: