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

mat::matrixadapter Template Class Reference

Adapter from an existing matrix to another matrix with arbitrary linear value scaling, width and height extension and offsetting, etc. as needed. More...

#include <matrixadapter.h>

List of all members.

Public Types

typedef M::size_type size_type
typedef int Coordinate
typedef M::value_type value_type

Public Methods

 matrixadapter ()
 Default constructor. More...

 matrixadapter (const M& x, const value_type& a=1.0, const value_type& b=0.0, size_type nr=0, size_type nc=0, size_type o_r=0, size_type o_c=0, double sr=1, double sc=1)
 Typical constructor; all arguments optional except the underlying matrix. More...

bool inbounds (const size_type r, const size_type c) const
 Returns true if the given coordinates are within the matrix. More...

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

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


Protected Attributes

m
value_type alpha
value_type beta
size_type height
size_type width
Coordinate originr
Coordinate originc
double div_sizer
double div_sizec


Detailed Description

template<class M> template class mat::matrixadapter

Adapter from an existing matrix to another matrix with arbitrary linear value scaling, width and height extension and offsetting, etc. as needed.

Increases and decreases in size are not anti-aliased, so the result will be blocky. All computation is done as the elements are accessed, and no temporary matrix is used.

This adapter is particularly useful for plotting a matrix whose values are in an inconvenient range, which you want to situate in a larger or smaller area, or of which you want only a portion.

Definition at line 28 of file matrixadapter.h.


Member Typedef Documentation

template<classM>
typedef int mat::matrixadapter<M>::Coordinate
 

Definition at line 33 of file matrixadapter.h.

template<classM>
typedef M::size_type mat::matrixadapter<M>::size_type
 

Definition at line 32 of file matrixadapter.h.

template<classM>
typedef M::value_type mat::matrixadapter<M>::value_type
 

Definition at line 34 of file matrixadapter.h.


Constructor & Destructor Documentation

template<classM>
mat::matrixadapter<M>::matrixadapter<M> ( ) [inline]
 

Default constructor.

Definition at line 37 of file matrixadapter.h.

template<classM>
mat::matrixadapter<M>::matrixadapter<M> ( const M & x,
const value_type & a = 1.0,
const value_type & b = 0.0,
size_type nr = 0,
size_type nc = 0,
size_type o_r = 0,
size_type o_c = 0,
double sr = 1,
double sc = 1 ) [inline]
 

Typical constructor; all arguments optional except the underlying matrix.

Linear value scaling is provided as val=orig*a+b. The height and width default to the natural size of the matrix; they can be overridden to any nonzero value, and will be taken relative to the original size of the matrix, regardless of any subsequent scaling. (Specified height and width must be nonzero due to a limitation of GCC 2.95.2 and earlier, which do not allow member functions in default initializers.) Values outside the native size of the array are assumed to be zero, and thus the offset b is returned. The underlying array may be placed at an arbitrary origin (or,oc) within the full region, and the full region is then scaled in size by sr and sc.

Definition at line 55 of file matrixadapter.h.


Member Function Documentation

template<classM>
bool mat::matrixadapter<M>::inbounds ( const size_type r,
const size_type c ) const [inline]
 

Returns true if the given coordinates are within the matrix.

Definition at line 66 of file matrixadapter.h.

template<classM>
size_type mat::matrixadapter<M>::ncols ( ) const [inline]
 

Number of columns in the virtual matrix.

Definition at line 98 of file matrixadapter.h.

template<classM>
size_type mat::matrixadapter<M>::nrows ( ) const [inline]
 

Number of rows in the virtual matrix.

Definition at line 95 of file matrixadapter.h.

template<classM>
value_type mat::matrixadapter<M>::operator() ( const size_type row,
const size_type col ) const [inline]
 

Definition at line 73 of file matrixadapter.h.


Member Data Documentation

template<classM>
value_type mat::matrixadapter<M>::alpha [protected]
 

Definition at line 103 of file matrixadapter.h.

template<classM>
value_type mat::matrixadapter<M>::beta [protected]
 

Definition at line 103 of file matrixadapter.h.

template<classM>
double mat::matrixadapter<M>::div_sizec [protected]
 

Definition at line 106 of file matrixadapter.h.

template<classM>
double mat::matrixadapter<M>::div_sizer [protected]
 

Definition at line 106 of file matrixadapter.h.

template<classM>
size_type mat::matrixadapter<M>::height [protected]
 

Definition at line 104 of file matrixadapter.h.

template<classM>
M mat::matrixadapter<M>::m [protected]
 

Definition at line 101 of file matrixadapter.h.

template<classM>
Coordinate mat::matrixadapter<M>::originc [protected]
 

Definition at line 105 of file matrixadapter.h.

template<classM>
Coordinate mat::matrixadapter<M>::originr [protected]
 

Definition at line 105 of file matrixadapter.h.

template<classM>
size_type mat::matrixadapter<M>::width [protected]
 

Definition at line 104 of file matrixadapter.h.


The documentation for this class was generated from the following file:
Generated at Mon Aug 21 00:31:19 2000 for RF-LISSOM by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000