Topic: Broken input reading in PiecewiseLinFunctionBlock
The initialization function
IRResultType
PiecewiseLinFunctionBlock :: initializeFrom(InputRecord *ir, DataReader *dr)
{
const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
int i;
LoadTimeFunction :: initializeFrom(ir);
IR_GIVE_FIELD(ir, numberOfPoints, IFT_PiecewiseLinFunctionBlock_npoints, "npoints"); // Macro
PiecewiseLinFunction :: dates.resize(numberOfPoints);
PiecewiseLinFunction :: values.resize(numberOfPoints);
for ( i = 0; i < numberOfPoints; i++ ) {
ir = dr->giveInputRecord(DataReader :: IR_ltfRec, i + 1);
ir->giveField(dates.at(i+1),1);
ir->giveField(values.at(i+1),2);
}
ir->finish();
return IRRT_OK;
}does some strange, non-standard, undocumented things when reading the input. It will only work for text input records.
All it does it duplicating the PiecewiseLinFunction but with a non-standard way of reading the input.
And, as mentioned, its not documented anywhere, nor is it used by any test.
I'm very tempted to remove this, as it just seems like leftover code, but I figured I'd ask first.