#include <vector.hpp>
Public Types | |
typedef Eigen::Matrix< T, Eigen::Dynamic, 1 > | Base |
Public Member Functions | |
GenericVector & | append (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) |
GenericVector & | setUnitVector (unsigned _idx) |
virtual | ~GenericVector () |
Constructors. | |
GenericVector () | |
GenericVector (unsigned _dim) | |
GenericVector (unsigned _dim, const T *const _values) | |
GenericVector (std::vector< T > _values) |
A generic vector class based on Eigen's matrix class.
Definition at line 53 of file vector.hpp.
typedef Eigen::Matrix<T, Eigen::Dynamic, 1> GenericVector< T >::Base |
Handy typedef for the base vector class.
Reimplemented from Eigen::Matrix< T, Eigen::Dynamic, 1 >.
Definition at line 63 of file vector.hpp.
GenericVector< T >::GenericVector | ( | const Eigen::MatrixBase< OtherDerived > & | other | ) | [inline] |
Constructor from any other Eigen::MatrixBase derived class.
Definition at line 67 of file vector.hpp.
GenericVector< T >::GenericVector | ( | const Eigen::ReturnByValue< OtherDerived > & | other | ) | [inline] |
Constructor from any other Eigen::ReturnByValue derived class.
Definition at line 71 of file vector.hpp.
GenericVector< T >::GenericVector | ( | const Eigen::EigenBase< OtherDerived > & | other | ) | [inline] |
Constructor from any other Eigen::EigenBase derived class.
Definition at line 75 of file vector.hpp.
GenericVector< T >::GenericVector | ( | ) | [inline] |
Default ctor
Definition at line 85 of file vector.hpp.
GenericVector< T >::GenericVector | ( | unsigned | _dim | ) | [inline] |
Ctor which accepts size of the vector.
Definition at line 88 of file vector.hpp.
GenericVector< T >::GenericVector | ( | unsigned | _dim, |
const T *const | _values | ||
) | [inline] |
Ctor with an initializing C-like array.
Definition at line 91 of file vector.hpp.
GenericVector< T >::GenericVector | ( | std::vector< T > | _values | ) | [inline] |
Ctor with an STL vector.
Definition at line 98 of file vector.hpp.
virtual GenericVector< T >::~GenericVector | ( | ) | [inline, virtual] |
Destructor.
Definition at line 106 of file vector.hpp.
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.
GenericVector GenericVector< T >::getAbsolute | ( | ) | const [inline] |
Return a new vector with absolute elements.
Definition at line 191 of file vector.hpp.
unsigned GenericVector< T >::getDim | ( | ) | const [inline] |
Returns dimension of vector space.
Definition at line 171 of file vector.hpp.
T GenericVector< T >::getMax | ( | ) | const [inline] |
Returns maximum element.
Definition at line 179 of file vector.hpp.
T GenericVector< T >::getMean | ( | ) | const [inline] |
Returns mean value of all elements.
Definition at line 187 of file vector.hpp.
T GenericVector< T >::getMin | ( | ) | const [inline] |
Returns minimum element.
Definition at line 183 of file vector.hpp.
T GenericVector< T >::getNorm | ( | VectorNorm | _norm | ) | const |
Returns specified norm interpreted as a vector.
norm | the type of norm to be computed. |
Definition at line 67 of file vector.cpp.
T GenericVector< T >::getNorm | ( | VectorNorm | _norm, |
const GenericVector< T > & | _scale | ||
) | const |
Returns specified norm interpreted as a vector (with scaling).
norm | the type of norm to be computed. |
scale | the element-wise scale. |
Definition at line 75 of file vector.cpp.
void GenericVector< T >::init | ( | unsigned | _dim = 0 | ) | [inline] |
Initialization routine.
Definition at line 154 of file vector.hpp.
bool GenericVector< T >::isEmpty | ( | ) | const [inline] |
Returns whether the vector is empty.
Definition at line 175 of file vector.hpp.
bool GenericVector< T >::operator!= | ( | const GenericVector< T > & | _arg | ) | const [inline] |
Inequality operator.
Definition at line 118 of file vector.hpp.
bool GenericVector< T >::operator< | ( | const GenericVector< T > & | _arg | ) | const [inline] |
Definition at line 148 of file vector.hpp.
bool GenericVector< T >::operator<= | ( | const GenericVector< T > & | _arg | ) | const [inline] |
Definition at line 123 of file vector.hpp.
bool GenericVector< T >::operator== | ( | const GenericVector< T > & | _arg | ) | const [inline] |
Equality operator.
Definition at line 110 of file vector.hpp.
bool GenericVector< T >::operator> | ( | const GenericVector< T > & | _arg | ) | const [inline] |
Definition at line 143 of file vector.hpp.
bool GenericVector< T >::operator>= | ( | const GenericVector< T > & | _arg | ) | const [inline] |
Definition at line 133 of file vector.hpp.
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.
[in] | stream | Output stream for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
Definition at line 97 of file vector.cpp.
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.
[in] | filename | Filename for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
Definition at line 161 of file vector.cpp.
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.
[in] | stream | Output stream for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
Definition at line 185 of file vector.cpp.
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.
[in] | filename | Filename for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
Definition at line 232 of file vector.cpp.
returnValue GenericVector< T >::read | ( | std::istream & | stream | ) | [virtual] |
Read data from an input file.
Definition at line 251 of file vector.cpp.
returnValue GenericVector< T >::read | ( | const std::string & | filename | ) | [virtual] |
Read data from an input file.
Definition at line 262 of file vector.cpp.
void GenericVector< T >::setAll | ( | const T & | _value | ) | [inline] |
Set all elements constant.
Definition at line 159 of file vector.hpp.
GenericVector< T > & GenericVector< T >::setUnitVector | ( | unsigned | _idx | ) |
Sets vector to the _idx-th unit vector.
Definition at line 55 of file vector.cpp.