21 #include <gtsam/config.h> 22 #include <Eigen/Dense> 24 #ifndef OPTIONALJACOBIAN_NOBOOST 25 #include <boost/optional.hpp> 38 template<
int Rows,
int Cols>
45 typedef Eigen::Matrix<double, Rows, Cols>
Jacobian;
49 Eigen::Map<Jacobian> map_;
53 void usurp(
double* data) {
54 new (&map_) Eigen::Map<Jacobian>(data);
59 if (data) usurp(data);
62 template<
int M,
int N>
82 usurp(fixedPtr->data());
88 dynamic.resize(Rows, Cols);
89 usurp(dynamic.data());
92 #ifndef OPTIONALJACOBIAN_NOBOOST 103 optional->resize(Rows, Cols);
104 usurp(optional->data());
116 operator bool()
const {
117 return map_.data() != NULL;
184 #ifndef OPTIONALJACOBIAN_NOBOOST 194 if (optional) pointer_ = &(*optional);
200 operator bool()
const {
201 return pointer_!=NULL;
214 template <
typename T>
struct traits;
221 template <
class T,
class A>
232 template<
class T,
class A>
OptionalJacobian(boost::none_t)
Constructor with boost::none just makes empty.
Definition: OptionalJacobian.h:95
Eigen::Map< Jacobian > & operator *()
De-reference, like boost optional.
Definition: OptionalJacobian.h:121
: meta-function to generate JacobianTA optional reference Used mainly by Expressions
Definition: OptionalJacobian.h:233
Eigen::Map< Jacobian > * operator->()
operator->()
Definition: OptionalJacobian.h:126
OptionalJacobian()
View on constructor argument, if given.
Definition: OptionalJacobian.h:175
OptionalJacobian()
Default constructor acts like boost::none.
Definition: OptionalJacobian.h:68
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 ...
Definition: OptionalJacobian.h:144
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
OptionalJacobian(boost::none_t)
Constructor with boost::none just makes empty.
Definition: OptionalJacobian.h:187
: meta-function to generate Jacobian
Definition: OptionalJacobian.h:222
OptionalJacobian(Jacobian &fixed)
Constructor that will usurp data of a fixed-size matrix.
Definition: OptionalJacobian.h:73
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
OptionalJacobian(const boost::optional< Eigen::MatrixXd & > optional)
Constructor compatible with old-style derivatives.
Definition: OptionalJacobian.h:192
OptionalJacobian(const boost::optional< Eigen::MatrixXd & > optional)
Constructor compatible with old-style derivatives.
Definition: OptionalJacobian.h:100
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Eigen::MatrixXd Jacobian
Jacobian size type.
Definition: OptionalJacobian.h:166
Jacobian * operator->()
TODO: operator->()
Definition: OptionalJacobian.h:210
OptionalJacobian(Eigen::MatrixXd &dynamic)
Constructor that will resize a dynamic matrix (unless already correct)
Definition: OptionalJacobian.h:86
OptionalJacobian(Jacobian *fixedPtr)
Constructor that will usurp data of a fixed-size matrix, pointer version.
Definition: OptionalJacobian.h:79
Eigen::Matrix< double, Rows, Cols > Jacobian
Jacobian size type TODO(frank): how to enforce RowMajor? Or better, make it work with any storage ord...
Definition: OptionalJacobian.h:45
OptionalJacobian(Eigen::MatrixXd &dynamic)
Constructor that will resize a dynamic matrix (unless already correct)
Definition: OptionalJacobian.h:180