Shiokaze Framework
A research-oriented fluid solver for computer graphics
RCMatrix_interface< N, T > Class Template Referenceabstract

Interface for Row Compressed Matrix. More...

#include <RCMatrix_interface.h>

Public Member Functions

virtual void initialize (N rows, N columns)=0
 Initialize matrix with rows and columns. More...
 
virtual void copy (const RCMatrix_interface< N, T > *m)=0
 Copy the input matrix. More...
 
virtual void clear (N row)=0
 Clear the entire row with zeros. More...
 
virtual T get (N row, N column) const =0
 Get the element value at the row and the column. More...
 
virtual void add_to_element (N row, N column, T increment_value)=0
 Add a value to an element. More...
 
virtual void clear_element (N row, N column)=0
 Clear out an element with zero. More...
 
virtual void interruptible_for_each (N row, std::function< bool(N column, T &value)> func)=0
 Manipulate values in serial order. More...
 
virtual void const_interruptible_for_each (N row, std::function< bool(N column, T value)> func) const =0
 Read values in serial order. More...
 
virtual N rows () const =0
 Get the size of rows. More...
 
virtual N columns () const =0
 Get the size of columns. More...
 
virtual N non_zeros (N row) const =0
 Get the size of non zero entries in a row. More...
 
RCMatrix_ptr< N, T > duplicate () const
 Duplicate matrix. More...
 
void clear ()
 Reset all the elements with zeros.
 
non_zeros () const
 Get the number of all the non-zero entries. More...
 
bool empty () const
 Get if the matrix is empty. More...
 
bool empty (N row) const
 Get if a row in the matrix is empty. More...
 
void for_each (N row, std::function< void(N column, T &value)> func)
 Manipulate elements in serial order. More...
 
void const_for_each (N row, std::function< void(N column, T value)> func) const
 Read elements in serial order. More...
 
virtual void multiply (T value)=0
 Multiply a value to all the elements. More...
 
virtual void multiply (const RCMatrix_vector_interface< N, T > *rhs, RCMatrix_vector_interface< N, T > *result) const =0
 Apply multiplication to an input vector and substitute to a result vector. More...
 
virtual void multiply (const RCMatrix_interface< N, T > *m, RCMatrix_interface< N, T > *result) const =0
 Apply multiplication to an input matrix of the form: [result] = [self][m]. More...
 
virtual void add (const RCMatrix_interface< N, T > *m, RCMatrix_interface< N, T > *result) const =0
 Add a matrix. More...
 
virtual void transpose (RCMatrix_interface< N, T > *result) const =0
 Transpose this matrix. More...
 
virtual RCFixedMatrix_ptr< N, T > make_fixed () const =0
 Make a fixed matrix. More...
 
RCMatrix_vector_ptr< N, T > multiply (const RCMatrix_vector_interface< N, T > *rhs) const
 Apply multiplication to an input vector. More...
 
RCMatrix_ptr< N, T > multiply (const RCMatrix_interface< N, T > *m) const
 Apply multiplication to an input matrix of the form: [result] = [self][m]. More...
 
RCMatrix_ptr< N, T > add (const RCMatrix_interface< N, T > *m) const
 Add to an input matrix. More...
 
RCMatrix_ptr< N, T > transpose () const
 Transpose this matrix. More...
 
template<class Y >
void multiply (const std::vector< Y > &rhs, std::vector< Y > &result) const
 Apply multiplication to an input vector and substitute to a result vector. Provided to preserve std::vector compatibility. More...
 
template<class Y >
std::vector< Y > multiply (const std::vector< Y > &rhs) const
 Apply multiplication to an input vector. Provided to preserve std::vector compatibility. More...
 

Detailed Description

template<class N, class T>
class RCMatrix_interface< N, T >

Interface for Row Compressed Matrix.

Member Function Documentation

◆ add() [1/2]

