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

#include <vector.hpp>

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

Public Types

typedef Eigen::Matrix< T, Eigen::Dynamic, 1 > Base
 
- Public Types inherited from Eigen::Matrix< T, Eigen::Dynamic, 1 >
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

GenericVectorappend (const GenericVector &_arg)
 
template<typename OtherDerived >
 GenericVector (const Eigen::MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
 GenericVector (const Eigen::ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
 GenericVector (const Eigen::EigenBase< OtherDerived > &other)
 
GenericVector getAbsolute () const
 
unsigned getDim () const
 
T getMax () const
 
T getMean () const
 
T getMin () const
 
T getNorm (VectorNorm _norm) const
 
T getNorm (VectorNorm _norm, const GenericVector &_scale) const
 
void init (unsigned _dim=0)
 
bool isEmpty () const
 
bool operator!= (const GenericVector &_arg) const
 
bool operator< (const GenericVector &_arg) const
 
bool operator<= (const GenericVector &_arg) const
 
bool operator== (const GenericVector &_arg) const
 
bool operator> (const GenericVector &_arg) const
 
bool operator>= (const GenericVector &_arg) 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 (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 (std::ostream &stream, const std::string &name, PrintScheme printScheme) 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)
 
GenericVectorsetUnitVector (unsigned _idx)
 
virtual ~GenericVector ()
 
Constructors.
 GenericVector ()
 
 GenericVector (unsigned _dim)
 
 GenericVector (unsigned _dim, const T *const _values)
 
 GenericVector (std::vector< T > _values)
 
- Public Member Functions inherited from Eigen::Matrix< T, Eigen::Dynamic, 1 >
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 GenericVector< T >

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

Definition at line 54 of file vector.hpp.

Member Typedef Documentation

template<typename T>
typedef Eigen::Matrix<T, Eigen::Dynamic, 1> GenericVector< T >::Base

Handy typedef for the base vector class.

Definition at line 64 of file vector.hpp.

Constructor & Destructor Documentation

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

Constructor from any other Eigen::MatrixBase derived class.

Definition at line 68 of file vector.hpp.

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

Constructor from any other Eigen::ReturnByValue derived class.

Definition at line 72 of file vector.hpp.

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

Constructor from any other Eigen::EigenBase derived class.

Definition at line 76 of file vector.hpp.

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

Default ctor

Definition at line 86 of file vector.hpp.

template<typename T>
GenericVector< T >::GenericVector ( unsigned  _dim)
inline

Ctor which accepts size of the vector.

Definition at line 89 of file vector.hpp.

template<typename T>
GenericVector< T >::GenericVector ( unsigned  _dim,
const T *const  _values 
)
inline

Ctor with an initializing C-like array.

Definition at line 92 of file vector.hpp.

template<typename T>
GenericVector< T >::GenericVector ( std::vector< T _values)
inline

Ctor with an STL vector.

Definition at line 99 of file vector.hpp.

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

Destructor.

Definition at line 107 of file vector.hpp.

Member Function Documentation

template<typename T >
BEGIN_NAMESPACE_ACADO GenericVector< T > & GenericVector< T >::append ( const GenericVector< T > &  _arg)

Append elements to the vector.

Definition at line 42 of file vector.cpp.

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

Return a new vector with absolute elements.

Definition at line 192 of file vector.hpp.

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

Returns dimension of vector space.

Definition at line 172 of file vector.hpp.

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

Returns maximum element.

Definition at line 180 of file vector.hpp.

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

Returns mean value of all elements.

Definition at line 188 of file vector.hpp.

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

Returns minimum element.

Definition at line 184 of file vector.hpp.

template<typename T >
T GenericVector< T >::getNorm ( VectorNorm  _norm) const

Returns specified norm interpreted as a vector.

Parameters
normthe type of norm to be computed.

Definition at line 67 of file vector.cpp.

template<typename T >
T GenericVector< T >::getNorm ( VectorNorm  _norm,
const GenericVector< T > &  _scale 
) const

Returns specified norm interpreted as a vector (with scaling).

Parameters
normthe type of norm to be computed.
scalethe element-wise scale.

Definition at line 75 of file vector.cpp.

template<typename T>
void GenericVector< T >::init ( unsigned  _dim = 0)
inline

Initialization routine.

Definition at line 155 of file vector.hpp.

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

Returns whether the vector is empty.

Definition at line 176 of file vector.hpp.

template<typename T>
bool GenericVector< T >::operator!= ( const GenericVector< T > &  _arg) const
inline

Inequality operator.

Definition at line 119 of file vector.hpp.

template<typename T>
bool GenericVector< T >::operator< ( const GenericVector< T > &  _arg) const
inline

Definition at line 149 of file vector.hpp.

template<typename T>
bool GenericVector< T >::operator<= ( const GenericVector< T > &  _arg) const
inline

Definition at line 124 of file vector.hpp.

template<typename T>
bool GenericVector< T >::operator== ( const GenericVector< T > &  _arg) const
inline

Equality operator.

Definition at line 111 of file vector.hpp.

template<typename T>
bool GenericVector< T >::operator> ( const GenericVector< T > &  _arg) const
inline

Definition at line 144 of file vector.hpp.

template<typename T>
bool GenericVector< T >::operator>= ( const GenericVector< T > &  _arg) const
inline

Definition at line 134 of file vector.hpp.

template<typename T >
returnValue GenericVector< 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 97 of file vector.cpp.

template<typename T >
returnValue GenericVector< 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 161 of file vector.cpp.

template<typename T >
returnValue GenericVector< 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 185 of file vector.cpp.

template<typename T >
returnValue GenericVector< 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 232 of file vector.cpp.

template<typename T >
returnValue GenericVector< T >::read ( std::istream &  stream)
virtual

Read data from an input file.

Definition at line 251 of file vector.cpp.

template<typename T >
returnValue GenericVector< T >::read ( const std::string &  filename)
virtual

Read data from an input file.

Definition at line 262 of file vector.cpp.

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

Set all elements constant.

Definition at line 160 of file vector.hpp.

template<typename T >
GenericVector< T > & GenericVector< T >::setUnitVector ( unsigned  _idx)

Sets vector to the _idx-th unit vector.

Definition at line 55 of file vector.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