template<unsigned int nRows, unsigned int nCols>
iDynTree::MatrixFixSize class

Class providing a simple form of matrix with dynamic size.

Derived classes

class SpatialForceWrtMotionDerivative
Class representing the derivative of a spatial force vector with respect to a spatial motion vector.
class SpatialMotionWrtMotionDerivative
Class representing the derivative of a spatial motion vector with respect to another spatial motion vector.

Constructors, destructors, conversion operators

MatrixFixSize()
Default constructor.
MatrixFixSize(const double* in_data, const std::size_t in_rows, const std::size_t in_cols)
Constructor from a C-style matrix (row major).
MatrixFixSize(iDynTree::MatrixView<const double> other)
Constructor from a MatrixView.

Public functions

auto operator=(iDynTree::MatrixView<const double> mat) -> MatrixFixSize&
auto data() const -> const double*
Raw data accessor.
auto data() -> double*
Raw data accessor.
void zero()
Assign all element of the matrix to 0.
void fillRowMajorBuffer(double* rowMajorBuf) const
Assume that rowMajorBuf is pointing to a buffer of rows()*cols() doubles, and fill it with the content of this matrix, using row major order.
void fillColMajorBuffer(double* colMajorBuf) const
Assume that colMajorBuf is pointing to a buffer of rows()*cols() doubles, and fill it with the content of this matrix, using column major order.

Protected variables

double m_data
Storage for the MatrixDynSize.

Matrix interface methods.

Methods exposing a matrix-like interface to MatrixFixSize.

auto operator()(const std::size_t row, const std::size_t col) const -> double
auto operator()(const std::size_t row, const std::size_t col) -> double&
auto getVal(const std::size_t row, const std::size_t col) const -> double
auto setVal(const std::size_t row, const std::size_t col, const double new_el) -> bool
auto rows() const -> std::size_t
auto cols() const -> std::size_t

Output helpers.

Output helpers.

auto toString() const -> std::string
auto reservedToString() const -> std::string

Function documentation

template<unsigned int nRows, unsigned int nCols>
iDynTree::MatrixFixSize<nRows, nCols>::MatrixFixSize()

Default constructor.

The data is not reset to 0 for perfomance reason. Please initialize the data in the vector before any use.

template<unsigned int nRows, unsigned int nCols>
iDynTree::MatrixFixSize<nRows, nCols>::MatrixFixSize(const double* in_data, const std::size_t in_rows, const std::size_t in_cols)

Constructor from a C-style matrix (row major).

template<unsigned int nRows, unsigned int nCols>
iDynTree::MatrixFixSize<nRows, nCols>::MatrixFixSize(iDynTree::MatrixView<const double> other)

Constructor from a MatrixView.

template<unsigned int nRows, unsigned int nCols>
const double* iDynTree::MatrixFixSize<nRows, nCols>::data() const

Raw data accessor.

Returns a const pointer to a vector of rows()*cols() doubles

template<unsigned int nRows, unsigned int nCols>
double* iDynTree::MatrixFixSize<nRows, nCols>::data()

Raw data accessor.

Returns a pointer to a vector of rows()*cols() doubles

template<unsigned int nRows, unsigned int nCols>
void iDynTree::MatrixFixSize<nRows, nCols>::fillRowMajorBuffer(double* rowMajorBuf) const

Assume that rowMajorBuf is pointing to a buffer of rows()*cols() doubles, and fill it with the content of this matrix, using row major order.

Parameters
rowMajorBuf pointer to the buffer to fill

template<unsigned int nRows, unsigned int nCols>
void iDynTree::MatrixFixSize<nRows, nCols>::fillColMajorBuffer(double* colMajorBuf) const

Assume that colMajorBuf is pointing to a buffer of rows()*cols() doubles, and fill it with the content of this matrix, using column major order.

Parameters
colMajorBuf pointer to the buffer to fill

Variable documentation

template<unsigned int nRows, unsigned int nCols>
double iDynTree::MatrixFixSize<nRows, nCols>::m_data protected

Storage for the MatrixDynSize.

Pointer to an area of size() doubles, managed by this class.