afl::ValueT< T > Class Template Reference

#include <value.h>

List of all members.

Public Member Functions

 ValueT ()
 ValueT (const T &d)
 ValueT (const T &x, const T &y)
 ValueT (const T &x, const T &y, const T &z)
 ValueT (const T &x, const T &y, const T &z, const T &t)
 ValueT (const ddf::Geometry *geom)
 ValueT (const ddf::Geometry &geom)
ddf::Geometry getGeometry () const
 ~ValueT ()
 ValueT (const ValueT< T > &c)
ValueT< T > & operator= (const ValueT< T > &c)
size_t getRows () const
size_t getColumns () const
const T & at (size_t r, size_t c=0) const
T & at (size_t r, size_t c=0)
const ValueRow< T > operator[] (size_t r) const
ValueRow< T > operator[] (size_t r)
 operator const T & () const
 operator T & ()
std::string geomString () const
ValueT< T > & operator+= (const ValueT< T > &v)
ValueT< T > & operator/= (const data_t &div)
ValueT< T > & operator *= (const data_t &multiplier)
bool operator== (const ValueT< T > &lhs) const
bool operator!= (const ValueT< T > &lhs) const

Protected Attributes

std::vector< T > _v
size_t _c

Classes

class  ValueRow


Detailed Description

template<typename T>
class afl::ValueT< T >

class Value describes a value at a point in the field. The value can be of any 2D geometry but is expected to be either 1x1, 2x1, 3x1, 2x2 or 3x3


Constructor & Destructor Documentation

template<typename T>
afl::ValueT< T >::ValueT  )  [inline]
 

default constructor

template<typename T>
afl::ValueT< T >::ValueT const T &  d  )  [inline]
 

creates a scalar

Parameters:
d the scalar value

template<typename T>
afl::ValueT< T >::ValueT const T &  x,
const T &  y
[inline]
 

creates a 2D vector

Parameters:
x the x component of the vector
y the y component of the vector

template<typename T>
afl::ValueT< T >::ValueT const T &  x,
const T &  y,
const T &  z
[inline]
 

creates a 3D vector

Parameters:
x the x component of the vector
y the y component of the vector
z the z component of the vector

template<typename T>
afl::ValueT< T >::ValueT const T &  x,
const T &  y,
const T &  z,
const T &  t
[inline]
 

creates a 4D vector

Parameters:
x the X component of the vector
y the Y component of the vector
z the Z component of the vector
t the T component of the vector

template<typename T>
afl::ValueT< T >::ValueT const ddf::Geometry geom  )  [explicit]
 

creates an empty value based on a ddf::Geometry

Parameters:
geom the geometry of the object. Any combination is possible

template<typename T>
afl::ValueT< T >::ValueT const ddf::Geometry geom  )  [explicit]
 

creates an empty value based on a ddf::Geometry

Parameters:
geom the geometry of the object. Any combination is possible

template<typename T>
afl::ValueT< T >::~ValueT  )  [inline]
 

destructor

template<typename T>
afl::ValueT< T >::ValueT const ValueT< T > &  c  )  [inline]
 

copy constructor

Parameters:
c the value to copy


Member Function Documentation

template<typename T>
T& afl::ValueT< T >::at size_t  r,
size_t  c = 0
[inline]
 

Parameters:
r the row number
c the column number
Returns:
a constant ValueRow object that can be used for const [][]
Exceptions:
ddf::OutOfBoundsException if the row or the column are outside the value

template<typename T>
const T& afl::ValueT< T >::at size_t  r,
size_t  c = 0
const [inline]
 

Parameters:
r the row number
c the column number
Returns:
a constant ValueRow object that can be used for const [][]
Exceptions:
ddf::OutOfBoundsException if the row or the column are outside the value

template<typename T>
std::string afl::ValueT< T >::geomString  )  const [inline]
 

Returns:
a string describing the geometry of this value. possible values are "scalar" (1x1), "vector2D" (2x1), "vector3D" (3x1), "tensor2D" (2x2) or "tensor3D" (3x3)

template<typename T>
size_t afl::ValueT< T >::getColumns  )  const [inline]
 

Returns:
the number of columns in the value

template<typename T>
ddf::Geometry afl::ValueT< T >::getGeometry  )  const [inline]
 

Returns:
a description of the geometry of this value

template<typename T>
size_t afl::ValueT< T >::getRows  )  const [inline]
 

Returns:
the number of rows in the value

template<typename T>
ValueT<T>& afl::ValueT< T >::operator *= const data_t multiplier  )  [inline]
 

multiplies each element of the value by a multipland. For FnValues this is done symbolically.

Parameters:
multiplier the multipland
Returns:
a reference to this value after the multiplication

template<typename T>
afl::ValueT< T >::operator const T &  )  const [inline]
 

converts a 1x1 value to a scalar.

Returns:
the value of the scalar stored in the data
Exceptions:
ddf::InvalidArgumentException if the value is not a sacalar

template<typename T>
afl::ValueT< T >::operator T &  )  [inline]
 

converts a 1x1 value to a scalar.

Returns:
the value of the scalar stored in the data
Exceptions:
ddf::InvalidArgumentException if the value is not a sacalar

template<typename T>
bool afl::ValueT< T >::operator!= const ValueT< T > &  lhs  )  const [inline]
 

compares two values

Parameters:
lhs a value to compare this one with
Returns:
false if each element of lhs is the same as the corresponding element of this value and true otherwise.
Exceptions:
ddf::InvalidArgumentException if the geometries of the two values being added are different

template<typename T>
ValueT<T>& afl::ValueT< T >::operator+= const ValueT< T > &  v  )  [inline]
 

adds a value to this value. For FnValues this is done symbolically

Parameters:
v the value to add to this one
Returns:
a reference to this value after the addition
Exceptions:
ddf::InvalidArgumentException if the geometries of the two values being added are different

template<typename T>
ValueT<T>& afl::ValueT< T >::operator/= const data_t div  )  [inline]
 

divides all each element of the value by a divisor. For FnValues this is done symbolically.

Parameters:
div the divisor
Returns:
a reference to this value after the division

template<typename T>
ValueT<T>& afl::ValueT< T >::operator= const ValueT< T > &  c  )  [inline]
 

assignment operator

Parameters:
c the value to copy
Returns:
reference to this

template<typename T>
bool afl::ValueT< T >::operator== const ValueT< T > &  lhs  )  const [inline]
 

compares two values

Parameters:
lhs a value to compare this one with
Returns:
true if each element of lhs is the same as the corresponding element of this value and false otherwise.
Exceptions:
ddf::InvalidArgumentException if the geometries of the two values being added are different

template<typename T>
ValueRow<T> afl::ValueT< T >::operator[] size_t  r  )  [inline]
 

Parameters:
r the row number
Returns:
a ValueRow object that can be used for [][]
Exceptions:
ddf::OutOfBoundsException if the row or the column are outside the value

template<typename T>
const ValueRow<T> afl::ValueT< T >::operator[] size_t  r  )  const [inline]
 

Parameters:
r the row number
Returns:
a constant ValueRow object that can be used for const [][]
Exceptions:
ddf::OutOfBoundsException if the row or the column are outside the value


Member Data Documentation

template<typename T>
size_t afl::ValueT< T >::_c [protected]
 

the number of columns in the value. The number of rows is determined by the number of values (_v.size()) divided by the number of columns (_c)

template<typename T>
std::vector<T> afl::ValueT< T >::_v [protected]
 

sequential containe for values


The documentation for this class was generated from the following file:
Generated on Fri Dec 22 07:17:52 2006 for afl by  doxygen 1.4.6