Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

VEC< N, T > Class Template Reference

A fixed-dimension vector for LUT parameters. More...

#include <LUT.h>

List of all members.

Public Methods

 VEC (std::vector< T > const &v)
 Convenience constructor, initialize from std::vector.

 VEC (T d)
 Partial constructor.

 VEC ()
 Default constructor.

VEC< N, T > & set (T d)
 Set a new value for the vector.

VEC< N, T > & operator() (T d)
 Syntactic sugar for constructing vectors as expressions.

T & operator[] (int n) const
 Return an indexed element of the vector.

VEC< N-1, T > rest () const
 Return a lower dimensional vector containing all but the first element of the original vector.


Friends

class VEC< N+1, T >


Detailed Description

template<int N, typename T>
class VEC< N, T >

A fixed-dimension vector for LUT parameters.

General purpose, fixed-dimension vectors for use with LUT templates. Used for passing table dimensions and lookup coordinates. Not the cleanest class ever, but its fast and designed to work with recursive algorithms (which the LUT classes use extensively).

Author:
Mark Rose <mrose@stm.lbl.gov>


Constructor & Destructor Documentation

template<int N, typename T>
VEC< N, T >::VEC std::vector< T > const &    v [inline]
 

Convenience constructor, initialize from std::vector.

template<int N, typename T>
VEC< N, T >::VEC   d [inline]
 

Partial constructor.

See operator() for details.

template<int N, typename T>
VEC< N, T >::VEC   [inline]
 

Default constructor.

The new VEC must be initialized before use. See set().


Member Function Documentation

template<int N, typename T>
VEC<N,T>& VEC< N, T >::operator()   d [inline]
 

Syntactic sugar for constructing vectors as expressions.

e.g. VEC<3,int>(10)(100)(1000)

template<int N, typename T>
T& VEC< N, T >::operator[] int    n const [inline]
 

Return an indexed element of the vector.

Generally only called with n = 0. Use rest() to access other members in recursive methods.

template<int N, typename T>
VEC<N-1, T> VEC< N, T >::rest   const [inline]
 

Return a lower dimensional vector containing all but the first element of the original vector.

template<int N, typename T>
VEC<N,T>& VEC< N, T >::set   d [inline]
 

Set a new value for the vector.

For N>1 this creates an "incomplete" vector that must be finished by additional calls to operator(), as in:

VEC<3,int> s; s.set(10)(100)(1000);


Friends And Related Function Documentation

template<int N, typename T>
friend class VEC< N+1, T > [friend]
 


The documentation for this class was generated from the following file:
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage.

Generated on Tue Oct 14 12:06:42 2003, using Doxygen 1.2.18.

[SF.net]