Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit f1cd2122 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Refactoring the fitting function to pass a parameter list.

parent ee79dbf4
......@@ -15,19 +15,19 @@ class fitter
{
public:
// Static function to fit a data set d with the
// underling function class. Return the best
// fit (along with fitting information ?)
//
virtual bool fit_data(const data* d, function* f) = 0 ;
//! \brief static function to fit a data set d with the underling
//! function class. Return the best fit (along with fitting
//! information ?)
virtual bool fit_data(const data* d, function* f, const arguments& args) = 0 ;
virtual void set_parameters(const arguments& args) = 0 ;
/*
// Provide a function class and a data class
//
virtual data* provide_data() const = 0 ;
virtual function* provide_function() const = 0 ;
*/
} ;
Q_DECLARE_INTERFACE(fitter, "Fitter.Fitter")
......@@ -59,7 +59,7 @@ nonlinear_fitter_eigen::~nonlinear_fitter_eigen()
{
}
bool nonlinear_fitter_eigen::fit_data(const data* d, function* fit)
bool nonlinear_fitter_eigen::fit_data(const 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
......
......@@ -28,7 +28,7 @@ class nonlinear_fitter_eigen: public QObject, public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit) ;
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -38,7 +38,7 @@ rational_fitter_cgal::~rational_fitter_cgal()
{
}
bool rational_fitter_cgal::fit_data(const data* dat, function* fit)
bool rational_fitter_cgal::fit_data(const data* dat, function* fit, const arguments &args)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
......
......@@ -26,7 +26,7 @@ class rational_fitter_cgal : public QObject, public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit) ;
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -31,7 +31,7 @@ rational_fitter_dca::~rational_fitter_dca()
{
}
bool rational_fitter_dca::fit_data(const data* dat, function* fit)
bool rational_fitter_dca::fit_data(const data* dat, function* fit, const arguments &args)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
......
......@@ -26,7 +26,7 @@ class rational_fitter_dca : public QObject, public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit) ;
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -29,7 +29,7 @@ rational_fitter_eigen::~rational_fitter_eigen()
{
}
bool rational_fitter_eigen::fit_data(const data* dat, function* fit)
bool rational_fitter_eigen::fit_data(const data* dat, function* fit, const arguments &args)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
......
......@@ -25,7 +25,7 @@ class rational_fitter_eigen : public QObject, public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit) ;
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -29,7 +29,7 @@ rational_fitter_leastsquare::~rational_fitter_leastsquare()
{
}
bool rational_fitter_leastsquare::fit_data(const data* dat, function* fit)
bool rational_fitter_leastsquare::fit_data(const data* dat, function* fit, const arguments &args)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
......
......@@ -25,7 +25,7 @@ class rational_fitter_leastsquare : public QObject, public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit) ;
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -31,7 +31,7 @@ rational_fitter_matlab::~rational_fitter_matlab()
{
}
bool rational_fitter_matlab::fit_data(const data* dat, function* fit)
bool rational_fitter_matlab::fit_data(const data* dat, function* fit, const arguments &args)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
......
......@@ -26,7 +26,7 @@ class rational_fitter_matlab : public QObject, public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit) ;
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -35,7 +35,7 @@ rational_fitter_parallel::~rational_fitter_parallel()
{
}
bool rational_fitter_parallel::fit_data(const data* dat, function* fit)
bool rational_fitter_parallel::fit_data(const data* dat, function* fit, const arguments &args)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
......
......@@ -32,7 +32,7 @@ class rational_fitter_parallel : public QObject, public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit) ;
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
// Provide user parameters to the fitter
//
......
......@@ -30,7 +30,7 @@ rational_fitter_quadprog::~rational_fitter_quadprog()
{
}
bool rational_fitter_quadprog::fit_data(const data* dat, function* fit)
bool rational_fitter_quadprog::fit_data(const data* dat, function* fit, const arguments &args)
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
......
......@@ -28,7 +28,7 @@ class rational_fitter_quadprog : public QObject, public fitter
// Fitting a data object
//
virtual bool fit_data(const data* d, function* fit) ;
virtual bool fit_data(const data* d, function* fit, const arguments& args) ;
// Provide user parameters to the 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