template<class N , class T >
RCMatrix_ptr<N,T> RCMatrix_interface< N, T >::add ( const RCMatrix_interface< N, T > *  m) const
inline

Add to an input matrix.

Parameters
[in-out]rhs Input matrix to add. @retrun Resulting matrix.

◆ add() [2/2]

template<class N , class T >
virtual void RCMatrix_interface< N, T >::add ( const RCMatrix_interface< N, T > *  m,
RCMatrix_interface< N, T > *  result 
) const
pure virtual

Add a matrix.

Parameters
[in]mMatrix to add.
[out]resultResult.

◆ add_to_element()

template<class N , class T >
virtual void RCMatrix_interface< N, T >::add_to_element ( row,
column,
increment_value 
)
pure virtual

Add a value to an element.

Parameters
[in]rowRow index position.
[in]columnColumn index position.
[in]increment_valueIncremental value.

◆ clear()

template<class N , class T >
virtual void RCMatrix_interface< N, T >::clear ( row)
pure virtual

Clear the entire row with zeros.

Parameters
[in]rowRow index position.

◆ clear_element()

template<class N , class T >
virtual void RCMatrix_interface< N, T >::clear_element ( row,
column 
)
pure virtual

Clear out an element with zero.

Parameters
[in]rowRow index position.
[in]columnColumn index position.

◆ columns()

template<class N , class T >
virtual N RCMatrix_interface< N, T >::columns ( ) const
pure virtual

Get the size of columns.

Returns
Size of columns.

◆ const_for_each()

template<class N , class T >
void RCMatrix_interface< N, T >::const_for_each ( row,
std::function< void(N column, T value)>  func 
) const
inline

Read elements in serial order.

Parameters
[in]rowRow index position.
[in]funcFunction that reads values.

◆ const_interruptible_for_each()

template<class N , class T >
virtual void RCMatrix_interface< N, T >::const_interruptible_for_each ( row,
std::function< bool(N column, T value)>  func 
) const
pure virtual

Read values in serial order.

Parameters
[in]rowRow index position.
[in]funcFunction that reads values. Return true to stop the iteration.

◆ copy()

template<class N , class T >
virtual void RCMatrix_interface< N, T >::copy ( const RCMatrix_interface< N, T > *  m)
pure virtual

Copy the input matrix.

Parameters
[in]mMatrix from which to copy.

◆ duplicate()

template<class N , class T >
RCMatrix_ptr<N,T> RCMatrix_interface< N, T >::duplicate ( ) const
inline

Duplicate matrix.

Returns
Duplicated matrix.

◆ empty() [1/2]

template<class N , class T >
bool RCMatrix_interface< N, T >::empty ( ) const
inline

Get if the matrix is empty.

Returns
true if the matrix is empty. false otherwise.

◆ empty() [2/2]

template<class N , class T >
bool RCMatrix_interface< N, T >::empty ( row) const
inline

Get if a row in the matrix is empty.

Parameters
[in]rowRow index position.
Returns
true if the row is empty. false otherwise.

◆ for_each()

template<class N , class T >
void RCMatrix_interface< N, T >::for_each ( row,
std::function< void(N column, T &value)>  func 
)
inline

Manipulate elements in serial order.

Parameters
[in]rowRow index position.
[in]funcManipulation function.

◆ get()

template<class N , class T >
virtual T RCMatrix_interface< N, T >::get ( row,
column 
) const
pure virtual

Get the element value at the row and the column.

Parameters
[in]rowRow index position.
[in]columnColumn index position.
Returns
Value of the element.

◆ initialize()

template<class N , class T >
virtual void RCMatrix_interface< N, T >::initialize ( rows,
columns 
)
pure virtual

Initialize matrix with rows and columns.

Parameters
[in]rowsSize of rows.
[in]columnsSize of columns.

◆ interruptible_for_each()

template<class N , class T >
virtual void RCMatrix_interface< N, T >::interruptible_for_each ( row,
std::function< bool(N column, T &value)>  func 
)
pure virtual

