gtsam 4.1.1
gtsam
gtsam::ParameterMatrix< M > Class Template Reference

Detailed Description

template<int M>
class gtsam::ParameterMatrix< M >

A matrix abstraction of MxN values at the Basis points.

This class serves as a wrapper over an Eigen matrix.

Template Parameters
MThe dimension of the type you wish to evaluate.
Parameters
Nthe number of Basis points (e.g. Chebyshev points of the second kind).

Vector Space requirements, following LieMatrix

void print (const std::string &s="") const
 Print the ParameterMatrix. More...
 
bool equals (const ParameterMatrix< M > &other, double tol=1e-8) const
 Check for equality up to absolute tolerance. More...
 
size_t dim () const
 Returns dimensionality of the tangent space.
 
Vector vector () const
 Convert to vector form, is done row-wise.
 
static ParameterMatrix identity ()
 Identity function to satisfy VectorSpace traits. More...
 

Public Member Functions

 ParameterMatrix (const size_t N)
 Create ParameterMatrix using the number of basis points. More...
 
 ParameterMatrix (const MatrixType &matrix)
 Create ParameterMatrix from an MxN Eigen Matrix. More...
 
size_t rows () const
 Get the number of rows.
 
size_t cols () const
 Get the number of columns.
 
MatrixType matrix () const
 Get the underlying matrix.
 
Eigen::Matrix< double, -1, M > transpose () const
 Return the tranpose of the underlying matrix.
 
Eigen::Matrix< double, 1, -1 > row (size_t index) const
 Get the matrix row specified by index. More...
 
auto row (size_t index) -> Eigen::Block< MatrixType, 1, -1, false >
 Set the matrix row specified by index. More...
 
Eigen::Matrix< double, M, 1 > col (size_t index) const
 Get the matrix column specified by index. More...
 
auto col (size_t index) -> Eigen::Block< MatrixType, M, 1, true >
 Set the matrix column specified by index. More...
 
void setZero ()
 Set all matrix coefficients to zero.
 
ParameterMatrix< M > operator+ (const ParameterMatrix< M > &other) const
 Add a ParameterMatrix to another. More...
 
ParameterMatrix< M > operator+ (const Eigen::Matrix< double, -1, 1 > &other) const
 Add a MxN-sized vector to the ParameterMatrix. More...
 
ParameterMatrix< M > operator- (const ParameterMatrix< M > &other) const
 Subtract a ParameterMatrix from another. More...
 
ParameterMatrix< M > operator- (const Eigen::Matrix< double, -1, 1 > &other) const
 Subtract a MxN-sized vector from the ParameterMatrix. More...
 
MatrixType operator* (const Eigen::Matrix< double, -1, -1 > &other) const
 Multiply ParameterMatrix with an Eigen matrix. More...
 

Public Types

enum  { dimension = Eigen::Dynamic }
 

Constructor & Destructor Documentation

◆ ParameterMatrix() [1/2]

template<int M>
gtsam::ParameterMatrix< M >::ParameterMatrix ( const size_t  N)
inline

Create ParameterMatrix using the number of basis points.

Parameters
NThe number of basis points (the columns).

◆ ParameterMatrix() [2/2]

template<int M>
gtsam::ParameterMatrix< M >::ParameterMatrix ( const MatrixType &  matrix)
inline

Create ParameterMatrix from an MxN Eigen Matrix.

Parameters
matrixAn Eigen matrix used to initialze the ParameterMatrix.

Member Function Documentation

◆ col() [1/2]

template<int M>
auto gtsam::ParameterMatrix< M >::col ( size_t  index) -> Eigen::Block<MatrixType, M, 1, true>
inline

Set the matrix column specified by index.

Parameters
indexThe column index to set.

◆ col() [2/2]

template<int M>
Eigen::Matrix< double, M, 1 > gtsam::ParameterMatrix< M >::col ( size_t  index) const
inline

Get the matrix column specified by index.

Parameters
indexThe column index to retrieve.

◆ equals()

template<int M>
bool gtsam::ParameterMatrix< M >::equals ( const ParameterMatrix< M > &  other,
double  tol = 1e-8 
) const
inline

Check for equality up to absolute tolerance.

Parameters
otherThe ParameterMatrix to check equality with.
tolThe absolute tolerance threshold.

◆ identity()

template<int M>
static ParameterMatrix gtsam::ParameterMatrix< M >::identity ( )
inlinestatic

Identity function to satisfy VectorSpace traits.

NOTE: The size at compile time is unknown so this identity is zero length and thus not valid.

◆ operator*()

template<int M>
MatrixType gtsam::ParameterMatrix< M >::operator* ( const Eigen::Matrix< double, -1, -1 > &  other) const
inline

Multiply ParameterMatrix with an Eigen matrix.

Parameters
otherEigen matrix which should be multiplication compatible with the ParameterMatrix.

◆ operator+() [1/2]

template<int M>
ParameterMatrix< M > gtsam::ParameterMatrix< M >::operator+ ( const Eigen::Matrix< double, -1, 1 > &  other) const
inline

Add a MxN-sized vector to the ParameterMatrix.

Parameters
otherVector which is reshaped and added.

◆ operator+() [2/2]

template<int M>
ParameterMatrix< M > gtsam::ParameterMatrix< M >::operator+ ( const ParameterMatrix< M > &  other) const
inline

Add a ParameterMatrix to another.

Parameters
otherParameterMatrix to add.

◆ operator-() [1/2]

template<int M>
ParameterMatrix< M > gtsam::ParameterMatrix< M >::operator- ( const Eigen::Matrix< double, -1, 1 > &  other) const
inline

Subtract a MxN-sized vector from the ParameterMatrix.

Parameters
otherVector which is reshaped and subracted.

◆ operator-() [2/2]

template<int M>
ParameterMatrix< M > gtsam::ParameterMatrix< M >::operator- ( const ParameterMatrix< M > &  other) const
inline

Subtract a ParameterMatrix from another.

Parameters
otherParameterMatrix to subtract.

◆ print()

template<int M>
void gtsam::ParameterMatrix< M >::print ( const std::string &  s = "") const
inline

Print the ParameterMatrix.

Parameters
sThe prepend string to add more contextual info.

◆ row() [1/2]

template<int M>
auto gtsam::ParameterMatrix< M >::row ( size_t  index) -> Eigen::Block<MatrixType, 1, -1, false>
inline

Set the matrix row specified by index.

Parameters
indexThe row index to set.

◆ row() [2/2]

template<int M>
Eigen::Matrix< double, 1, -1 > gtsam::ParameterMatrix< M >::row ( size_t  index) const
inline

Get the matrix row specified by index.

Parameters
indexThe row index to retrieve.

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