Commit 9c55c5a6 authored by Laurent Belcour's avatar Laurent Belcour

Small fix to get less warning during compile

parent 69a0439d
......@@ -188,14 +188,14 @@ class vec : public std::vector<double>
friend bool operator<(const vec& a, const vec& b)
{
bool lessthan = true ;
for(int i=0; i<a.size(); ++i)
for(unsigned int i=0; i<a.size(); ++i)
lessthan &= a[i] < b[i];
return lessthan;
}
friend bool operator>(const vec& a, const vec& b)
{
bool greatthan = true ;
for(int i=0; i<a.size(); ++i)
for(unsigned int i=0; i<a.size(); ++i)
greatthan &= a[i] > b[i];
return greatthan;
}
......
......@@ -512,7 +512,7 @@ void rational_function::save_cpp(const std::string& filename, const arguments& a
std::vector<int> degree = index2degree(i);
for(unsigned int k=0; k<degree.size(); ++k)
{
file << "*l(2.0*((x\[" << k << "\]-c[" << k << "])*s[" << k << "] - 0.5), " << degree[k] << ")" ;
file << "*l(2.0*((x[" << k << "]-c[" << k << "])*s[" << k << "] - 0.5), " << degree[k] << ")" ;
}
}
file << ";" << std::endl;
......@@ -531,7 +531,7 @@ void rational_function::save_cpp(const std::string& filename, const arguments& a
std::vector<int> degree = index2degree(i);
for(unsigned int k=0; k<degree.size(); ++k)
{
file << "*l(2.0*((x\[" << k << "\]-c[" << k << "])*s[" << k << "] - 0.5), " << degree[k] << ")" ;
file << "*l(2.0*((x[" << k << "]-c[" << k << "])*s[" << k << "] - 0.5), " << degree[k] << ")" ;
}
}
file << ";" << std::endl;
......
......@@ -10,7 +10,7 @@ SUBDIRS = \
rational_function_chebychev \
# rational_fitter_matlab \
# rational_fitter_dca \
# nonlinear_levenberg_eigen \
nonlinear_levenberg_eigen \
nonlinear_function_phong \
nonlinear_function_lafortune \
data_merl \
......
......@@ -82,16 +82,15 @@ bool rational_fitter_quadprog::fit_data(const data* dat, function* fit, const ar
std::cout << "<<INFO>> fit using np = " << temp_np << " & nq = " << temp_nq << " failed\r" ;
std::cout.flush() ;
if(temp_np < _max_np)
if(temp_np < _max_np)
{
++temp_np ;
}
if(temp_nq < _max_nq)
if(temp_nq < _max_nq)
{
++temp_nq ;
}
}
return false ;
}
......@@ -176,9 +175,9 @@ bool rational_fitter_quadprog::fit_data(const vertical_segment* dat, int np, int
vec xi = d->get(i) ;
bool is_boundary = false;
for(int i=0; i<d->dimX(); ++i)
for(int k=0; k<d->dimX(); ++k)
{
is_boundary = is_boundary || (xi[i] <= d->min()[i]) || (xi[i] >= d->max()[i]);
is_boundary = is_boundary || (xi[k] <= d->min()[k]) || (xi[k] >= d->max()[k]);
}
// A row of the constraint matrix has this
......
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