|
-
August 1st, 2010, 03:28 AM
#5
Re: How to overload a matrix class?
@featips,
The code posted by Joeman is correct as far as logic is concerned. It's entirely upto you how you want to go on with it.
In a 2-D array '[]' returns the element at that index (row or column). So subsequent calls to '[]' ends
up fetching the data itself. Notice that there are no separate overloads for '[]' for 1D, 2D, 3D, etc. arrays.
Similarly the operator '[]' in case of your class can be made to return a row/column/1-D array too which with subsequent calls will finally fetch you the data.
Regards,
Nisheeth Barthwal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|