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 9e94b16e authored by Laurent Belcour's avatar Laurent Belcour

Need a refactor before going into the plugin fashion

parent de6d0847
#pragma once
#include <string>
#include <pair>
#include <utility>
template<class X, class Y> class data
class data
{
public: // methods
// Load data from a file
virtual void load(const std::string& filename) = 0 ;
virtual void load(const std::string& filename, X min, X max) = 0 ;
virtual void load(const std::string& filename, double min, double max) = 0 ;
// Acces to data
virtual bool get(int i, X& x, Y& y) const = 0 ;
virtual const std::pair<X, Y>& operator[](int i) const = 0 ;
virtual bool get(int i, double& x, double& y, double& t) const = 0 ;
virtual const std::vector<double>& operator[](int i) const = 0 ;
// Get data size
virtual int size() const = 0 ;
// Get min and max input parameters
virtual X min() const = 0 ;
virtual X max() const = 0 ;
virtual double min() const = 0 ;
virtual double max() const = 0 ;
} ;
......@@ -7,7 +7,7 @@
* Fitting interface for generic fitting algorithms
*
*/
template<class X, class Y> class fitter
class fitter
{
public:
......@@ -15,6 +15,6 @@ template<class X, class Y> class fitter
// underling function class. Return the best
// fit (along with fitting information ?)
//
virtual bool fit_data(const data<X, Y>& d, function<X, Y>& f) = 0 ;
virtual bool fit_data(const data* d, function* f) = 0 ;
} ;
#pragma once
template<class X, class Y> class function : public std::function<X(Y)>
#include <functional>
#include <string>
class function : public std::function<double(double)>
{
public: // methods
// Overload the function operator
virtual Y operator()(float X) const = 0 ;
virtual double operator()(double x) const = 0 ;
// IO function to text files
virtual void load(const std::string& filename) = 0 ;
......
......@@ -6,7 +6,12 @@
#include <string>
#include <tuple>
class rational_1d : public std::function<double(double)>
// Interface
#include <core/function.h>
#include <core/data.h>
#include <core/fitter.h>
class rational_1d : public function
{
public: // methods
......@@ -36,24 +41,24 @@ class rational_1d : public std::function<double(double)>
std::vector<double> b ;
} ;
class rational_1d_data // : public fitting_data
class rational_1d_data : public data
{
public: // methods
// Load data from a file
void load(const std::string& filename) ;
void load(const std::string& filename, double min, double max) ;
virtual void load(const std::string& filename) ;
virtual void load(const std::string& filename, double min, double max) ;
// Acces to data
bool get(int i, double& x, double& yl, double& yu) const ;
const std::vector<double>& operator[](int i) const ;
virtual bool get(int i, double& x, double& yl, double& yu) const ;
virtual const std::vector<double>& operator[](int i) const ;
// Get data size
int size() const ;
virtual int size() const ;
// Get min and max input parameters
double min() const ;
double max() const ;
virtual double min() const ;
virtual double max() const ;
private: // data
......@@ -66,7 +71,7 @@ class rational_1d_data // : public fitting_data
double _min, _max ;
} ;
class rational_1d_fitter // : public fitting_algorithm
class rational_1d_fitter //: public fitter
{
public: // methods
......
......@@ -149,11 +149,7 @@ bool rational_1d_fitter_cgal::fit_data(const rational_1d_data& data, int np, int
#endif
// solve the program, using ET as the exact type
//*
Solution s = CGAL::solve_quadratic_program(qp, ET()) ;
/*/
Solution s = CGAL::solve_nonnegative_quadratic_program(qp, ET());
//*/
bool solves_qp = s.solves_quadratic_program(qp) ;
for(int i=0; i<np+nq; ++i)
......
......@@ -7,7 +7,6 @@
#include <tuple>
// Personal include
//#include <fitting_algorithm.h>
#include "rational_1d_fitter.h"
......
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