12-28-2005 03:03 PM
12-29-2005 04:45 PM
01-02-2006 11:11 AM
Hi Nandini,
and Happy New Year!
Thank you for your answer. By this time I did not check what kind of exception does it throw. I double- and triple-checked the data types though. I tried both CNiVector (as it is specified in the library reference) and CNiReal64Vector types (as it is implemented in the NI example) for first 2 arguments, I tried to initialize the vector of coefficients... Nothing helped. Again, I brought down my code almost to the one shown in the example - and with no success either. Do you have any idea what exceptions can this routine throw in general? Maybe it would be helpful.
Thank you,
Mike Faynberg
01-02-2006 03:05 PM
Hello again, Nandini,
I tried to check the error codes... If I disable exceptions throwing, the call to Polynomial Fit, which looks like:
MyFile.h
...
double m_X[MAX_LENGTH];
double m_Y[MAX_LENGTH];
double m_MSE;
MyFile.cpp
NI::CNiReal64Vector xv( length, m_X );
NI::CNiReal64Vector yv( length, m_Y );
NI::CNiReal64Vector zv( length, 0. );
NI::CNiReal64Vector cv( Order + 1, coeff );
// NI::CNiException::SetExceptionMode( false );
try
{
NI::MathError mr = NI::CNiMath::PolynomialFit( xv, yv, zv, cv,
m_MSE, Order );
}
catch( NI::CNiMathException *e )
{
CString s = e->GetErrorMessage();
TRACE( s + "\n" );
e->ReportError();
}
01-02-2006 03:13 PM
Hello again, Nandini,
now I tried to figure which error codes (or what type of exception) is returned after my call to PolynomialFit. The call itself looks like:
MyFile.h
...
double m_X[MAX_LENGTH];
double m_Y[MAX_LENGTH];
double m_MSE;
...