arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

gutz::vec< T, V_DIM > Class Template Reference

#include <vec.h>

List of all members.


Detailed Description

template<class T, int V_DIM>
class gutz::vec< T, V_DIM >

a vector templated in type and dimension, plus delete policy, but you can ignore this in 99% of normal use a generic vector, with constructors up to length 10 bridges the gap between vectors and arrays, very similar to an array1 but, supports smaller 1D arrays that are used like N Dimensional vectors.

Definition at line 43 of file vec.h.

Public Types

enum  THE_DIM { DIM = V_DIM }

Public Member Functions

 vec ()
 vec (const vec &vee)
 vec (T v1)
 the last value in a constructor gets replicated to the end of the vec if there are more values in the vector than specified by the constructor.

 vec (T v1, T v2)
 vec (T v1, T v2, T v3)
 vec (T v1, T v2, T v3, T v4)
 vec (T v1, T v2, T v3, T v4, T v5)
 vec (T v1, T v2, T v3, T v4, T v5, T v6)
 vec (T v1, T v2, T v3, T v4, T v5, T v6, T v7)
 vec (T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8)
 vec (T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8, T v9)
 vec (T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8, T v9, T v10)
 vec (T *vee, int numVals=-1)
 copy data array, will depend on AllocPolicy used...

virtual ~vec ()
T & operator[] (int i)
 element accessor

const T operator[] (int i) const
int len ()
int dim ()
int size ()
vecoperator= (const vec &v)
 assignment =

vecoperator+= (const T &v)
 +=

vecoperator+= (const vec &v)
vecoperator-= (const T &v)
 -=

vecoperator-= (const vec &v)
vecoperator *= (const T &v)
 *=

vecoperator *= (const vec &v)
vecoperator/= (const T &v)
 /=

vecoperator/= (const vec &v)
vec operator- () const
 negate -

vec operator- (const T &v) const
 subtract

vec operator- (const vec &v) const
vec operator+ (const T &v) const
 add

vec operator+ (const vec &v) const
vec operator * (const T &v) const
 multiply

vec operator * (const vec &v) const
vec operator/ (const T &v) const
 divide

vec operator/ (const vec &v) const
bool operator== (const vec &v) const
 comparison ops =================== equal

bool operator== (T val) const
bool operator!= (const vec &v) const
 not equal

bool operator< (const vec &v) const
 less

bool operator<= (const vec &v) const
 less equal

bool operator> (const vec &v) const
 greater

bool operator>= (const vec &v) const
 greater equal

normL1 () const
 other ops =========================== L1 norm

norm2 () const
 L2 norm squared.

norm () const
 L2 norm.

normalize ()
 Normalize, side-effect op, normalizes this vector!

dot (const vec &v)
 dot product

vec abs ()
 abs of all elements


Public Attributes

T * v
 Public data Member.


Protected Member Functions

 vec (T *vee, bool noCpy)
 do not copy data, just pointer (always shallow copy) the "vee" array MUST be at least as long as this array and created using NEW.


Member Enumeration Documentation

template<class T, int V_DIM>
enum gutz::vec::THE_DIM
 

Enumeration values:
DIM 

Definition at line 47 of file vec.h.


Constructor & Destructor Documentation

template<class T, int V_DIM>
gutz::vec< T, V_DIM >::vec  )  [inline]
 

Definition at line 51 of file vec.h.

Referenced by gutz::vec< int, TF_MAX_R >::abs(), gutz::vec< int, TF_MAX_R >::operator *(), gutz::vec< int, TF_MAX_R >::operator+(), gutz::vec< int, TF_MAX_R >::operator-(), and gutz::vec< int, TF_MAX_R >::operator/().

template<class T, int V_DIM>
gutz::vec< T, V_DIM >::vec const vec< T, V_DIM > &  vee  ) 
 

template<class T, int D>
gutz::vec< T, D >::vec v1  ) 
 

the last value in a constructor gets replicated to the end of the vec if there are more values in the vector than specified by the constructor.

