#include <matrixadapter.h>
Inheritance diagram for mat::MatrixInterface< T >:
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. |