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

mat::MatrixInterface< T > Class Template Reference

#include <matrixadapter.h>

Inheritance diagram for mat::MatrixInterface< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
class mat::MatrixInterface< T >

Abstract base class providing a simple unified virtual-function interface to matrices of various types.

Normally, functions are written to handle different matrix types by accepting a template parameter for the matrix type. Sometimes, however, e.g. when keeping a list of matrices of different types, one needs to have run-time polymorphism instead of just compile-time polymorphism. If such a list uses this base class as its element type, any compatible matrix may be wrapped with one of the classes below so that it can be stored on the list. The main requirement is that the value_type of each matrix be the same.

Of course, since this interface relies on virtual functions, it will be somewhat slower than accepting a template parameter.

Definition at line 195 of file matrixadapter.h.

Public Types

typedef int size_type
typedef T value_type

Public Methods

virtual value_type operator() (const size_type row, const size_type col) const=0
virtual size_type nrows () const=0
 Number of rows in the virtual matrix.

virtual size_type ncols () const=0
 Number of columns in the virtual matrix.


The documentation for this class was generated from the following file:
Generated on Mon Jan 20 02:37:37 2003 for RF-LISSOM by doxygen1.3-rc2