Revisit the Evaluator interface
Closed this issue · 2 comments
furgalep commented
We can make this abstract by defining a pure virtual object (to wrap the Values
and std::vector<Matrix>
that show up in the GTSAM NonLinearFactor
.
Something like:
class EvaluatorCoefficients {
public:
// Get the coefficient associated with this key
const Coefficient& coefficient(const Key& key) const = 0;
// Set the Jacobian of this coefficient
void setJacobian( const Key& key, const Eigen::MatrixXd& Jk) = 0;
};
Then the implementation could handle everything without an extra copy.
HannesSommer commented
You mean
void setJacobian( const Key& key, Eigen::MatrixXd* Jk) = 0;
?
furgalep commented
Use BAD.