Definition at line 413 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2
 

Definition at line 422 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2,
v3
 

Definition at line 432 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2,
v3,
v4
 

Definition at line 442 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2,
v3,
v4,
v5
 

Definition at line 452 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2,
v3,
v4,
v5,
v6
 

Definition at line 462 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2,
v3,
v4,
v5,
v6,
v7
 

Definition at line 472 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2,
v3,
v4,
v5,
v6,
v7,
v8
 

Definition at line 483 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2,
v3,
v4,
v5,
v6,
v7,
v8,
v9
 

Definition at line 494 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec v1,
v2,
v3,
v4,
v5,
v6,
v7,
v8,
v9,
v10
 

Definition at line 505 of file vec.h.

References gutz::vec< T, V_DIM >::v, and v.

template<class T, int D>
gutz::vec< T, D >::vec T *  vee,
int  numVals = -1
 

copy data array, will depend on AllocPolicy used...

when numVals == -1 you indicate that the "vee" array is at least as big as the dimension of this vec

Definition at line 386 of file vec.h.

References gutz::g_min(), gutz::vec< T, V_DIM >::v, and v.

template<class T, int V_DIM>
virtual gutz::vec< T, V_DIM >::~vec  )  [inline, virtual]
 

Definition at line 71 of file vec.h.

template<class T, int D>
gutz::vec< T, D >::vec T *  vee,
bool  noCpy
[protected]
 

do not copy data, just pointer (always shallow copy) the "vee" array MUST be at least as long as this array and created using NEW.

The array will be deleted with this class. Not public cuz it's a little confusing.

Definition at line 406 of file vec.h.

References v.


Member Function Documentation

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::abs  )  [inline]
 

abs of all elements

Definition at line 247 of file vec.h.

template<class T, int V_DIM>
int gutz::vec< T, V_DIM >::dim  )  [inline]
 

Definition at line 84 of file vec.h.

template<class T, int V_DIM>
T gutz::vec< T, V_DIM >::dot const vec< T, V_DIM > &  v  )  [inline]
 

dot product

Definition at line 242 of file vec.h.

template<class T, int V_DIM>
int gutz::vec< T, V_DIM >::len  )  [inline]
 

Definition at line 83 of file vec.h.

template<class T, int V_DIM>
T gutz::vec< T, V_DIM >::norm  )  const [inline]
 

L2 norm.

Definition at line 229 of file vec.h.

Referenced by gutz::vec< int, TF_MAX_R >::normalize().

template<class T, int V_DIM>
T gutz::vec< T, V_DIM >::norm2  )  const [inline]
 

L2 norm squared.

Definition at line 221 of file vec.h.

Referenced by gutz::vec< int, TF_MAX_R >::norm().

template<class T, int V_DIM>
T gutz::vec< T, V_DIM >::normalize  )  [inline]
 

Normalize, side-effect op, normalizes this vector!

Definition at line 234 of file vec.h.

template<class T, int V_DIM>
T gutz::vec< T, V_DIM >::normL1  )  const [inline]
 

other ops =========================== L1 norm

Definition at line 213 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator * const vec< T, V_DIM > &  v  )  const [inline]
 

Definition at line 153 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator * const T &  v  )  const [inline]
 

multiply

Definition at line 147 of file vec.h.

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator *= const vec< T, V_DIM > &  v  )  [inline]
 

Definition at line 105 of file vec.h.

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator *= const T &  v  )  [inline]
 

*=

Definition at line 103 of file vec.h.

template<class T, int V_DIM>
bool gutz::vec< T, V_DIM >::operator!= const vec< T, V_DIM > &  v  )  const [inline]
 

not equal

Definition at line 188 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator+ const vec< T, V_DIM > &  v  )  const [inline]
 

Definition at line 140 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator+ const T &  v  )  const [inline]
 

add

Definition at line 134 of file vec.h.

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator+= const vec< T, V_DIM > &  v  )  [inline]
 

