Skip to content

Instantly share code, notes, and snippets.

@SarvagyaVaish
Last active March 13, 2017 09:36
Show Gist options
  • Save SarvagyaVaish/588a16935fd33ffc900453b9c4fb14d8 to your computer and use it in GitHub Desktop.
Save SarvagyaVaish/588a16935fd33ffc900453b9c4fb14d8 to your computer and use it in GitHub Desktop.
struct LMFunctor
{
// Compute 'm' errors, one for each data point, for the given parameter values in 'x'
int operator()(const Eigen::VectorXf &x, Eigen::VectorXf &fvec) const
{
// TODO
}
// Compute the jacobian of the errors
int df(const Eigen::VectorXf &x, Eigen::MatrixXf &fjac) const
{
// TODO
}
// Number of data points, i.e. values.
int m;
// Returns 'm', the number of values.
int values() const { return m; }
// The number of parameters, i.e. inputs.
int n;
// Returns 'n', the number of inputs.
int inputs() const { return n; }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment