Hi,
I'm working with ATS and studyiing the yieldcurve example.
According to the "ATS 1.5 – Operations Guide" manual (section 15.6.3: Creating Curve Methodology with C++ Add-In), the correct way to call ATS::RateInput functions in order to get columns is:
double* parRateList = NULL;
rateInput->getDoubleColumn(ID_PAR_RATE, parRateList);
Though, the example in Ext_yieldcurve.cpp does somthing like:
double* parRateList = NULL;
parRateList = new double[tenorNum];
rateInput->getDoubleColumn(ID_PAR_RATE, parRateList);
Note that getDoubleColumn() takes the pointer by non-const reference, that is:
bool getDoubleColumn (int paramId, double*& value);
Hence, technically speaking, both options are plausible.
By the way, there is no "delete" call for that pointer in the example...
Which one is right?
How can I know the exact semantics of the functions declared in ats/dev/include?
Thanks in advance. Best regards,
Martin