Commit bf204fbf authored by Laurent Belcour's avatar Laurent Belcour

Testing normalization of rows

parent 3115307d
......@@ -132,7 +132,7 @@ double rational_function::p(const vec& x, int i) const
#ifdef POLYNOMIALS
res *= pow(x[k], deg[k]) ;
#else // LEGENDRE
res *= legendre(2.0*((x[k] - _min[k]) / _max[k] - 0.5), deg[k]);
res *= legendre(2.0*((x[k] - _min[k]) / (_max[k]-_min[k]) - 0.5), deg[k]);
#endif
}
......@@ -147,7 +147,7 @@ double rational_function::q(const vec& x, int i) const
#ifdef POLYNOMIALS
res *= pow(x[k], deg[k]) ;
#else // LEGENDRE
res *= legendre(2.0*((x[k] - _min[k]) / _max[k] - 0.5), deg[k]);
res *= legendre(2.0*((x[k] - _min[k]) / (_max[k]-_min[k]) - 0.5), deg[k]);
#endif
}
......
......@@ -214,9 +214,9 @@ bool rational_fitter_quadprog::fit_data(const vertical_segment* dat, int np, int
// Set the c vector, will later be updated using the
// delta parameter.
ci(i) = -sqrt(a0_norm) ;
ci(i+d->size()) = -sqrt(a1_norm) ;
ce(i) = 0.0 ;
ci(i) = sqrt(a0_norm) ;
ci(i+d->size()) = sqrt(a1_norm) ;
ce(i) = 0.0 ;
ce(i+d->size()) = 0.0 ;
}
#ifdef DEBUG
......@@ -267,8 +267,9 @@ bool rational_fitter_quadprog::fit_data(const vertical_segment* dat, int np, int
std::cout << "<<DEBUG>> delta factor: " << sigma_m << " / " << sigma_M << " = " << delta << std::endl ;
#endif
for(int i=0; i<2*d->size(); ++i)
{
ci(i) = ci(i) * delta ;
{
CI.row(i) /= ci(i) ;
ci(i) = -delta ;
}
// Compute the solution
......
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