3

I am started using the Alglib library specifically "spline1dbuildlinear' function.

When using a small dataset (for X & Y) for example the code script bellow, it's working fine:

vector<double> X(5), Y(5);
X[0]=0.1;
X[1]=0.4;
X[2]=1.2;
X[3]=1.8;
X[4]=2.0;
Y[0]=0.1;
Y[1]=0.7;
Y[2]=0.6;
Y[3]=1.1;
Y[4]=0.9;
AX.setcontent(X.size(), &(X[0]));
AY.setcontent(Y.size(), &(Y[0]));
alglib::spline1dinterpolant spline;
alglib::spline1dbuildlinear(AX, AY, X.size(), spline);

But when Using X & Y vector contains double elements those are of "1995" size its throwing an exception in the block catch(alglib_impl::ae_error_type).

After trying to find any solution over internet I find I might need to use:

alglib_impl::ae_state *_state;

the state initialization function, but couldn't figure out the proper way to debug. Any suggestions will be much appreciated.

Neel
  • 31
  • 2
  • If you can use C++11 initializer lists, you won't have to do all the `X[a] = b;`.Also, please tag as `C++` and either `C++98` or `C++11`. – o11c Jun 10 '15 at 00:02
  • Hi thanks for your response. It was just a test script where I Have Used X[a] = b for initialize the small test data; my question is mainly how to setup the alglib_impl::ae_state *_state; to avoid the exception in the block catch(alglib_impl::ae_error_type). – Neel Jun 10 '15 at 17:38

0 Answers0