34 #ifndef ACADO_TOOLKIT_MATRIX_HPP 35 #define ACADO_TOOLKIT_MATRIX_HPP 59 template<
typename OtherDerived>
63 template<
typename OtherDerived>
67 template<
typename OtherDerived>
90 : Base(_nRows, _nCols)
96 const T*
const _values
98 : Base(_nRows, _nCols)
99 { std::copy(_values, _values + _nRows * _nCols,
Base::data()); }
104 std::vector< T >& _values)
105 : Base(_nRows, _nCols)
106 { std::copy(_values.begin(), _values.end(),
Base::data()); }
111 std::vector< std::vector< T > >& _values
131 return (
operator==( arg ) ==
false);
135 void init(
unsigned _nRows = 0,
145 GenericMatrix&
appendRows(
const GenericMatrix& _arg
149 GenericMatrix&
appendCols(
const GenericMatrix& _arg
294 {
return Base::maxCoeff(); }
298 {
return Base::minCoeff(); }
302 {
return Base::mean(); }
357 const std::string&
name,
399 const std::string& _name,
463 typedef std::shared_ptr< GenericMatrix< double > >
DMatrixPtr;
477 :
traits<Matrix<T, Dynamic, Dynamic, Eigen::RowMajor | Eigen::AutoAlign> >
484 #endif // ACADO_TOOLKIT_MATRIX_HPP const char DEFAULT_END_STRING[4]
GenericVector< T > getCol(unsigned _idx) const
GenericMatrix(const T &_value)
USING_NAMESPACE_ACADO typedef TaylorVariable< Interval > T
GenericVector< T > sumCol() const
void init(unsigned _nRows=0, unsigned _nCols=0)
bool isPositiveSemiDefinite() const
GenericMatrix & appendCols(const GenericMatrix &_arg)
static const DMatrix emptyConstMatrix
const uint DEFAULT_PRECISION
GenericMatrix< bool > BMatrix
GenericMatrix & setCol(unsigned _idx, const GenericVector< T > &_arg)
GenericMatrix(const Eigen::MatrixBase< OtherDerived > &other)
Allows to pass back messages to the calling function.
std::shared_ptr< GenericMatrix< double > > DMatrixPtr
GenericMatrix & makeVector()
const char DEFAULT_COL_SEPARATOR[2]
iterative scaling algorithm to equilibrate rows and column norms in matrices
GenericMatrix(const Eigen::ReturnByValue< OtherDerived > &other)
Block< Derived > block(Index startRow, Index startCol, Index blockRows, Index blockCols)
GenericMatrix< T > getAbsolute() const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
void setAll(const T &_value)
GenericMatrix(unsigned _nRows, unsigned _nCols, const T *const _values)
GenericMatrix(unsigned _nRows, unsigned _nCols)
EIGEN_STRONG_INLINE const CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > cwiseAbs() const
GenericMatrix< T > eye(unsigned _dim)
GenericMatrix & appendRows(const GenericMatrix &_arg)
GenericMatrix(unsigned _nRows, unsigned _nCols, std::vector< T > &_values)
std::ostream & operator<<(std::ostream &_stream, const GenericMatrix< T > &_arg)
#define CLOSE_NAMESPACE_ACADO
const char DEFAULT_START_STRING[3]
GenericMatrix< double > DMatrix
EIGEN_STRONG_INLINE Index rows() const
GenericMatrix getCols(unsigned _start, unsigned _end) const
static DMatrix emptyMatrix
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
bool isApprox(const Scalar &x, const Scalar &y, typename NumTraits< Scalar >::Real precision=NumTraits< Scalar >::dummy_precision())
T getConditionNumber() const
GenericMatrix & setRow(unsigned _idx, const GenericVector< T > &_values)
GenericMatrix positive() const
bool isPositiveDefinite() const
std::istream & operator>>(std::istream &_stream, GenericMatrix< T > &_arg)
GenericMatrix< T > ones(unsigned _nRows, unsigned _nCols=1)
Derived & setZero(Index size)
Derived & setConstant(Index size, const Scalar &value)
GenericMatrix< int > IMatrix
Derived & setOnes(Index size)
EIGEN_STRONG_INLINE const Scalar * data() const
virtual returnValue read(std::istream &_stream)
unsigned getNumRows() const
EIGEN_STRONG_INLINE Derived & _set(const DenseBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
GenericMatrix absolute() const
unsigned getNumCols() const
const double EQUALITY_EPS
GenericVector< T > sumRow() const
bool operator!=(const GenericMatrix &arg) const
const char DEFAULT_ROW_SEPARATOR[6]
#define BEGIN_NAMESPACE_ACADO
bool operator==(const GenericMatrix &arg) const
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor|Eigen::AutoAlign > Base
GenericMatrix(const Eigen::EigenBase< OtherDerived > &other)
The matrix class, also used for vectors and row-vectors.
EIGEN_STRONG_INLINE Index cols() const
GenericVector< T > getDiag() const
GenericMatrix< T > zeros(unsigned _nRows, unsigned _nCols=1)
const char DEFAULT_LABEL[1]
Base class for all dense matrices, vectors, and expressions.
GenericMatrix negative() const
GenericMatrix getRows(unsigned _start, unsigned _end) const
GenericVector< T > getRow(unsigned _idx) const
#define ACADOERRORTEXT(retval, text)