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.
We can make this abstract by defining a pure virtual object (to wrap the
Values
andstd::vector<Matrix>
that show up in the GTSAMNonLinearFactor
.Something like:
Then the implementation could handle everything without an extra copy.