Public Types | Public Member Functions | List of all members
GenericMatrix< T > Class Template Reference

#include <matrix.hpp>

Inheritance diagram for GenericMatrix< T >:
Inheritance graph
[legend]

Public Types

typedef Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor|Eigen::AutoAlignBase
 
- Public Types inherited from Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor|Eigen::AutoAlign >
enum  
 
typedef PlainObjectBase< MatrixBase
 Base class typedef. More...
 
typedef Base::PlainObject PlainObject
 
- Public Types inherited from Eigen::PlainObjectBase< Derived >
enum  { Options = internal::traits<Derived>::Options }
 
enum  { NeedsToAlign = SizeAtCompileTime != Dynamic && (internal::traits<Derived>::Flags & AlignedBit) != 0 }
 
typedef Eigen::Map< Derived, AlignedAlignedMapType
 
typedef internal::dense_xpr_base< Derived >::type Base
 
typedef const Eigen::Map< const Derived, AlignedConstAlignedMapType
 
typedef const Eigen::Map< const Derived, UnalignedConstMapType
 
typedef Derived DenseType
 
typedef internal::traits< Derived >::Index Index
 
typedef Eigen::Map< Derived, UnalignedMapType
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

GenericMatrix absolute () const
 
GenericMatrixappendCols (const GenericMatrix &_arg)
 
GenericMatrixappendRows (const GenericMatrix &_arg)
 
