Limbo 3.5.4
Loading...
Searching...
No Matches
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.
void reset ()
 Destroy matrix and recycle memory.
void copy (MatrixCSR const &rhs)
 copy object
value_type at (index_type i, index_type j) const
 get element
void set (index_type nr, index_type nc, LinearConstraint< value_type > const *vConstraint)
 Set from array of constraints.

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
 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 1715 of file Solvers.h.

Member Typedef Documentation

◆ index_type

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

index type

Definition at line 1720 of file Solvers.h.

◆ value_type

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

value type

Definition at line 1718 of file Solvers.h.

Constructor & Destructor Documentation

◆ MatrixCSR() [1/2]

template<typename T, typename I, int StartingIndex = 1>
limbo::solvers::MatrixCSR< T, I, StartingIndex >::MatrixCSR ( )
inline

constructor

Definition at line 1731 of file Solvers.h.

◆ MatrixCSR() [2/2]

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

copy constructor

Definition at line 1741 of file Solvers.h.

◆ ~MatrixCSR()

template<typename T, typename I, int StartingIndex = 1>
limbo::solvers::MatrixCSR< T, I, StartingIndex >::~MatrixCSR ( )
inline

destructor

Definition at line 1753 of file Solvers.h.

Member Function Documentation

◆ at()

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.

◆ copy()

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.

◆ initialize()

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.

◆ operator=()

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

assignment

Definition at line 1746 of file Solvers.h.

◆ reset()

template<typename T, typename I, int StartingIndex = 1>
void limbo::solvers::MatrixCSR< T, I, StartingIndex >::reset ( )
inline

Destroy matrix and recycle memory.

Definition at line 1774 of file Solvers.h.

◆ set()

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.

Member Data Documentation

◆ numColumns

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

number of columns, not in the CSR format

Definition at line 1726 of file Solvers.h.

◆ numElements

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

number of non-zero elements

Definition at line 1727 of file Solvers.h.

◆ numRows

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

number of rows, not in the CSR format

Definition at line 1725 of file Solvers.h.

◆ s_startingIndex

template<typename T, typename I, int StartingIndex = 1>
index_type limbo::solvers::MatrixCSR< T, I, StartingIndex >::s_startingIndex
static

starting index, like zero-based indexing or one-based indexing

Definition at line 1728 of file Solvers.h.

◆ vColumn

template<typename T, typename I, int StartingIndex = 1>
index_type* limbo::solvers::MatrixCSR< T, I, StartingIndex >::vColumn

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.

Definition at line 1723 of file Solvers.h.

◆ vElement

template<typename T, typename I, int StartingIndex = 1>
value_type* limbo::solvers::MatrixCSR< T, I, StartingIndex >::vElement

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.

Definition at line 1722 of file Solvers.h.

◆ vRowBeginIndex

template<typename T, typename I, int StartingIndex = 1>
index_type* limbo::solvers::MatrixCSR< T, I, StartingIndex >::vRowBeginIndex

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.

Definition at line 1724 of file Solvers.h.


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