roadrunner  2.6.0
Fast simulator for SBML models
Public Member Functions | List of all members
rr::Matrix< T > Class Template Reference

A basic local matrix class, based on the libstruct version. More...

#include <Matrix.h>

Inheritance diagram for rr::Matrix< T >:

Public Member Functions

 Matrix (ls::Matrix< T > &matrix)
 Constructor for creating a Matrix<T> from a ls::Matrix<T>
 
 Matrix (ls::Matrix< T > *matrix)
 Constructor for creating a Matrix<T> from a ls::Matrix<T>
 
bool operator== (Matrix< T > &other)
 Element-wise equality operator to compare a Matrix<T> with another Matrix<T> More...
 
bool operator!= (Matrix< T > &other)
 inequality operators
 
bool almostEquals (Matrix< double > &other, const double &tolerance)
 Element-wise comparison between this Matrix<double> with another. More...
 
Matrix< T > mult (Matrix< T > matrix)
 matrix multiplication operator
 
bool empty ()
 indicator method for empty Matrix. More...
 
void sortRowsByLabels ()
 Reorder Matrix rows such that row names are in alphabetical order.
 
void sortColsByLabels ()
 Reorder Matrix cols such that col names are in alphabetical order.
 
void deleteRow (int which)
 delete row More...
 
void deleteRow (const std::string &which)
 delete a row with the label More...
 
void deleteCol (int which)
 delete col More...
 
void deleteCol (const std::string &which)
 delete a col with the label More...
 

Detailed Description

template<typename T>
class rr::Matrix< T >

A basic local matrix class, based on the libstruct version.

Member Function Documentation

◆ almostEquals()

template<typename T >
bool rr::Matrix< T >::almostEquals ( Matrix< double > &  other,
const double &  tolerance 
)

Element-wise comparison between this Matrix<double> with another.

Element-wise compareison between this Matrix<double> with another.

Parameters
otherMatrix<double>
otherMatrix<double>
tolerancethe tolerance to use between the real and expected values.

◆ deleteCol() [1/2]

template<typename T >
void rr::Matrix< T >::deleteCol ( const std::string &  which)

delete a col with the label

Parameters
which.

interally uses deleteCol(int) overload after locating the index of the correct col to remove.

Note
This method assumes that col names are unique. If they are not unique then only the first found col labelled
Parameters
whichwill be removed.

◆ deleteCol() [2/2]

template<typename T >
void rr::Matrix< T >::deleteCol ( int  which)

delete col

Parameters
whichfrom the matrix.

memory isn't actually reclaimed nor the array resized. Instead the elements of the array to be removed are shifted one by one to the far right of the array that underlies the matrix. The _Col member variable is decremented so the additional elements are hidden from user.

◆ deleteRow() [1/2]

template<typename T >
void rr::Matrix< T >::deleteRow ( const std::string &  which)

delete a row with the label

Parameters
which.

interally uses deleteRow(int) overload after locating the index of the correct row to remove.

Note
This method assumes that row names are unique. If they are not unique then only the first found row labelled
Parameters
whichwill be removed.

◆ deleteRow() [2/2]

template<typename T >
void rr::Matrix< T >::deleteRow ( int  which)

delete row

Parameters
whichfrom the matrix.

memory isn't actually reclaimed nor the array resized. Instead the elements of the array to be removed are shifted one by one to the far right of the array that underlies the matrix. The _Row member variable is decremented so the additional elements are hidden from user.

If row is the last row, there's no need to actually do any deleting. Instead we just keep the items there, but reduce the size of the row. Users are only exposed to the correct set of rows.

◆ empty()

template<typename T >
bool rr::Matrix< T >::empty

indicator method for empty Matrix.

Returns
true if matrix is empty, false otherwise

◆ operator==()

template<typename T >
bool rr::Matrix< T >::operator== ( Matrix< T > &  other)

Element-wise equality operator to compare a Matrix<T> with another Matrix<T>

Note
to compare Matrix<double> use Matrix<double>::almostEqual

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