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

Fixing errors in the matlab implementation of the rational fitter

parent 827abdab
......@@ -43,6 +43,7 @@ template<typename T> T open_library(const std::string& filename, const char* fun
else
{
std::cerr << "<<ERROR>> unable to load the dynamic library file \"" << filename << "\"" << std::endl;
std::cerr << " cause: \"" << dlerror() << "\"" << std::endl;
return NULL;
}
#endif
......
......@@ -21,9 +21,15 @@ ALTA_DLL_EXPORT fitter* provide_fitter()
rational_fitter_matlab::rational_fitter_matlab()
{
// Create matlab engine
if (!(ep = engOpen("")))
{
std::cerr << "<ERROR>> can't start MATLAB engine" << std::endl ;
}
}
rational_fitter_matlab::~rational_fitter_matlab()
{
engClose(ep);
}
bool rational_fitter_matlab::fit_data(const data* dat, function* fit, const arguments &args)
......@@ -36,14 +42,6 @@ bool rational_fitter_matlab::fit_data(const data* dat, function* fit, const argu
return false ;
}
// Create matlab engine
if (!(ep = engOpen("")))
{
std::cerr << "<ERROR>> can't start MATLAB engine" << std::endl ;
return false ;
}
// I need to set the dimension of the resulting function to be equal
// to the dimension of my fitting problem
r->setDimX(d->dimX()) ;
......@@ -85,7 +83,6 @@ bool rational_fitter_matlab::fit_data(const data* dat, function* fit, const argu
}
}
engClose(ep);
return false ;
}
......
......@@ -28,11 +28,6 @@ class rational_fitter_matlab : public fitter
//
virtual void set_parameters(const arguments& args) ;
// Obtain associated data and functions
//
virtual data* provide_data() const ;
virtual function* provide_function() const ;
protected: // function
// Fitting a data object using np elements in the numerator and nq
......
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