Commit 2c63cea8 authored by Laurent Belcour's avatar Laurent Belcour

Correction of matlab export

parent 8a5f12df
......@@ -400,7 +400,7 @@ void rational_function::save_matlab(const std::string& filename, const arguments
for(unsigned int k=0; k<degree.size(); ++k)
{
file << ".*legendrepoly(" << degree[k] << ", 2.0*((x(" << k+1 << ",:)"
<< "-c(" << k+1 << "))/s(" << k+1 << ") - 0.5))" ;
<< "-c(" << k+1 << "))*s(" << k+1 << ") - 0.5))" ;
}
}
file << ";" << std::endl;
......@@ -420,7 +420,7 @@ void rational_function::save_matlab(const std::string& filename, const arguments
for(unsigned int k=0; k<degree.size(); ++k)
{
file << ".*legendrepoly(" << degree[k] << ", 2.0*((x(" << k+1 << ",:)"
<< "-c(" << k+1 << "))/s(" << k+1 << ") - 0.5))" ;
<< "-c(" << k+1 << "))*s(" << k+1 << ") - 0.5))" ;
}
}
file << ";" << std::endl;
......
......@@ -173,11 +173,12 @@ bool rational_fitter_leastsquare::fit_data(const vertical_segment* d, int np, in
}
VectorXd res = ((D.leftCols(np) * pq.head(np)).array() / (D.rightCols(nq) * pq.tail(nq)).array() - Y.array());
std::cout << "Real LS norm (1): "
<< res.norm() / Y.norm()
<< " ; inf " << res.lpNorm<Infinity>() / Y.lpNorm<Infinity>()
<< " ; L1 " << res.lpNorm<1>() / Y.lpNorm<1>() << std::endl;
/*
std::cout << "<<INFO>> Real LS norm (1): "
<< res.norm() / Y.norm()
<< " ; inf " << res.lpNorm<Infinity>() / Y.lpNorm<Infinity>()
<< " ; L1 " << res.lpNorm<1>() / Y.lpNorm<1>() << std::endl;
*/
// Step 2 fit f_i using p/q with q fix
{
// This scheme gives more weights to small values: (not good)
......
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