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