Manipulate values in serial order.

Parameters
[in]rowRow index position.
[in]funcManipulation function. Return true to stop the iteration.

◆ make_fixed()

template<class N , class T >
virtual RCFixedMatrix_ptr<N,T> RCMatrix_interface< N, T >::make_fixed ( ) const
pure virtual

Make a fixed matrix.

Returns
Generated fixed matrix.

◆ multiply() [1/7]

template<class N , class T >
RCMatrix_ptr<N,T> RCMatrix_interface< N, T >::multiply ( const RCMatrix_interface< N, T > *  m) const
inline

Apply multiplication to an input matrix of the form: [result] = [self][m].

Parameters
[in-out]rhs Input matrix to apply. @retrun Resulting matrix.

◆ multiply() [2/7]

template<class N , class T >
virtual void RCMatrix_interface< N, T >::multiply ( const RCMatrix_interface< N, T > *  m,
RCMatrix_interface< N, T > *  result 
) const
pure virtual

Apply multiplication to an input matrix of the form: [result] = [self][m].

Parameters
[in]rhsInput matrix to apply.
[out]resultResult matrix.

◆ multiply() [3/7]

template<class N , class T >
RCMatrix_vector_ptr<N,T> RCMatrix_interface< N, T >::multiply ( const RCMatrix_vector_interface< N, T > *  rhs) const
inline

Apply multiplication to an input vector.

Parameters
[in-out]rhs Input vector to apply.

◆ multiply() [4/7]

template<class N , class T >
virtual void RCMatrix_interface< N, T >::multiply ( const RCMatrix_vector_interface< N, T > *  rhs,
RCMatrix_vector_interface< N, T > *  result 
) const
pure virtual

Apply multiplication to an input vector and substitute to a result vector.

Parameters
[in]rhsInput vector to apply.
[out]resultResult vector.

◆ multiply() [5/7]

template<class N , class T >
template<class Y >
std::vector<Y> RCMatrix_interface< N, T >::multiply ( const std::vector< Y > &  rhs) const
inline

Apply multiplication to an input vector. Provided to preserve std::vector compatibility.

Parameters
[in-out]rhs Input vector to apply.

◆ multiply() [6/7]

template<class N , class T >
template<class Y >
void RCMatrix_interface< N, T >::multiply ( const std::vector< Y > &  rhs,
std::vector< Y > &  result 
) const
inline

Apply multiplication to an input vector and substitute to a result vector. Provided to preserve std::vector compatibility.

Parameters
[in]rhsInput vector to apply.
[out]resultResult vector.

◆ multiply() [7/7]

template<class N , class T >
virtual void RCMatrix_interface< N, T >::multiply ( value)
pure virtual

Multiply a value to all the elements.

Parameters
[in]valueValue to multiply.

◆ non_zeros() [1/2]

template<class N , class T >
N RCMatrix_interface< N, T >::non_zeros ( ) const
inline

Get the number of all the non-zero entries.

Returns
Number of all the non-zero entries.

◆ non_zeros() [2/2]

template<class N , class T >
virtual N RCMatrix_interface< N, T >::non_zeros ( row) const
pure virtual

Get the size of non zero entries in a row.

Returns
Size of non zero entries.

◆ rows()

template<class N , class T >
virtual N RCMatrix_interface< N, T >::rows ( ) const
pure virtual

Get the size of rows.

Returns
Size of rows.

◆ transpose() [1/2]

template<class N , class T >
RCMatrix_ptr<N,T> RCMatrix_interface< N, T >::transpose ( ) const
inline

Transpose this matrix.

Returns
result Result.

◆ transpose() [2/2]

template<class N , class T >
virtual void RCMatrix_interface< N, T >::transpose ( RCMatrix_interface< N, T > *  result) const
pure virtual

Transpose this matrix.

Parameters
[out]resultResult.

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