Definition at line 95 of file vec.h.

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator+= const T &  v  )  [inline]
 

+=

Definition at line 93 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator- const vec< T, V_DIM > &  v  )  const [inline]
 

Definition at line 127 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator- const T &  v  )  const [inline]
 

subtract

Definition at line 121 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator-  )  const [inline]
 

negate -

Definition at line 114 of file vec.h.

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator-= const vec< T, V_DIM > &  v  )  [inline]
 

Definition at line 100 of file vec.h.

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator-= const T &  v  )  [inline]
 

-=

Definition at line 98 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator/ const vec< T, V_DIM > &  v  )  const [inline]
 

Definition at line 166 of file vec.h.

template<class T, int V_DIM>
vec gutz::vec< T, V_DIM >::operator/ const T &  v  )  const [inline]
 

divide

Definition at line 160 of file vec.h.

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator/= const vec< T, V_DIM > &  v  )  [inline]
 

Definition at line 110 of file vec.h.

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator/= const T &  v  )  [inline]
 

/=

Definition at line 108 of file vec.h.

template<class T, int V_DIM>
bool gutz::vec< T, V_DIM >::operator< const vec< T, V_DIM > &  v  )  const [inline]
 

less

Definition at line 191 of file vec.h.

Referenced by gutz::vec< int, TF_MAX_R >::operator>=().

template<class T, int V_DIM>
bool gutz::vec< T, V_DIM >::operator<= const vec< T, V_DIM > &  v  )  const [inline]
 

less equal

Definition at line 198 of file vec.h.

Referenced by gutz::vec< int, TF_MAX_R >::operator>().

template<class T, int V_DIM>
vec& gutz::vec< T, V_DIM >::operator= const vec< T, V_DIM > &  v  )  [inline]
 

assignment =

Definition at line 88 of file vec.h.

template<class T, int V_DIM>
bool gutz::vec< T, V_DIM >::operator== val  )  const [inline]
 

Definition at line 181 of file vec.h.

template<class T, int V_DIM>
bool gutz::vec< T, V_DIM >::operator== const vec< T, V_DIM > &  v  )  const [inline]
 

comparison ops =================== equal

Definition at line 175 of file vec.h.

Referenced by gutz::vec< int, TF_MAX_R >::operator!=().

template<class T, int V_DIM>
bool gutz::vec< T, V_DIM >::operator> const vec< T, V_DIM > &  v  )  const [inline]
 

greater

Definition at line 205 of file vec.h.

template<class T, int V_DIM>
bool gutz::vec< T, V_DIM >::operator>= const vec< T, V_DIM > &  v  )  const [inline]
 

greater equal

Definition at line 208 of file vec.h.

template<class T, int V_DIM>
const T gutz::vec< T, V_DIM >::operator[] int  i  )  const [inline]
 

Definition at line 80 of file vec.h.

template<class T, int V_DIM>
T& gutz::vec< T, V_DIM >::operator[] int  i  )  [inline]
 

element accessor

Definition at line 79 of file vec.h.

template<class T, int V_DIM>
int gutz::vec< T, V_DIM >::size  )  [inline]
 

Definition at line 85 of file vec.h.


Member Data Documentation

template<class T, int V_DIM>
T* gutz::vec< T, V_DIM >::v
 

Public data Member.

Definition at line 75 of file vec.h.

Referenced by TFImage::clear(), gutz::vec< int, TF_MAX_R >::norm2(), gutz::vec< int, TF_MAX_R >::normL1(), gutz::vec< int, TF_MAX_R >::operator-(), gutz::vec< int, TF_MAX_R >::operator==(), gutz::vec< int, TF_MAX_R >::operator[](), gutz::vec< T, V_DIM >::vec(), gutz::vec< int, TF_MAX_R >::vec(), and gutz::vec< int, TF_MAX_R >::~vec().


The documentation for this class was generated from the following file:
Send questions, comments, and bug reports to:
jmk