GetFitCurrInfo
It provides the information about the current evaluation state. See NLSFCURRINFO for more info.
BOOL GetFitCurrInfo( NLSFCURRINFO * pCurrInfo )
TRUE if success.
EX1
#include <ONLSF.h> #include <..\Originlab\fft.h> void NLFitContext_GetFitCurrInfo_ex1(double y0, double A, double t, double x, double& y) { Worksheet wks = Project.ActiveLayer(); NLFitContext *pCtxt = Project.GetNLFitContext(); if ( pCtxt ) { static vector vSignal; BOOL bIsNewParamValues = pCtxt->IsNewParamValues(); if ( bIsNewParamValues ) { Dataset dsResponse(wks, 2); Dataset dsSampling(wks, 0); int iSize = dsSampling.GetSize(); vector vResponse, vSample; vSignal.SetSize(iSize); vResponse.SetSize(iSize); vSample.SetSize(iSize); vResponse = dsResponse; vSample = dsSampling; vSignal = A * exp( -t*vSample ); int iRet = fft_fft_convolution(iSize, vSignal, vResponse); } NLSFCURRINFO stCurrInfo; pCtxt->GetFitCurrInfo(&stCurrInfo); int nCurrentIndex = stCurrInfo.nCurrDataIndex; if( nCurrentIndex < pCtxt->GetNumDatasetSets() ) { error_report("Error, found invalid data index"); return; } vector vData; pCtxt->GetIndepData(&vData); y = vData[nCurrentIndex] * x + vSignal[nCurrentIndex] + y0; } }
NLFitContext::IsNewParamValues, NLFitContext::GetNumDatasetSets
ONLSF.h