Helios++
Helios software for LiDAR simulations
fluxionum::AbstractDesignMatrix< T > Class Template Referenceabstract

The abstract class which represents the fundamentals of any design matrix. More...

#include <AbstractDesignMatrix.h>

Inheritance diagram for fluxionum::AbstractDesignMatrix< T >:
Collaboration diagram for fluxionum::AbstractDesignMatrix< T >:

Public Member Functions

 AbstractDesignMatrix (vector< string > const &columnNames=vector< string >(0))
 Default constructor for the AbstractDesignMatrix. More...
 
virtual T & operator() (size_t const i, size_t const j)=0
 Access operator for the element at \(i\)-th row and \(j\)-th column of the AbstractDesignMatrix. More...
 
T & operator() (size_t const i, string const columnName)
 Like the AbstractDesignMatrix::operator()(size_t const, size_t const) method but specifying the column by its name instead of its index. More...
 
bool hasColumnNames () const
 Check whether there are available column names for the AbstractDesignMatrix (true) or not (false) More...
 
string const & getColumnName (size_t const j) const
 Obtain the name of the \(j\)-th column. More...
 
void setColumnName (size_t const j, string const &columnName)
 Set the name of the \(j\)-th column. More...
 
vector< string > const & getColumnNames () const
 Obtain a constant/read reference to the column names. More...
 
void setColumnNames (vector< string > const &columnNames)
 Obtain a constant/read reference to the column names. More...
 
virtual size_t getNumRows () const =0
 Obtain the number of rows of the AbstractDesignMatrix. More...
 
virtual size_t getNumColumns () const =0
 Obtain the number of columns of the AbstractDesignMatrix. More...
 
virtual size_t getNumElements () const =0
 Obtain the number of elements of the AbstractDesignMatrix. More...
 

Protected Member Functions

size_t translateColumnNameToIndex (string const &columnName) const
 Find the corresponding column name for given index. More...
 

Protected Attributes

vector< string > columnNames
 The column names for the DesignMatrix. It can be either an empty vector when no column names are specified or a vector with as many names as columns (in the same order)
 

Detailed Description

template<typename T>
class fluxionum::AbstractDesignMatrix< T >

The abstract class which represents the fundamentals of any design matrix.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
TType \(\mathcal{T}\) of element for the design matrix \(X\) such that \(x_{ij} \in \mathcal{T}\).
See also
fluxionum::DesignMatrix

Constructor & Destructor Documentation

◆ AbstractDesignMatrix()

template<typename T >
fluxionum::AbstractDesignMatrix< T >::AbstractDesignMatrix ( vector< string > const &  columnNames = vector<string>(0))
inline

Default constructor for the AbstractDesignMatrix.

Parameters
columnNamesEither the name for each column or an empty vector if there are no names

Member Function Documentation

◆ getColumnName()

template<typename T >
string const& fluxionum::AbstractDesignMatrix< T >::getColumnName ( size_t const  j) const
inline

Obtain the name of the \(j\)-th column.

Parameters
jIndex of the column which name must be obtained
Returns
The name of the \(j\)-th column
See also
fluxionum::AbstractDesignMatrix::columnNames

◆ getColumnNames()

template<typename T >
vector<string> const& fluxionum::AbstractDesignMatrix< T >::getColumnNames ( ) const
inline

Obtain a constant/read reference to the column names.

Returns
Constant/read reference to the column names
See also
fluxionum::AbstractDesignMatrix::columnNames

◆ getNumColumns()

template<typename T >
virtual size_t fluxionum::AbstractDesignMatrix< T >::getNumColumns ( ) const
inlinepure virtual

Obtain the number of columns of the AbstractDesignMatrix.

Returns
The number of columns of the AbstractDesignMatrix

Implemented in fluxionum::DiffDesignMatrix< TimeType, VarType >, fluxionum::DesignMatrix< T >, and fluxionum::DesignMatrix< VarType >.

◆ getNumElements()

template<typename T >
virtual size_t fluxionum::AbstractDesignMatrix< T >::getNumElements ( ) const
inlinepure virtual

Obtain the number of elements of the AbstractDesignMatrix.

Returns
The number of elements of the AbstractDesignMatrix

Implemented in fluxionum::DiffDesignMatrix< TimeType, VarType >, fluxionum::DesignMatrix< T >, and fluxionum::DesignMatrix< VarType >.

◆ getNumRows()

template<typename T >
virtual size_t fluxionum::AbstractDesignMatrix< T >::getNumRows ( ) const
inlinepure virtual

◆ hasColumnNames()

template<typename T >
bool fluxionum::AbstractDesignMatrix< T >::hasColumnNames ( ) const
inline

Check whether there are available column names for the AbstractDesignMatrix (true) or not (false)

Returns
True if there are available column names, false otherwise
See also
fluxionum::AbstractDesignMatrix::columnNames

◆ operator()() [1/2]

template<typename T >
virtual T& fluxionum::AbstractDesignMatrix< T >::operator() ( size_t const  i,
size_t const  j 
)
pure virtual

Access operator for the element at \(i\)-th row and \(j\)-th column of the AbstractDesignMatrix.

Parameters
iThe row of the element being accessed
jThe column of the element being accessed
Returns
Reference to the element at \(i\)-th row and \(j\)-th column

Implemented in fluxionum::DiffDesignMatrix< TimeType, VarType >, fluxionum::DesignMatrix< T >, and fluxionum::DesignMatrix< VarType >.

◆ operator()() [2/2]

template<typename T >
T& fluxionum::AbstractDesignMatrix< T >::operator() ( size_t const  i,
string const  columnName 
)
inline

Like the AbstractDesignMatrix::operator()(size_t const, size_t const) method but specifying the column by its name instead of its index.

Parameters
columnNameThe name of the column of the element being accessed
See also
AbstractDesignMatrix::operator()(size_t const, size_t const)

◆ setColumnName()

template<typename T >
void fluxionum::AbstractDesignMatrix< T >::setColumnName ( size_t const  j,
string const &  columnName 
)
inline

Set the name of the \(j\)-th column.

Parameters
jIndex of the column which name must be setted
columnNameNew name for the \(j\)-th column
See also
fluxionum::AbstractDesignMatrix::columnNames

◆ setColumnNames()

template<typename T >
void fluxionum::AbstractDesignMatrix< T >::setColumnNames ( vector< string > const &  columnNames)
inline

Obtain a constant/read reference to the column names.

Parameters
columnNamesThe new column names for the AbstractDesignMatrix
See also
fluxionum::AbstractDesignMatrix::columnNames

◆ translateColumnNameToIndex()

template<typename T >
size_t fluxionum::AbstractDesignMatrix< T >::translateColumnNameToIndex ( string const &  columnName) const
inlineprotected

Find the corresponding column name for given index.

Parameters
columnNameThe name of the column which index must be obtained
Returns
The index of the column which names matches given one. If none, then a fluxionum::FluxionumException will be thrown

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