Hello,
I have written a numerical library and currently the constructor assumes
that the input data is of a particular type (data is 2D array). I would
like to add the functionality that the input data be given as a file as
well. Here is an abbreviated constructor I am using:
hsc_lib::hsc_lib(TNT::Array2D <double& X, int iK, int id):
var1(iK),var2(id),var3(NULL),var4(false)
{
/*some internal parameter initializations and mem allocations occur here*/
}
Any suggestions how I can go about inputing the data as a file as well
(in addition to that 2D array)? One approach is to overload this
constructor. But this involves copying everything in it to another
constructor and I then need to be very careful for making modifications
to the constructors in future.
Any other suggestions?
thanks,
->HS