template<typename OtherDerived >
 GenericMatrix (const Eigen::MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
 GenericMatrix (const Eigen::ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
 GenericMatrix (const Eigen::EigenBase< OtherDerived > &other)
 
GenericMatrix< TgetAbsolute () const
 
GenericVector< TgetCol (unsigned _idx) const
 
GenericMatrix getCols (unsigned _start, unsigned _end) const
 
T getConditionNumber () const
 
GenericVector< TgetDiag () const
 
unsigned getDim () const
 
T getMax () const
 
T getMean () const
 
T getMin () const
 
T getNorm () const
 
unsigned getNumCols () const
 
unsigned getNumRows () const
 
GenericVector< TgetRow (unsigned _idx) const
 
GenericMatrix getRows (unsigned _start, unsigned _end) const
 
T getTrace () const
 
void init (unsigned _nRows=0, unsigned _nCols=0)
 
bool isEmpty () const
 
bool isPositiveDefinite () const
 
bool isPositiveSemiDefinite () const
 
bool isSquare () const
 
bool isSymmetric () const
 
GenericMatrixmakeVector ()
 
GenericMatrix negative () const
 
bool operator!= (const GenericMatrix &arg) const
 
bool operator== (const GenericMatrix &arg) const
 
GenericMatrix positive () const
 
virtual returnValue print (std::ostream &_stream=std::cout, const std::string &_name=DEFAULT_LABEL, const std::string &_startString=DEFAULT_START_STRING, const std::string &_endString=DEFAULT_END_STRING, uint _width=DEFAULT_WIDTH, uint _precision=DEFAULT_PRECISION, const std::string &_colSeparator=DEFAULT_COL_SEPARATOR, const std::string &_rowSeparator=DEFAULT_ROW_SEPARATOR) const
 
virtual returnValue print (std::ostream &stream, const std::string &name, PrintScheme printScheme) const
 
virtual returnValue print (const std::string &_filename, const std::string &_name=DEFAULT_LABEL, const std::string &_startString=DEFAULT_START_STRING, const std::string &_endString=DEFAULT_END_STRING, uint _width=DEFAULT_WIDTH, uint _precision=DEFAULT_PRECISION, const std::string &_colSeparator=DEFAULT_COL_SEPARATOR, const std::string &_rowSeparator=DEFAULT_ROW_SEPARATOR) const
 
virtual returnValue print (const std::string &_filename, const std::string &_name, PrintScheme _printScheme) const
 
virtual returnValue read (std::istream &_stream)
 
virtual returnValue read (const std::string &_filename)
 
void setAll (const T &_value)
 
GenericMatrixsetCol (unsigned _idx, const GenericVector< T > &_arg)
 
GenericMatrixsetRow (unsigned _idx, const GenericVector< T > &_values)
 
GenericVector< TsumCol () const
 
GenericVector< TsumRow () const
 
returnValue symmetrize ()
 
virtual ~GenericMatrix ()
 
Constructors.
 GenericMatrix ()
 
 GenericMatrix (const T &_value)
 
 GenericMatrix (unsigned _nRows, unsigned _nCols)
 
 GenericMatrix (unsigned _nRows, unsigned _nCols, const T *const _values)
 
 GenericMatrix (unsigned _nRows, unsigned _nCols, std::vector< T > &_values)
 
 GenericMatrix (unsigned _nRows, unsigned _nCols, std::vector< std::vector< T > > &_values)
 
- Public Member Functions inherited from Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor|Eigen::AutoAlign >
Index innerStride () const
 
EIGEN_STRONG_INLINE Matrix ()
 Default constructor. More...
 
 Matrix (internal::constructor_without_unaligned_array_assert)
 
EIGEN_STRONG_INLINE Matrix (Index dim)
 Constructs a vector or row-vector with given dimension. . More...
 
EIGEN_STRONG_INLINE Matrix (const T0 &x, const T1 &y)
 
EIGEN_STRONG_INLINE Matrix (const Scalar &x, const Scalar &y, const Scalar &z)
 Constructs an initialized 3D vector with given coefficients. More...
 
EIGEN_STRONG_INLINE Matrix (const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w)
 Constructs an initialized 4D vector with given coefficients. More...
 
 Matrix (const Scalar *data)
 
EIGEN_STRONG_INLINE Matrix (const MatrixBase< OtherDerived > &other)
 Constructor copying the value of the expression other. More...
 
EIGEN_STRONG_INLINE Matrix (const Matrix &other)
 Copy constructor. More...
 
EIGEN_STRONG_INLINE Matrix (const ReturnByValue< OtherDerived > &other)
 Copy constructor with in-place evaluation. More...
 
EIGEN_STRONG_INLINE Matrix (const EigenBase< OtherDerived > &other)
 Copy constructor for generic expressions. More...
 
 Matrix (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 Constructs a Dim x Dim rotation matrix from the rotation r. More...
 
EIGEN_STRONG_INLINE Matrixoperator= (const Matrix &other)
 Assigns matrices to each other. More...
 
EIGEN_STRONG_INLINE Matrixoperator= (const MatrixBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE Matrixoperator= (const EigenBase< OtherDerived > &other)
 Copies the generic expression other into *this. More...
 
EIGEN_STRONG_INLINE Matrixoperator= (const ReturnByValue< OtherDerived > &func)
 
Matrixoperator= (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 
Index outerStride () const
 
void swap (MatrixBase< OtherDerived > const &other)
 
- Public Member Functions inherited from Eigen::PlainObjectBase< Derived >
Basebase ()
 
const Basebase () const
 
EIGEN_STRONG_INLINE const Scalarcoeff (Index rowId, Index colId) const
 
EIGEN_STRONG_INLINE const Scalarcoeff (Index index) const
 
EIGEN_STRONG_INLINE ScalarcoeffRef (Index rowId, Index colId)
 
EIGEN_STRONG_INLINE ScalarcoeffRef (Index index)
 
EIGEN_STRONG_INLINE const ScalarcoeffRef (Index rowId, Index colId) const
 
EIGEN_STRONG_INLINE const ScalarcoeffRef (Index index) const
 
EIGEN_STRONG_INLINE Index cols () const
 
EIGEN_STRONG_INLINE void conservativeResize (Index nbRows, Index nbCols)
 
EIGEN_STRONG_INLINE void conservativeResize (Index nbRows, NoChange_t)
 
EIGEN_STRONG_INLINE void conservativeResize (NoChange_t, Index nbCols)
 
EIGEN_STRONG_INLINE void conservativeResize (Index size)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE void conservativeResizeLike (const DenseBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE const Scalardata () const
 
EIGEN_STRONG_INLINE Scalardata ()
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & lazyAssign (const DenseBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE Derived & operator= (const PlainObjectBase &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & operator= (const ReturnByValue< OtherDerived > &func)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<int LoadMode>
EIGEN_STRONG_INLINE PacketScalar packet (Index rowId, Index colId) const
 
template<int LoadMode>
EIGEN_STRONG_INLINE PacketScalar packet (Index index) const
 
EIGEN_STRONG_INLINE PlainObjectBase ()
 
 PlainObjectBase (internal::constructor_without_unaligned_array_assert)
 
EIGEN_STRONG_INLINE PlainObjectBase (Index a_size, Index nbRows, Index nbCols)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE PlainObjectBase (const EigenBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE void resize (Index nbRows, Index nbCols)
 
void resize (Index size)
 
void resize (NoChange_t, Index nbCols)
 
void resize (Index nbRows, NoChange_t)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE void resizeLike (const EigenBase< OtherDerived > &_other)
 
EIGEN_STRONG_INLINE Index rows () const
 
Derived & setConstant (Index size, const Scalar &value)
 
Derived & setConstant (Index rows, Index cols, const Scalar &value)
 
Derived & setOnes (Index size)
 
Derived & setOnes (Index rows, Index cols)
 
Derived & setRandom (Index size)
 
Derived & setRandom (Index rows, Index cols)
 
Derived & setZero (Index size)
 
Derived & setZero (Index rows, Index cols)
 
template<int StoreMode>
EIGEN_STRONG_INLINE void writePacket (Index rowId, Index colId, const PacketScalar &val)
 
template<int StoreMode>
EIGEN_STRONG_INLINE void writePacket (Index index, const PacketScalar &val)
 

Additional Inherited Members

- Static Public Member Functions inherited from Eigen::PlainObjectBase< Derived >
static EIGEN_STRONG_INLINE void _check_template_params ()
 
static ConstMapType Map (const Scalar *data)
 
static MapType Map (Scalar *data)
 
static ConstMapType Map (const Scalar *data, Index size)
 
static MapType Map (Scalar *data, Index size)
 
static ConstMapType Map (const Scalar *data, Index rows, Index cols)
 
static MapType Map (Scalar *data, Index rows, Index cols)
 
static ConstAlignedMapType MapAligned (const Scalar *data)
 
static AlignedMapType MapAligned (Scalar *data)
 
static ConstAlignedMapType MapAligned (const Scalar *data, Index size)
 
static AlignedMapType MapAligned (Scalar *data, Index size)
 
static ConstAlignedMapType MapAligned (const Scalar *data, Index rows, Index cols)
 
static AlignedMapType MapAligned (Scalar *data, Index rows, Index cols)
 
template<int Outer, int Inner>
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
template<int Outer, int Inner>
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
- Protected Member Functions inherited from Eigen::PlainObjectBase< Derived >
template<typename T0 , typename T1 >
EIGEN_STRONG_INLINE void _init2 (Index nbRows, Index nbCols, typename internal::enable_if< Base::SizeAtCompileTime!=2, T0 >::type *=0)
 
template<typename T0 , typename T1 >
EIGEN_STRONG_INLINE void _init2 (const Scalar &val0, const Scalar &val1, typename internal::enable_if< Base::SizeAtCompileTime==2, T0 >::type *=0)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE void _resize_to_match (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & _set (const DenseBase< OtherDerived > &other)
 Copies the value of the expression other into *this with automatic resizing. More...
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & _set_noalias (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE void _set_selector (const OtherDerived &other, const internal::true_type &)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE void _set_selector (const OtherDerived &other, const internal::false_type &)
 
template<typename OtherDerived >
void _swap (DenseBase< OtherDerived > const &other)
 
- Protected Attributes inherited from Eigen::PlainObjectBase< Derived >
DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Optionsm_storage
 

Detailed Description

template<typename T>
class GenericMatrix< T >

A generic matrix class based on Eigen's matrix class.

Definition at line 45 of file matrix.hpp.

Member Typedef Documentation

Handy typedef for the base matrix class.

Definition at line 55 of file matrix.hpp.

Constructor & Destructor Documentation

template<typename T>
template<typename OtherDerived >
GenericMatrix< T >::GenericMatrix ( const Eigen::MatrixBase< OtherDerived > &  other)
inline

Constructor from any other Eigen::MatrixBase derived class.

Definition at line 60 of file matrix.hpp.

template<typename T>
template<typename OtherDerived >
GenericMatrix< T >::GenericMatrix ( const Eigen::ReturnByValue< OtherDerived > &  other)
inline

Constructor from any other Eigen::ReturnByValue derived class.

Definition at line 64 of file matrix.hpp.

template<typename T>
template<typename OtherDerived >
GenericMatrix< T >::GenericMatrix ( const Eigen::EigenBase< OtherDerived > &  other)
inline

Constructor from any other Eigen::EigenBase derived class.

Definition at line 68 of file matrix.hpp.

template<typename T>
GenericMatrix< T >::GenericMatrix ( )
inline

Default ctor

Definition at line 78 of file matrix.hpp.

template<typename T>
GenericMatrix< T >::GenericMatrix ( const T _value)
inline

Ctor with scalar initializtion.

Definition at line 81 of file matrix.hpp.

template<typename T>
GenericMatrix< T >::GenericMatrix ( unsigned  _nRows,
unsigned  _nCols 
)
inline

Ctor that accepts matrix dimensions.

Definition at line 87 of file matrix.hpp.

template<typename T>
GenericMatrix< T >::GenericMatrix ( unsigned  _nRows,
unsigned  _nCols,
const T *const  _values 
)
inline

Ctor that accepts matrix dimensions and initialization data in C-like array.

Definition at line 94 of file matrix.hpp.

template<typename T>
GenericMatrix< T >::GenericMatrix ( unsigned  _nRows,
unsigned  _nCols,
std::vector< T > &  _values 
)
inline

Ctor that accepts matrix dimensions and initialization data in STL 1D vector.

Definition at line 102 of file matrix.hpp.

template<typename T>
BEGIN_NAMESPACE_ACADO GenericMatrix< T >::GenericMatrix ( unsigned  _nRows,
unsigned  _nCols,
std::vector< std::vector< T > > &  _values 
)

Ctor that accepts matrix dimensions and initialization data in STL 2D array.

Definition at line 42 of file matrix.cpp.

template<typename T>
virtual GenericMatrix< T >::~GenericMatrix ( )
inlinevirtual

Destructor.

Definition at line 117 of file matrix.hpp.

Member Function Documentation

template<typename T >
GenericMatrix< T > GenericMatrix< T >::absolute ( ) const

Returns the a matrix whose components are the absolute values of the components of this object.

Definition at line 193 of file matrix.cpp.

template<typename T >
GenericMatrix< T > & GenericMatrix< T >::appendCols ( const GenericMatrix< T > &  _arg)

Appends columns at the end of the matrix.

Definition at line 83 of file matrix.cpp.

template<typename T >
GenericMatrix< T > & GenericMatrix< T >::appendRows ( const GenericMatrix< T > &  _arg)

Appends rows at the end of the matrix.

Definition at line 62 of file matrix.cpp.

template<typename T>
GenericMatrix< T > GenericMatrix< T >::getAbsolute ( ) const
inline

Return a new vector with absolute elements.

Definition at line 305 of file matrix.hpp.

template<typename T>
GenericVector< T > GenericMatrix< T >::getCol ( unsigned  _idx) const
inline

Returns a given column of the matrix object.

Definition at line 205 of file matrix.hpp.

template<typename T>
GenericMatrix GenericMatrix< T >::getCols ( unsigned  _start,
unsigned  _end 
) const
inline

Returns given columns of the matrix object.

Definition at line 246 of file matrix.hpp.

template<typename T >
T GenericMatrix< T >::getConditionNumber ( ) const

Returns condition number of the square matrix based on SVD.

Note
Works for square matrices, only.

Definition at line 235 of file matrix.cpp.

template<typename T >
GenericVector< T > GenericMatrix< T >::getDiag ( ) const

Returns a vector containing the diagonal elements of a square matrix.

Definition at line 131 of file matrix.cpp.

template<typename T>
unsigned GenericMatrix< T >::getDim ( ) const
inline

Returns total number of elements of the matrix object.

Definition at line 181 of file matrix.hpp.

template<typename T>
T GenericMatrix< T >::getMax ( ) const
inline

Returns maximum element.

Definition at line 293 of file matrix.hpp.

template<typename T>
T GenericMatrix< T >::getMean ( ) const
inline

Returns mean value of all elements.

Definition at line 301 of file matrix.hpp.

template<typename T>
T GenericMatrix< T >::getMin ( ) const
inline

Returns minimum element.

Definition at line 297 of file matrix.hpp.

template<typename T >
T GenericMatrix< T >::getNorm ( ) const

Returns Frobenius norm of the matrix.

Definition at line 227 of file matrix.cpp.

template<typename T>
unsigned GenericMatrix< T >::getNumCols ( ) const
inline

Returns number of columns of the matrix object.

Definition at line 189 of file matrix.hpp.

template<typename T>
unsigned GenericMatrix< T >::getNumRows ( ) const
inline

Returns number of rows of the matrix object.

Definition at line 185 of file matrix.hpp.

template<typename T>
GenericVector< T > GenericMatrix< T >::getRow ( unsigned  _idx) const
inline

Returns a given row of the matrix object.

Definition at line 197 of file matrix.hpp.

template<typename T>
GenericMatrix GenericMatrix< T >::getRows ( unsigned  _start,
unsigned  _end 
) const
inline

Returns given rows of the matrix object.

Definition at line 235 of file matrix.hpp.

template<typename T >
T GenericMatrix< T >::getTrace ( ) const

Returns trace of the matrix.

Definition at line 231 of file matrix.cpp.

template<typename T>
void GenericMatrix< T >::init ( unsigned  _nRows = 0,
unsigned  _nCols = 0 
)
inline

Initialization routine.

Definition at line 135 of file matrix.hpp.

template<typename T>
bool GenericMatrix< T >::isEmpty ( ) const
inline

Returns whether the vector is empty.

Definition at line 193 of file matrix.hpp.

template<typename T >
bool GenericMatrix< T >::isPositiveDefinite ( ) const

Tests if object is a (strictly) positive definite matrix.

Note
This test involves a Cholesky decomposition.

Definition at line 184 of file matrix.cpp.

template<typename T >
bool GenericMatrix< T >::isPositiveSemiDefinite ( ) const

Tests if object is a positive semi-definite matrix.

Note
This test involves a Cholesky decomposition.

Definition at line 173 of file matrix.cpp.

template<typename T >
bool GenericMatrix< T >::isSquare ( ) const

Is the matrix square?

Definition at line 135 of file matrix.cpp.

template<typename T >
bool GenericMatrix< T >::isSymmetric ( ) const

Tests if object is a symmetric matrix.

Definition at line 139 of file matrix.cpp.

template<typename T >
GenericMatrix< T > & GenericMatrix< T >::makeVector ( )

Reshapes a matrix into a column vector.

Definition at line 124 of file matrix.cpp.

template<typename T >
GenericMatrix< T > GenericMatrix< T >::negative ( ) const

Returns the a matrix whose components are equal to the components of this object, if they are negative or zero, but zero otherwise.

Definition at line 212 of file matrix.cpp.

template<typename T>
bool GenericMatrix< T >::operator!= ( const GenericMatrix< T > &  arg) const
inline

Inequality operator.

Definition at line 129 of file matrix.hpp.

template<typename T>
bool GenericMatrix< T >::operator== ( const GenericMatrix< T > &  arg) const
inline

Equality operator.

Definition at line 121 of file matrix.hpp.

template<typename T >
GenericMatrix< T > GenericMatrix< T >::positive ( ) const

Returns the a matrix whose components are equal to the components of this object, if they are positive or zero, but zero otherwise.

Definition at line 197 of file matrix.cpp.

template<typename T >
returnValue GenericMatrix< T >::print ( std::ostream &  _stream = std::cout,
const std::string &  _name = DEFAULT_LABEL,
const std::string &  _startString = DEFAULT_START_STRING,
const std::string &  _endString = DEFAULT_END_STRING,
uint  _width = DEFAULT_WIDTH,
uint  _precision = DEFAULT_PRECISION,
const std::string &  _colSeparator = DEFAULT_COL_SEPARATOR,
const std::string &  _rowSeparator = DEFAULT_ROW_SEPARATOR 
) const
virtual

Prints object to given file. Various settings can be specified defining its output format.

Parameters
[in]_streamOutput stream for printing.
[in]_nameName label to be printed before the numerical values.
[in]_startStringPrefix before printing the numerical values.
[in]_endStringSuffix after printing the numerical values.
[in]_widthTotal number of digits per single numerical value.
[in]_precisionNumber of decimals per single numerical value.
[in]_colSeparatorSeparator between the columns of the numerical values.
[in]_rowSeparatorSeparator between the rows of the numerical values.
Returns
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_UNKNOWN_BUG

Definition at line 254 of file matrix.cpp.

template<typename T >
returnValue GenericMatrix< T >::print ( std::ostream &  stream,
const std::string &  name,
PrintScheme  printScheme 
) const
virtual

Prints object to given file. Various settings can be specified defining its output format.

Parameters
[in]_streamOutput stream for printing.
[in]_nameName label to be printed before the numerical values.
[in]_printSchemePrint scheme defining the output format of the information.
Returns
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_UNKNOWN_BUG

Definition at line 332 of file matrix.cpp.

template<typename T >
returnValue GenericMatrix< T >::print ( const std::string &  _filename,
const std::string &  _name = DEFAULT_LABEL,
const std::string &  _startString = DEFAULT_START_STRING,
const std::string &  _endString = DEFAULT_END_STRING,
uint  _width = DEFAULT_WIDTH,
uint  _precision = DEFAULT_PRECISION,
const std::string &  _colSeparator = DEFAULT_COL_SEPARATOR,
const std::string &  _rowSeparator = DEFAULT_ROW_SEPARATOR 
) const
virtual

Prints object to file with given name. Various settings can be specified defining its output format.

Parameters
[in]_filenameFilename for printing.
[in]_nameName label to be printed before the numerical values.
[in]_startStringPrefix before printing the numerical values.
[in]_endStringSuffix after printing the numerical values.
[in]_widthTotal number of digits per single numerical value.
[in]_precisionNumber of decimals per single numerical value.
[in]_colSeparatorSeparator between the columns of the numerical values.
[in]_rowSeparatorSeparator between the rows of the numerical values.
Returns
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_UNKNOWN_BUG

Definition at line 376 of file matrix.cpp.

template<typename T >
returnValue GenericMatrix< T >::print ( const std::string &  _filename,
const std::string &  _name,
PrintScheme  _printScheme 
) const
virtual

Prints object to given file. Various settings can be specified defining its output format.

Parameters
[in]_filenameFilename for printing.
[in]_nameName label to be printed before the numerical values.
[in]_printSchemePrint scheme defining the output format of the information.
Returns
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_UNKNOWN_BUG

Definition at line 400 of file matrix.cpp.

template<typename T >
returnValue GenericMatrix< T >::read ( std::istream &  _stream)
virtual

Read matrix data from an input stream.

Definition at line 419 of file matrix.cpp.

template<typename T >
returnValue GenericMatrix< T >::read ( const std::string &  _filename)
virtual

Read data from an input file.

Definition at line 443 of file matrix.cpp.

template<typename T>
void GenericMatrix< T >::setAll ( const T _value)
inline

Set all elements constant.

Definition at line 141 of file matrix.hpp.

template<typename T>
GenericMatrix& GenericMatrix< T >::setCol ( unsigned  _idx,
const GenericVector< T > &  _arg 
)
inline

Assigns new values to a given column of the matrix object.

Definition at line 224 of file matrix.hpp.

template<typename T>
GenericMatrix& GenericMatrix< T >::setRow ( unsigned  _idx,
const GenericVector< T > &  _values 
)
inline

Assigns new values to a given row of the matrix object.

Definition at line 213 of file matrix.hpp.

template<typename T >
GenericVector< T > GenericMatrix< T >::sumCol ( ) const

Computes the column-wise sum the DMatrix

Example:

a | b
c | d

returns [a+b;c+d]

Definition at line 104 of file matrix.cpp.

template<typename T >
GenericVector< T > GenericMatrix< T >::sumRow ( ) const

Computes the row-wise sum the DMatrix

Example:

a | b
c | d

returns [a+c|b+d]

Definition at line 114 of file matrix.cpp.

template<typename T >
returnValue GenericMatrix< T >::symmetrize ( )

Make the matrix symmetric.

Definition at line 156 of file matrix.cpp.


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


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