optional jacobian fix

release/4.3a0
kartik arcot 2023-01-08 19:00:42 -08:00
parent 43b5ed78de
commit 2dc0dd5979
1 changed files with 4 additions and 2 deletions

View File

@ -94,9 +94,11 @@ public:
/// Constructor that will resize a dynamic matrix (unless already correct) /// Constructor that will resize a dynamic matrix (unless already correct)
OptionalJacobian(Eigen::MatrixXd* dynamic) : OptionalJacobian(Eigen::MatrixXd* dynamic) :
map_(nullptr) { map_(nullptr) {
if (dynamic) {
dynamic->resize(Rows, Cols); // no malloc if correct size dynamic->resize(Rows, Cols); // no malloc if correct size
usurp(dynamic->data()); usurp(dynamic->data());
} }
}
/** /**
* @brief Constructor from an Eigen::Ref *value*. Will not usurp if dimension is wrong * @brief Constructor from an Eigen::Ref *value*. Will not usurp if dimension is wrong