Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit 4544fba8 authored by Laurent Belcour's avatar Laurent Belcour

Updating the interface of nonlinear fitters and functions to adopt shared...

Updating the interface of nonlinear fitters and functions to adopt shared pointers for data. Note this is not a clean REV to updated to. ALTA won't comile.
parent f18263e7
......@@ -105,7 +105,7 @@ nonlinear_fitter_ceres::~nonlinear_fitter_ceres()
{
}
bool nonlinear_fitter_ceres::fit_data(const data* d, function* fit, const arguments &args)
bool nonlinear_fitter_ceres::fit_data(const ptr<data> d, function* fit, const arguments &args)
{
// I need to set the dimension of the resulting function to be equal
// to the dimension of my fitting problem
......
......@@ -61,7 +61,7 @@ class nonlinear_fitter_ceres: public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
virtual bool fit_data(const ptr<data> d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -20,7 +20,7 @@ ALTA_DLL_EXPORT fitter* provide_fitter()
struct EigenFunctor: Eigen::DenseFunctor<double>
{
EigenFunctor(nonlinear_function* f, const data* d, bool use_cosine) :
EigenFunctor(nonlinear_function* f, const ptr<data> d, bool use_cosine) :
Eigen::DenseFunctor<double>(f->nbParameters(), d->dimY()*d->size()), _f(f), _d(d), _cosine(use_cosine)
{
#ifndef DEBUG
......@@ -130,7 +130,7 @@ struct EigenFunctor: Eigen::DenseFunctor<double>
nonlinear_function* _f;
const data* _d;
const ptr<data> _d;
// Flags
bool _cosine;
......@@ -138,7 +138,7 @@ struct EigenFunctor: Eigen::DenseFunctor<double>
struct CompoundFunctor: Eigen::DenseFunctor<double>
{
CompoundFunctor(compound_function* f, int index, const data* d, bool use_cosine) :
CompoundFunctor(compound_function* f, int index, const ptr<data> d, bool use_cosine) :
Eigen::DenseFunctor<double>((*f)[index]->nbParameters(), d->dimY()*d->size()), _f(f), _index(index), _d(d), _cosine(use_cosine)
{
#ifndef DEBUG
......@@ -261,7 +261,7 @@ struct CompoundFunctor: Eigen::DenseFunctor<double>
compound_function* _f;
const data* _d;
const ptr<data> _d;
// Flags
bool _cosine;
......@@ -275,7 +275,7 @@ nonlinear_fitter_eigen::~nonlinear_fitter_eigen()
{
}
bool nonlinear_fitter_eigen::fit_data(const data* d, function* fit, const arguments &args)
bool nonlinear_fitter_eigen::fit_data(const ptr<data> d, function* fit, const arguments &args)
{
// I need to set the dimension of the resulting function to be equal
// to the dimension of my fitting problem
......
......@@ -45,7 +45,7 @@ class nonlinear_fitter_eigen: public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
virtual bool fit_data(const ptr<data> d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -23,7 +23,7 @@ ALTA_DLL_EXPORT fitter* provide_fitter()
class altaNLP : public Ipopt::TNLP
{
public:
altaNLP(nonlinear_function* f, const data* d) : TNLP(), _f(f), _d(d)
altaNLP(nonlinear_function* f, const ptr<data> d) : TNLP(), _f(f), _d(d)
{
}
......@@ -209,7 +209,7 @@ class altaNLP : public Ipopt::TNLP
protected:
const data* _d;
const ptr<data> _d;
nonlinear_function* _f;
};
......@@ -220,7 +220,7 @@ nonlinear_fitter_ipopt::~nonlinear_fitter_ipopt()
{
}
bool nonlinear_fitter_ipopt::fit_data(const data* d, function* fit, const arguments &args)
bool nonlinear_fitter_ipopt::fit_data(const ptr<data> d, function* fit, const arguments &args)
{
// I need to set the dimension of the resulting function to be equal
// to the dimension of my fitting problem
......
......@@ -54,7 +54,7 @@ class nonlinear_fitter_ipopt: public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
virtual bool fit_data(const ptr<data> d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -34,7 +34,7 @@ void print_nlopt_error(nlopt_result res, const std::string& string)
// The parameter of the function _f should be set prior to this function
// call. If not it will produce undesirable results.
void df(double* fjac, const nonlinear_function* f, const data* d)
void df(double* fjac, const nonlinear_function* f, const ptr<data> d)
{
// Clean memory
memset(fjac, 0.0, f->nbParameters()*sizeof(double));
......@@ -77,7 +77,7 @@ void df(double* fjac, const nonlinear_function* f, const data* d)
double f(unsigned n, const double* x, double* dy, void* dat)
{
nonlinear_function* _f = (nonlinear_function*)(((void**)dat)[0]);
const data* _d = (const data*)(((void**)dat)[1]);
const ptr<data> _d = *(const ptr<data>*)(((void**)dat)[1]);
// Update the parameters vector
vec _p(_f->nbParameters());
......@@ -125,7 +125,7 @@ nonlinear_fitter_nlopt::~nonlinear_fitter_nlopt()
{
}
bool nonlinear_fitter_nlopt::fit_data(const data* d, function* fit, const arguments &args)
bool nonlinear_fitter_nlopt::fit_data(const ptr<data> d, function* fit, const arguments &args)
{
// I need to set the dimension of the resulting function to be equal
// to the dimension of my fitting problem
......@@ -234,7 +234,7 @@ bool nonlinear_fitter_nlopt::fit_data(const data* d, function* fit, const argume
// Create the problem
void* dat[2];
dat[0] = (void*)nf;
dat[1] = (void*)d;
dat[1] = (void*)&d;
res = nlopt_set_min_objective(opt, f, dat);
if(res < 0)
{
......
......@@ -46,7 +46,7 @@ class nonlinear_fitter_nlopt: public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
virtual bool fit_data(const ptr<data> d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -186,7 +186,7 @@ vec schlick::parametersJacobian(const vec& x) const
}
void schlick::bootstrap(const data* d, const arguments& args)
void schlick::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i) { R[i] = 0.5; }
}
......@@ -49,7 +49,7 @@ class schlick : public nonlinear_function
virtual vec parametersJacobian(const vec& x) const ;
//! \brief Boostrap the function by defining the diffuse term
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief resize the parameter vector
virtual void setDimY(int nY)
......
......@@ -98,7 +98,7 @@ vec retro_schlick::getParametersMax() const
return M;
}
void retro_schlick::bootstrap(const data* d, const arguments& args)
void retro_schlick::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i) {R[i] = 0.5; }
}
......
......@@ -49,7 +49,7 @@ class retro_schlick : public nonlinear_function
virtual vec parametersJacobian(const vec& x) const ;
//! \brief Boostrap the function by defining the diffuse term
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief resize the parameter vector
virtual void setDimY(int nY)
......
......@@ -179,7 +179,7 @@ vec schlick_fresnel::parametersJacobian(const vec& x) const
}
void schlick_fresnel::bootstrap(const data* d, const arguments& args)
void schlick_fresnel::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i) { R[i] = 0.5; }
}
......@@ -58,7 +58,7 @@ class schlick_fresnel : public nonlinear_function
virtual vec parametersJacobian(const vec& x) const ;
//! \brief Boostrap the function by defining the diffuse term
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief resize the parameter vector
virtual void setDimY(int nY)
......
......@@ -142,7 +142,7 @@ vec abc_function::parametersJacobian(const vec& x) const
return jac;
}
void abc_function::bootstrap(const data* d, const arguments& args)
void abc_function::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i)
{
......
......@@ -45,7 +45,7 @@ class abc_function : public nonlinear_function
//! \brief Boostrap the function by defining the diffuse term
//!
//! \details
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Number of parameters to this non-linear function
virtual int nbParameters() const ;
......
......@@ -161,7 +161,7 @@ vec beckmann_function::parametersJacobian(const vec& x) const
return jac;
}
void beckmann_function::bootstrap(const data* d, const arguments& args)
void beckmann_function::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i)
{
......
......@@ -48,7 +48,7 @@ class beckmann_function : public nonlinear_function
//! \brief Boostrap the function by defining the diffuse term
//!
//! \details
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Number of parameters to this non-linear function
virtual int nbParameters() const ;
......
......@@ -154,7 +154,7 @@ vec blinn_function::parametersJacobian(const vec& x) const
}
void blinn_function::bootstrap(const data* d, const arguments& args)
void blinn_function::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i)
{
......
......@@ -31,7 +31,7 @@ class blinn_function : public nonlinear_function
//! \brief Boostrap the function by defining the diffuse term
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Load function specific files
virtual bool load(std::istream& filename) ;
......
......@@ -159,7 +159,7 @@ vec diffuse_function::parametersJacobian(const vec& x) const
}
void diffuse_function::bootstrap(const data* d, const arguments& args)
void diffuse_function::bootstrap(const ptr<data> d, const arguments& args)
{
// Set the diffuse component
if(params::is_cosine_weighted(d->output_parametrization()) || args.is_defined("cos-fit"))
......
......@@ -34,7 +34,7 @@ class diffuse_function : public nonlinear_function
//! \brief Boostrap the function by defining the diffuse term
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Load function specific files
virtual bool load(std::istream& in) ;
......
......@@ -233,7 +233,7 @@ vec isotropic_lafortune_function::parametersJacobian(const vec& x) const
return jac;
}
void isotropic_lafortune_function::bootstrap(const data* d, const arguments& args)
void isotropic_lafortune_function::bootstrap(const ptr<data> d, const arguments& args)
{
// Check the arguments for the number of lobes
this->setNbLobes(args.get_int("lobes", 1));
......
......@@ -53,7 +53,7 @@ class isotropic_lafortune_function : public nonlinear_function
//! \brief Boostrap the function by defining the diffuse term
//!
//! \details
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Number of parameters to this non-linear function
virtual int nbParameters() const ;
......
......@@ -285,7 +285,7 @@ vec lafortune_function::parametersJacobian(const vec& x) const
return jac;
}
void lafortune_function::bootstrap(const data* d, const arguments& args)
void lafortune_function::bootstrap(const ptr<data> d, const arguments& args)
{
// Check the arguments for the number of lobes
this->setNbLobes(args.get_int("lobes", 1));
......
......@@ -49,7 +49,7 @@ class lafortune_function : public nonlinear_function
void save_call(std::ostream& out, const arguments& args) const;
//! \brief Boostrap the function by defining the diffuse term
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Number of parameters to this non-linear function
virtual int nbParameters() const ;
......
......@@ -153,7 +153,7 @@ vec beckmann_function::parametersJacobian(const vec& x) const
return jac;
}
void beckmann_function::bootstrap(const data* d, const arguments& args)
void beckmann_function::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i)
{
......
......@@ -44,7 +44,7 @@ class beckmann_function : public nonlinear_function
//! \brief Boostrap the function by defining the diffuse term
//!
//! \details
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Number of parameters to this non-linear function
virtual int nbParameters() const ;
......
......@@ -141,7 +141,7 @@ vec retroblinn_function::parametersJacobian(const vec& x) const
}
void retroblinn_function::bootstrap(const data* d, const arguments& args)
void retroblinn_function::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i)
{
......
......@@ -30,7 +30,7 @@ class retroblinn_function : public nonlinear_function
//! \brief Boostrap the function. This initialize the lobe width
//! and the specular coefficient to one.
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Load function specific files
virtual bool load(std::istream& filename) ;
......
......@@ -118,7 +118,7 @@ vec yoo_function::parametersJacobian(const vec& x) const
return jac;
}
void yoo_function::bootstrap(const data*, const arguments&)
void yoo_function::bootstrap(const ptr<data>, const arguments&)
{
for(int i=0; i<dimY(); ++i)
{
......
......@@ -208,7 +208,7 @@ vec spherical_gaussian_function::parametersJacobian(const vec& x) const
return jac;
}
void spherical_gaussian_function::bootstrap(const data* d, const arguments& args)
void spherical_gaussian_function::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i)
{
......
......@@ -60,7 +60,7 @@ class spherical_gaussian_function : public nonlinear_function
//! \brief Boostrap the function by defining the diffuse term
//!
//! \details
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Number of parameters to this non-linear function
virtual int nbParameters() const ;
......
......@@ -149,7 +149,7 @@ vec ward_function::parametersJacobian(const vec& x) const
return jac;
}
void ward_function::bootstrap(const data* d, const arguments& args)
void ward_function::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i)
{
......
......@@ -53,7 +53,7 @@ class ward_function : public nonlinear_function
//! \brief Boostrap the function by defining the diffuse term
//!
//! \details
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief Number of parameters to this non-linear function
virtual int nbParameters() const ;
......
......@@ -178,7 +178,7 @@ vec schlick_masking::parametersJacobian(const vec& x) const
}
void schlick_masking::bootstrap(const data*, const arguments&)
void schlick_masking::bootstrap(const ptr<data>, const arguments&)
{
// Start with a non occluding value for k
for(int i=0; i<dimY(); ++i) { w[i] = 0.0; }
......
......@@ -55,7 +55,7 @@ class schlick_masking : public nonlinear_function
virtual vec parametersJacobian(const vec& x) const ;
//! \brief Boostrap the function by defining the diffuse term
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief resize the parameter vector
virtual void setDimY(int nY)
......
......@@ -177,7 +177,7 @@ vec smith::parametersJacobian(const vec& x) const
}
void smith::bootstrap(const data* d, const arguments& args)
void smith::bootstrap(const ptr<data> d, const arguments& args)
{
for(int i=0; i<dimY(); ++i) { w[i] = 1.0; }
}
......@@ -51,7 +51,7 @@ class smith : public nonlinear_function//fresnel
virtual vec parametersJacobian(const vec& x) const ;
//! \brief Boostrap the function by defining the diffuse term
virtual void bootstrap(const data* d, const arguments& args);
virtual void bootstrap(const ptr<data> d, const arguments& args);
//! \brief resize the parameter vector
virtual void setDimY(int nY)
......
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