Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

MatrixC< T > Class Reference

A base class for column oriented storage of a Matrix. More...

#include <matrix.h>


Detailed Description

A base class for column oriented storage of a Matrix.

Author(s):
rokrau
Date:
2000/11/21 17:03:07

The template class MatrixC<Tp> is publicly derived from the Matrix base class.

Note that operator[] implies sequential access to all elements and is protected, so it can only be used in member functions, while operator() provides random access to Matrix elements.

Apparently there is a drawback for using the copy on write technique, that is even if the compiler can inline functions and thus optimize function call overhead, speed for write access through operator() will suffer. On the other hand, functions that heavily write to a Matrix can be optimized using various other techniques. For member functions that perform operations on an entire Matrix and even for operations on selected entries it may be useful to explicitely call get_own_copy() and use the much faster [] operator. An example for this can be found in the overloaded istream& operator>>() in matrix.cpp. In general, I try to use the operator() for all generic algorithms that take generic class Matrix as their arguments. Only if speed becomes an issue, i.e. only if profiling tells me that write access is taking too much time, things can be optimized. In these cases it is better that a class is derived from Matrix and the implementation of the actual data is known. Then optimization using the operator[] in connection with the REF_XX and macro should do the trick.


The documentation for this class was generated from the following file:
Generated at Wed Nov 22 08:38:29 2000 for LinAl - a simple and efficient Matrix library - by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000