Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Linear Algebra Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

9.2 Matrix Entry Helper Classes

The two matrix classes RWGenMat<double> and RWSymMat<double> return a regular C++ reference to a double, that is, a double&. For other matrix types, this is not always possible. For example, an element in class RWBandMat<T> outside the band is defined to be 0; therefore, it is illegal to use an element like an lvalue. In class RWSkewMat<T>, the elements below the main diagonal are not stored explicitly, but calculated as the negative of the element diagonally across the main diagonal. If you access one of these elements, you can not simply return a reference since there is no double type in memory to access.

Obviously, for types other than RWGenMat<T> and RWSymMat<T>, something must be done besides returning a simple reference to a memory location. In these cases, operator()(int,int) returns an instance of a helper class. This class provides the indirection needed so that the subscripting operator works correctly on both the right and left sides of the equal sign. The helper class contains a reference to a double, information on how that reference is to be modified, and whether or not it can be used as an lvalue. There are several different helper classes for the various matrix types:



Previous fileTop of DocumentContentsIndex pageNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.