Factors refactor
Related to #121 (closed).
- Remove double and template pointers API:
- Remove
bool evaluate(double const* const* _parameters, double* _residuals, double** _jacobians) constif possible - Design new API for FactorAutodiff. Move from weird operator(...) to
bool residual(const std::vector<const double*>& _states_ptr, Eigen::VectorXd& _residual)but templatized to T instead of double (analogous toevaluate()without returning Jacobians).
- Remove
- New virtual method in
FactorBase::expectation(const std::vector<const double*>& _states_ptr)(its implementation is already coded within operator() / evaluate() in all factors.). In some cases, it is already implemented with a different API, move to this. - Refactor
FactorAutodiff, most probably with this API, no template specialization will be required.