Manjree Garg wrote:
Hi,
I developed a custom Matrix class derived from custom VC++ doubles Array
class derived from a RealArray which is defined as:
typedef CArray<double,doubleRealArray;
Now I need to convert this custom Matrix class to standard doubles Matrix
(VC++) as I am passing it to some function that understands only the standard
class.
Is there some way of doing it?????
Any suggestions are appriciated.
Manj:
Well, I think that depends on how you have set up your matrix class.
If you look at the Numerical Recipes matrix class (wwww.nr.com) you will
see how they have set it up to that it can be passed as an argument to a
routine expecting a standard two-dimensional array. This is done by
assigning all the memory in a contiguous array, and then defining
pointers into this array to get row-column indexing capability.
Personally, I would not touch CArray with a 10-foot pole. Rather I would
(and do) use either solutions based on std::vector, or a custom solution
such as the Numerical Recipes one.
--
David Wilkinson
Visual C++ MVP