Loading...
Searching...
No Matches
gtsam::OptionalJacobian< Rows, Cols > Class Template Reference

## Detailed Description

template<int Rows, int Cols>
class gtsam::OptionalJacobian< Rows, Cols >

OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size or dynamic Eigen matrix.

In the latter case, the dynamic matrix will be resized. Finally, there is a constructor that takes boost::none, the default constructor acts like boost::none, and boost::optional<Eigen::MatrixXd&> is also supported for backwards compatibility. Below this class, a dynamic version is also implemented.

## Public Member Functions

| OptionalJacobian ()
| Default constructor acts like boost::none.
| OptionalJacobian (Jacobian &fixed)
| Constructor that will usurp data of a fixed-size matrix.
| OptionalJacobian (Jacobian *fixedPtr)
| Constructor that will usurp data of a fixed-size matrix, pointer version.
| OptionalJacobian (Eigen::MatrixXd &dynamic)
| Constructor that will resize a dynamic matrix (unless already correct).
| OptionalJacobian (Eigen::MatrixXd *dynamic)
| Constructor that will resize a dynamic matrix (unless already correct).
template<class MATRIX>
| OptionalJacobian (Eigen::Ref< MATRIX > dynamic_ref)
| Constructor from an Eigen::Ref value.
| OptionalJacobian (boost::none_t)
| Constructor with boost::none just makes empty.
| OptionalJacobian (const boost::optional< Eigen::MatrixXd & > optional)
| Constructor compatible with old-style derivatives.
| operator bool () const
| Constructor that will usurp data of a block expression TODO(frank): unfortunately using a Map makes usurping non-contiguous memory impossible.
Eigen::Map< Jacobian > & | operator* ()
| De-reference, like boost optional.
Eigen::Map< Jacobian > * | operator-> ()
| operator->()
template<int N>
OptionalJacobian< Rows, N > | cols (int startCol)
| Access M*N sub-block if we are allocated, otherwise none TODO(frank): this could work as is below if only constructor above worked.

## Public Types

typedef Eigen::Matrix< double, Rows, Cols > | Jacobian
| Jacobian size type TODO(frank): how to enforce RowMajor?

## Member Typedef Documentation

## Jacobian

template<int Rows, int Cols>

typedef Eigen::Matrix<double, Rows, Cols> gtsam::OptionalJacobian< Rows, Cols >::Jacobian

Jacobian size type TODO(frank): how to enforce RowMajor?

Or better, make it work with any storage order?

## Constructor & Destructor Documentation

## OptionalJacobian()

template<int Rows, int Cols>
template<class MATRIX>

gtsam::OptionalJacobian< Rows, Cols >::OptionalJacobian | ( | Eigen::Ref< MATRIX > | dynamic_ref | ) |

inline

Constructor from an Eigen::Ref value.

Will not usurp if dimension is wrong

Note
  This is important so we don't overwrite someone else's memory!

## Member Function Documentation

## cols()

template<int Rows, int Cols>
template<int N>

OptionalJacobian< Rows, N > gtsam::OptionalJacobian< Rows, Cols >::cols | ( | int | startCol | ) |

inline

Access M*N sub-block if we are allocated, otherwise none TODO(frank): this could work as is below if only constructor above worked.

Access Rows*N sub-block if we are allocated, otherwise return an empty OptionalJacobian The use case is functions with arguments that are dissected, e.g. Pose3 into Rot3, Point3 TODO(frank): ideally, we'd like full block functionality, but see note above.

## operator bool()

template<int Rows, int Cols>

gtsam::OptionalJacobian< Rows, Cols >::operator bool | ( |  | ) | const

inline

Constructor that will usurp data of a block expression TODO(frank): unfortunately using a Map makes usurping non-contiguous memory impossible.

Return true if allocated, false if default constructor was used

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

- /build/gtsam-RkN8wG/gtsam-4.2.2+dfsg/gtsam/base/OptionalJacobian.h