Commit 2bb701f5 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Updating documentation and adding the reparametrization

parent 91020271
...@@ -161,7 +161,18 @@ struct CompoundFunctor: Eigen::DenseFunctor<double> ...@@ -161,7 +161,18 @@ struct CompoundFunctor: Eigen::DenseFunctor<double>
vec _fy = vec::Zero(f->dimY()); vec _fy = vec::Zero(f->dimY());
for(int i=0; i<_index+1; ++i) for(int i=0; i<_index+1; ++i)
{ {
_fy += (*(*_f)[i])(_x); const nonlinear_function* f = (*_f)[i];
if(f->input_parametrization() != _d->input_parametrization())
{
vec x(f->dimX());
params::convert(&_x[0], _d->input_parametrization(), f->input_parametrization(), &x[0]);
_fy += (*f)(x);
}
else
{
_fy += (*f)(_x);
}
} }
// Should add the resulting vector completely // Should add the resulting vector completely
...@@ -202,7 +213,19 @@ struct CompoundFunctor: Eigen::DenseFunctor<double> ...@@ -202,7 +213,19 @@ struct CompoundFunctor: Eigen::DenseFunctor<double>
} }
// Get the associated jacobian // Get the associated jacobian
vec _jac = f->parametersJacobian(xi); vec _jac;
if(f->input_parametrization() != _d->input_parametrization())
{
vec x(f->dimX());
params::convert(&xi[0], _d->input_parametrization(), f->input_parametrization(), &x[0]);
_jac = f->parametersJacobian(x);
}
else
{
_jac = f->parametersJacobian(xi);
}
// Fill the columns of the matrix // Fill the columns of the matrix
for(int j=0; j<f->nbParameters(); ++j) for(int j=0; j<f->nbParameters(); ++j)
......
...@@ -14,6 +14,27 @@ ...@@ -14,6 +14,27 @@
/*! \brief A fitter for non-linear BRDF models that uses Eigen's /*! \brief A fitter for non-linear BRDF models that uses Eigen's
* Levenberg-Marquardt solver. * Levenberg-Marquardt solver.
* \ingroup plugins * \ingroup plugins
*
* You will need the Eigen unsupported library (available with mercurial)
* <ul>
* <li>Eigen latest version.</li>
* </ul>
*
* You need to provide your own eigen.prf file for qmake to generate the correct
* Makefile or Visual Studio solution. In particular this configuration file
* should provide:
*
* <pre>
* INCLUDEPATH += [path-to-eigen-include]
* </pre>
*
*
* <h3>Plugin parameters</h3>
* <ul>
* <li><b>--fit-compound</b> to control how the fitting procedure is
* done. If this flag is set, any compound function will be decomposed
* during the fit. The fitting will be done incrementally. <b>in progress</b></li>
* </ul>
*/ */
class nonlinear_fitter_eigen: public fitter class nonlinear_fitter_eigen: public fitter
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment