Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members

Implements a templated dense matrix class. More...

#include <t_matrix.hpp>

Public Member Functions

Tarray () const
 Converts a matrix into array form (columnwise storage) More...
 
void array (const T *pM)
 Sets the elements of a matrix from an array (columnwise storage) More...
 
Tmatrix< T > & col (const unsigned int ic)
 Sets/retrieves value of column ic. More...
 
unsigned int col () const
 Retrieves number of columns. More...
 
unsigned int getDim () const
 
unsigned int getNumCols () const
 
unsigned int getNumRows () const
 
Toperator() (const unsigned int ir, const unsigned int ic)
 
const Toperator() (const unsigned int ir, const unsigned int ic) const
 
Toperator() (const unsigned int ie)
 
const Toperator() (const unsigned int ie) const
 
template<typename U >
Tmatrix< T > & operator*= (const Tmatrix< U > &M)
 
template<typename U >
Tmatrix< T > & operator*= (const U &m)
 
template<typename U >
Tmatrix< T > & operator+= (const Tmatrix< U > &M)
 
template<typename U >
Tmatrix< T > & operator+= (const U &m)
 
template<typename U >
Tmatrix< T > & operator-= (const Tmatrix< U > &M)
 
template<typename U >
Tmatrix< T > & operator-= (const U &m)
 
template<typename U >
Tmatrix< T > & operator/= (const U &m)
 
Tmatrix< T > & operator= (const Tmatrix< T > &M)
 
Tmatrix< T > & operator= (const T &m)
 
T *& pval (const unsigned int ir, const unsigned int ic)
 Sets/retrieves pointer to entry (ir,ic) More...
 
void resize (const unsigned int nr, const unsigned int nc=1, const bool alloc=true)
 Resets the dimension of a Tmatrix objects. More...
 
Tmatrix< T > & row (const unsigned int ir)
 Sets/retrieves value of row ir. More...
 
unsigned int row () const
 Retrieves number of rows. More...
 
Tmatrix< unsigned int > sort ()
 Other operators. More...
 
 Tmatrix ()
 Default constructor. More...
 
 Tmatrix (const unsigned int nr, const unsigned int nc=1, const bool alloc=true)
 Constructor doing size assignment. More...
 
template<typename U >
 Tmatrix (const unsigned int nr, const unsigned int nc, const U &v, const bool alloc=true)
 Constructor doing size assignment and element initialization. More...
 
 Tmatrix (const Tmatrix< T > &M)
 Copy Constructor. More...
 
template<typename U >
 Tmatrix (const Tmatrix< U > &M)
 Copy Constructor doing type conversion. More...
 
 ~Tmatrix ()
 Destructor. More...
 

Private Member Functions

T *& _pval (const unsigned int ie)
 Returns a pointer to actual value at position ie. More...
 
void _reset ()
 Resets the entries in vector _data. More...
 
T_val (const unsigned int ir, const unsigned int ic)
 Returns a reference to actual value at position ie. More...
 
const T_val (const unsigned int ir, const unsigned int ic) const
 
T_val (const unsigned int ie)
 
const T_val (const unsigned int ie) const
 

Static Private Member Functions

static unsigned int _digits (unsigned int n)
 Returns the number of digits of an unsigned int value. More...
 

Private Attributes

std::vector< T * > _data
 Vector of pointers to elements (column-wise storage) More...
 
unsigned int _nc
 Number of columns. More...
 
unsigned int _nr
 Number of rows. More...
 
Tmatrix< T > * _pblock
 Pointer to Tmatrix<T> container storing blocks. More...
 
Tmatrix< T > * _pcol
 Pointer to Tmatrix<T> container storing column. More...
 
Tmatrix< T > * _prow
 Pointer to Tmatrix<T> container storing row. More...
 
bool _sub
 Flag indicating whether the current object is a submatrix. More...
 

Friends

template<typename U , typename V >
Tmatrix< Uoperator* (const Tmatrix< U > &, const V &)
 
template<typename U , typename V >
Tmatrix< Uoperator* (const V &, const Tmatrix< U > &)
 
template<typename U , typename V >
Tmatrix< Uoperator* (const Tmatrix< U > &, const Tmatrix< V > &)
 
template<typename U >
Tmatrix< Uoperator+ (const Tmatrix< U > &)
 
template<typename U , typename V >
Tmatrix< Uoperator+ (const Tmatrix< U > &, const V &)
 
template<typename U , typename V >
Tmatrix< Uoperator+ (const V &, const Tmatrix< U > &)
 
template<typename U , typename V >
Tmatrix< Uoperator+ (const Tmatrix< U > &, const Tmatrix< V > &)
 
template<typename U >
Tmatrix< Uoperator- (const Tmatrix< U > &)
 
template<typename U , typename V >
Tmatrix< Uoperator- (const Tmatrix< U > &, const V &)
 
template<typename U , typename V >
Tmatrix< Uoperator- (const U &, const Tmatrix< V > &)
 
template<typename U , typename V >
Tmatrix< Uoperator- (const Tmatrix< U > &, const Tmatrix< V > &)
 
template<typename U , typename V >
Tmatrix< Uoperator/ (const Tmatrix< U > &, const V &)
 
template<typename U >
std::ostream & operator<< (std::ostream &, const Tmatrix< U > &)
 
template<typename U >
class Tmatrix
 

Detailed Description

template<typename T>
class Tmatrix< T >

Implements a templated dense matrix class.

Implements a templated matrix class.
The class can be used to represent, e.g., interval matrices,
matrices of symbolic functions, etc..

Author
Boris Houska

Definition at line 53 of file t_matrix.hpp.

Friends And Related Function Documentation

template<typename T>
template<typename U , typename V >
Tmatrix<U> operator* ( const Tmatrix< U > &  ,
const V  
)
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator* ( const V ,
const Tmatrix< U > &   
)
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator* ( const Tmatrix< U > &  ,
const Tmatrix< V > &   
)
friend
template<typename T>
template<typename U >
Tmatrix<U> operator+ ( const Tmatrix< U > &  )
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator+ ( const Tmatrix< U > &  ,
const V  
)
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator+ ( const V ,
const Tmatrix< U > &   
)
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator+ ( const Tmatrix< U > &  ,
const Tmatrix< V > &   
)
friend
template<typename T>
template<typename U >
Tmatrix<U> operator- ( const Tmatrix< U > &  )
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator- ( const Tmatrix< U > &  ,
const V  
)
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator- ( const U ,
const Tmatrix< V > &   
)
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator- ( const Tmatrix< U > &  ,
const Tmatrix< V > &   
)
friend
template<typename T>
template<typename U , typename V >
Tmatrix<U> operator/ ( const Tmatrix< U > &  ,
const V  
)
friend
template<typename T>
template<typename U >
std::ostream& operator<< ( std::ostream &  ,
const Tmatrix< U > &   
)
friend
template<typename T>
template<typename U >
friend class Tmatrix
friend

Definition at line 56 of file t_matrix.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:27