Commit 4513913d authored by Laurent Belcour's avatar Laurent Belcour

Changing the min/max functions in parametrized class

parent 7aa9ac47
......@@ -155,21 +155,9 @@ class data_params : public data
return _data.size();
}
// Get min and max input space values
virtual vec min() const
{
return _min;
}
virtual vec max() const
{
return _max;
}
protected: // data
data_params::clustrering _clustering_method;
std::vector<vec> _data;
vec _min, _max;
};
......@@ -373,11 +373,11 @@ void parametrized::setMax(const vec& max)
#endif
_max = max ;
}
vec parametrized::getMin() const
vec parametrized::min() const
{
return _min ;
}
vec parametrized::getMax() const
vec parametrized::max() const
{
return _max ;
}
......@@ -360,10 +360,10 @@ class parametrized
virtual void setMax(const vec& max) ;
//! \brief Get the minimum value the input can take
virtual vec getMin() const ;
virtual vec min() const ;
//! \brief Get the maximum value the input can take
virtual vec getMax() const ;
virtual vec max() const ;
protected:
......
......@@ -328,8 +328,8 @@ rational_function_1d* rational_function::get(int i)
// Test if the input domain is not empty. If one dimension of
// the input domain is a point, I manually inflate this dimension
// to avoid numerical issues.
vec _min = getMin();
vec _max = getMax();
vec _min = min();
vec _max = max();
for(int k=0; k<dimX(); ++k)
{
if(_min[k] == _max[k])
......
......@@ -235,13 +235,3 @@ int vertical_segment::size() const
{
return _data.size() ;
}
vec vertical_segment::min() const
{
return _min ;
}
vec vertical_segment::max() const
{
return _max ;
}
......@@ -57,19 +57,10 @@ class vertical_segment : public data
// Get data size
virtual int size() const ;
// Get min and max input parameters
virtual vec min() const ;
virtual vec max() const ;
private: // data
// Store for each point of data, the upper
// and lower value
std::vector<vec> _data ;
// Store the min and max value on the input
// domain
vec _min, _max ;
} ;
......@@ -26,8 +26,8 @@ void data_interpolant::load(const std::string& filename)
// Copy the informations
setDimX(_data->dimX());
setDimY(_data->dimY());
setMin(_data->getMin());
setMax(_data->getMax());
setMin(_data->min());
setMax(_data->max());
// Update the KDtreee by inserting all points
for(int i=0; i<_data->size(); ++i)
......
......@@ -176,8 +176,8 @@ bool nonlinear_fitter_ceres::fit_data(const data* d, function* fit, const argume
// to the dimension of my fitting problem
fit->setDimX(d->dimX()) ;
fit->setDimY(d->dimY()) ;
fit->setMin(d->getMin()) ;
fit->setMax(d->getMax()) ;
fit->setMin(d->min()) ;
fit->setMax(d->max()) ;
// Convert the function and bootstrap it with the data
if(dynamic_cast<nonlinear_function*>(fit) == NULL)
......
......@@ -273,8 +273,8 @@ bool nonlinear_fitter_eigen::fit_data(const data* d, function* fit, const argume
// to the dimension of my fitting problem
fit->setDimX(d->dimX()) ;
fit->setDimY(d->dimY()) ;
fit->setMin(d->getMin()) ;
fit->setMax(d->getMax()) ;
fit->setMin(d->min()) ;
fit->setMax(d->max()) ;
// Convert the function and bootstrap it with the data
if(dynamic_cast<nonlinear_function*>(fit) == NULL)
......
......@@ -218,8 +218,8 @@ bool nonlinear_fitter_ipopt::fit_data(const data* d, function* fit, const argume
// to the dimension of my fitting problem
fit->setDimX(d->dimX()) ;
fit->setDimY(d->dimY()) ;
fit->setMin(d->getMin()) ;
fit->setMax(d->getMax()) ;
fit->setMin(d->min()) ;
fit->setMax(d->max()) ;
// Convert the function and bootstrap it with the data
if(dynamic_cast<nonlinear_function*>(fit) == NULL)
......
......@@ -122,8 +122,8 @@ bool nonlinear_fitter_nlopt::fit_data(const data* d, function* fit, const argume
// to the dimension of my fitting problem
fit->setDimX(d->dimX()) ;
fit->setDimY(d->dimY()) ;
fit->setMin(d->getMin()) ;
fit->setMax(d->getMax()) ;
fit->setMin(d->min()) ;
fit->setMax(d->max()) ;
// Convert the function and bootstrap it with the data
if(dynamic_cast<nonlinear_function*>(fit) == NULL)
......
......@@ -99,8 +99,8 @@ rational_function_1d* rational_function_chebychev::get(int i)
// Test if the input domain is not empty. If one dimension of
// the input domain is a point, I manually inflate this dimension
// to avoid numerical issues.
vec _min = getMin();
vec _max = getMax();
vec _min = min();
vec _max = max();
for(int k=0; k<dimX(); ++k)
{
if(_min[k] == _max[k])
......
......@@ -54,8 +54,8 @@ class rational_function_legendre : public rational_function
// Test if the input domain is not empty. If one dimension of
// the input domain is a point, I manually inflate this dimension
// to avoid numerical issues.
vec _min = getMin();
vec _max = getMax();
vec _min = min();
vec _max = max();
for(int k=0; k<dimX(); ++k)
{
if(_min[k] == _max[k])
......
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