Loading...
Searching...
No Matches
BALL::TRegularData3D< ValueType > Class Template Reference
Foundation Classes » General datastructures » Generic Datastructures for Regularly Spaced Data

`#include <BALL/DATATYPE/regularData3D.h>`

Inheritance diagram for BALL::TRegularData3D< ValueType >:

## Classes

class | IndexType
| The index type used to refer to a specific element in the grid (x-, y-, and z-index). More...
struct | BlockValueType
| The block data type for reading and writing binary data. More...

## Public Types

Type Definitions
typedef std::vector< ValueType > | VectorType
| The type containing an STL vector of the appropriate type.
typedef TVector3< float > | CoordinateType
| The coordinate type.
typedef std::vector< ValueType >::iterator | Iterator
| A mutable iterator.
typedef std::vector< ValueType >::const_iterator | ConstIterator
| A nonmutable iterator.
typedef ValueType | value_type
typedef std::vector< ValueType >::iterator | iterator
typedef std::vector< ValueType >::const_iterator | const_iterator
typedef std::vector< ValueType >::reference | reference
typedef std::vector< ValueType >::const_reference | const_reference
typedef std::vector< ValueType >::pointer | pointer
typedef std::vector< ValueType >::difference_type | difference_type
typedef std::vector< ValueType >::size_type | size_type

## Public Member Functions

Constructors and Destructors
| TRegularData3D ()
| TRegularData3D (const TRegularData3D< ValueType > &grid)
| TRegularData3D (const CoordinateType &origin, const CoordinateType &dimension, const CoordinateType &spacing)
| TRegularData3D (const CoordinateType &origin, const CoordinateType &x_axis, const CoordinateType &y_axis, const CoordinateType &z_axis, const IndexType &size)
| TRegularData3D (const IndexType &size, const CoordinateType &origin=CoordinateType(0.0), const CoordinateType &dimension=CoordinateType(1.0))
virtual | ~TRegularData3D ()
virtual void | clear ()
Assignment
TRegularData3D & | operator= (const TRegularData3D< ValueType > &data)
Predicates
bool | operator== (const TRegularData3D< ValueType > &grid) const
BALL_INLINE bool | operator!= (const TRegularData3D< ValueType > &grid) const
BALL_INLINE bool | empty () const
| Empty predicate.
bool | isInside (const CoordinateType &r) const
| Test if a given point is inside the grid.
BALL_INLINE bool | isOrthogonal () const
| State whether grid is orthogonal or not.
Iterators
BALL_INLINE ConstIterator | begin () const
BALL_INLINE ConstIterator | end () const
BALL_INLINE Iterator | begin ()
BALL_INLINE Iterator | end ()

## Accessors

VectorType | data_
| The grid data.
CoordinateType | origin_
| Origin of the grid (offset).
CoordinateType | dimension_
| Dimension of the grid.
CoordinateType | spacing_
| Grid spacing.
IndexType | size_
| The dimensions in grid points.
bool | is_orthogonal_
| A flag deciding whether the grid is orthogonal or not.
std::vector< double > | mapping_
| mapping matrix and its inverse
std::vector< double > | inverse_mapping_
BALL_INLINE size_type | size () const
BALL_INLINE size_type | max_size () const
BALL_INLINE void | swap (TRegularData3D< ValueType > &grid)
const vector< ValueType > & | getData () const
| Get the full data.
const ValueType & | getData (const IndexType &index) const
ValueType & | getData (const IndexType &index)
const ValueType & | getData (Position index) const
ValueType & | getData (Position index)
const ValueType & | operator[] (const IndexType &index) const
ValueType & | operator[] (const IndexType &index)
const ValueType & | operator[] (Position index) const
ValueType & | operator[] (Position index)
ValueType | operator() (const CoordinateType &x) const
ValueType | getInterpolatedValue (const CoordinateType &x) const
const ValueType & | getClosestValue (const CoordinateType &x) const
ValueType & | getClosestValue (const CoordinateType &x)
IndexType | getClosestIndex (const CoordinateType &v) const
IndexType | getLowerIndex (const CoordinateType &v) const
const IndexType & | getSize () const
const CoordinateType & | getOrigin () const
const CoordinateType & | getSpacing () const
void | setOrigin (const CoordinateType &origin)
const CoordinateType & | getDimension () const
void | setDimension (const CoordinateType &dimension)
void | resize (const IndexType &size)
void | rescale (const IndexType &new_size)
CoordinateType | getCoordinates (const IndexType &index) const
CoordinateType | getCoordinates (Position index) const
void | getEnclosingIndices (const CoordinateType &r, Position &llf, Position &rlf, Position &luf, Position &ruf, Position &llb, Position &rlb, Position &lub, Position &rub) const
void | getEnclosingValues (const CoordinateType &r, ValueType &llf, ValueType &rlf, ValueType &luf, ValueType &ruf, ValueType &llb, ValueType &rlb, ValueType &lub, ValueType &rub) const
ValueType | calculateMean () const
ValueType | calculateSD () const
void | binaryWrite (const String &filename) const
void | binaryWriteRaw (const String &filename) const
void | binaryRead (const String &filename)
const CoordinateType | mapToCartesian_ (CoordinateType r) const
| map indices to Cartesian coordinates
const CoordinateType | mapInverse_ (CoordinateType r) const
| map Cartesian coordinates to indices (note: this does not yet convert the double values to Index)

## Detailed Description

template<typename ValueType>
class BALL::TRegularData3D< ValueType >

Three-dimensional grid class. This class represents a three-dimensional array. An instance of ValueType will be created for each point of the grid upon instantiation of TRegularData3D and initialized with its default value

  This class fulfills the STL Container and Unary Function requirements. Iteration is along the x-axis first, then along the y-axis.

  A TRegularData3D instance can represent a non-orthogonal grid. In this case, a Matrix33 for the conversion to Cartesian coordinates and its inverse must be provided.

Definition at line 45 of file regularData3D.h.

## Member Typedef Documentation

## const_iterator

template<typename ValueType>

typedef std::vector<ValueType>::const_iterator BALL::TRegularData3D< ValueType >::const_iterator

Definition at line 85 of file regularData3D.h.

## const_reference

template<typename ValueType>

typedef std::vector<ValueType>::const_reference BALL::TRegularData3D< ValueType >::const_reference

Definition at line 87 of file regularData3D.h.

## ConstIterator

template<typename ValueType>

typedef std::vector<ValueType>::const_iterator BALL::TRegularData3D< ValueType >::ConstIterator

A nonmutable iterator.

Definition at line 78 of file regularData3D.h.

## CoordinateType

template<typename ValueType>

typedef TVector3<float> BALL::TRegularData3D< ValueType >::CoordinateType

The coordinate type.

Definition at line 74 of file regularData3D.h.

## difference_type

template<typename ValueType>

typedef std::vector<ValueType>::difference_type BALL::TRegularData3D< ValueType >::difference_type

Definition at line 89 of file regularData3D.h.

## Iterator

template<typename ValueType>

typedef std::vector<ValueType>::iterator BALL::TRegularData3D< ValueType >::Iterator

A mutable iterator.

Definition at line 76 of file regularData3D.h.

## iterator

template<typename ValueType>

typedef std::vector<ValueType>::iterator BALL::TRegularData3D< ValueType >::iterator

Definition at line 84 of file regularData3D.h.

## pointer

template<typename ValueType>

typedef std::vector<ValueType>::pointer BALL::TRegularData3D< ValueType >::pointer

Definition at line 88 of file regularData3D.h.

## reference

template<typename ValueType>

typedef std::vector<ValueType>::reference BALL::TRegularData3D< ValueType >::reference

Definition at line 86 of file regularData3D.h.

## size_type

template<typename ValueType>

typedef std::vector<ValueType>::size_type BALL::TRegularData3D< ValueType >::size_type

Definition at line 90 of file regularData3D.h.

## value_type

template<typename ValueType>

typedef ValueType BALL::TRegularData3D< ValueType >::value_type

Definition at line 83 of file regularData3D.h.

## VectorType

template<typename ValueType>

typedef std::vector<ValueType> BALL::TRegularData3D< ValueType >::VectorType

The type containing an STL vector of the appropriate type.

Definition at line 72 of file regularData3D.h.

## Constructor & Destructor Documentation

## TRegularData3D() [1/5]

template<class ValueType>

BALL::TRegularData3D< ValueType >::TRegularData3D | ( |  | ) |

Default constructor. Creates a TRegularData3D object without allocating a grid.

Definition at line 519 of file regularData3D.h.

## TRegularData3D() [2/5]

template<class ValueType>

BALL::TRegularData3D< ValueType >::TRegularData3D | ( | const TRegularData3D< ValueType > & | grid | ) |

Copy constructor.

Exceptions

  Exception::OutOfMemory | if the memory for the copy could not be allocated

Definition at line 531 of file regularData3D.h.

## TRegularData3D() [3/5]

template<typename ValueType>

BALL::TRegularData3D< ValueType >::TRegularData3D | ( | const CoordinateType & | origin,
|  | const CoordinateType & | dimension,
|  | const CoordinateType & | spacing )

Constructor for an orthogonal TRegularData3D.

Exceptions

  Exception::OutOfMemory | if the memory for the grid could not be allocated

## TRegularData3D() [4/5]

template<typename ValueType>

BALL::TRegularData3D< ValueType >::TRegularData3D | ( | const CoordinateType & | origin,
|  | const CoordinateType & | x_axis,
|  | const CoordinateType & | y_axis,
|  | const CoordinateType & | z_axis,
|  | const IndexType & | size )

Constructor for a non-orthogonal TRegularData3D.

Exceptions

  Exception::OutOfMemory | if the memory for the grid could not be allocated

## TRegularData3D() [5/5]

template<typename ValueType>

BALL::TRegularData3D< ValueType >::TRegularData3D | ( | const IndexType & | size,
|  | const CoordinateType & | origin = CoordinateType(0.0),
|  | const CoordinateType & | dimension = CoordinateType(1.0) )

Constructor for a standard orthogonal TRegularData3D.

Exceptions

  Exception::OutOfMemory | if the memory for the grid could not be allocated

## ~TRegularData3D()

template<class ValueType>

BALL::TRegularData3D< ValueType >::~TRegularData3D | ( |  | ) |

virtual

Destructor.

Definition at line 681 of file regularData3D.h.

## Member Function Documentation

## begin() [1/2]

template<typename ValueType>

BALL_INLINE Iterator BALL::TRegularData3D< ValueType >::begin | ( |  | ) |

inline

Definition at line 180 of file regularData3D.h.

## begin() [2/2]

template<typename ValueType>

BALL_INLINE ConstIterator BALL::TRegularData3D< ValueType >::begin | ( |  | ) | const

inline

Definition at line 176 of file regularData3D.h.

## binaryRead()

template<typename ValueType>

void BALL::TRegularData3D< ValueType >::binaryRead | ( | const String & | filename | ) |

Read the grid contents from a file written with binaryWrite

Note: this currently only works correctly for orthogonal grids.

Exceptions

  Exception::FileNotFound | thrown if file does not exist or could not be read

Definition at line 1342 of file regularData3D.h.

## binaryWrite()

template<typename ValueType>

void BALL::TRegularData3D< ValueType >::binaryWrite | ( | const String & | filename | ) | const

Write the grid contents in a (non-portable) binary format.

Note: this currently only works correctly for orthogonal grids.

Exceptions

  Exception::FileNotFound | thrown if the file could not be written

Definition at line 1290 of file regularData3D.h.

## binaryWriteRaw()

template<typename ValueType>

void BALL::TRegularData3D< ValueType >::binaryWriteRaw | ( | const String & | filename | ) | const

Writes out raw binary plus text header file. !!!WARNING!!! This method is defined only for float template parameters. If you try it to call it from any other specialization, it will give out compile error that the function has no body.

Exceptions

  Exception::FileNotFound | thrown if the file could not be written

## calculateMean()

template<typename ValueType>

BALL_INLINE ValueType BALL::TRegularData3D< ValueType >::calculateMean | ( |  | ) | const

Calculate the mean of the dataset

Returns
  ValueType

Definition at line 1234 of file regularData3D.h.

## calculateSD()

template<typename ValueType>

BALL_INLINE ValueType BALL::TRegularData3D< ValueType >::calculateSD | ( |  | ) | const

Calculate the standard deviation of the dataset

Returns
  ValueType

Definition at line 1248 of file regularData3D.h.

## clear()

template<typename ValueType>

void BALL::TRegularData3D< ValueType >::clear | ( |  | ) |

virtual

Clear method. Delete the grid contents and resize it to zero.

Reimplemented in BALL::TFFT3D< ComplexTraits >, and BALL::TFFT3D< BALL_FFTW_DEFAULT_TRAITS >.

Definition at line 1263 of file regularData3D.h.

## empty()

template<typename ValueType>

BALL_INLINE bool BALL::TRegularData3D< ValueType >::empty | ( |  | ) | const

inline

Empty predicate.

Definition at line 163 of file regularData3D.h.

## end() [1/2]

template<typename ValueType>

BALL_INLINE Iterator BALL::TRegularData3D< ValueType >::end | ( |  | ) |

inline

Definition at line 182 of file regularData3D.h.

## end() [2/2]

template<typename ValueType>

BALL_INLINE ConstIterator BALL::TRegularData3D< ValueType >::end | ( |  | ) | const

inline

Definition at line 178 of file regularData3D.h.

## getClosestIndex()

template<typename ValueType>

BALL_INLINE TRegularData3D< ValueType >::IndexType BALL::TRegularData3D< ValueType >::getClosestIndex | ( | const CoordinateType & | v | ) | const

Return the position of the grid point closest to the given vector. If there are multiple grid points with equal distance, the grid point with the lowest indices in x, y direction is returned.

Exceptions

  Exception::OutOfGrid | if the point is outside the grid

Definition at line 1118 of file regularData3D.h.

## getClosestValue() [1/2]

template<typename ValueType>

ValueType & BALL::TRegularData3D< ValueType >::getClosestValue | ( | const CoordinateType & | x | ) |

Return a mutable reference to the closest non-interpolated value. This method first performs a range check for the argument x and then returns the value of the closest data point to the left or right of x.

Exceptions

  Exception::OutOfGrid | if x is outside the grid boundaries

## getClosestValue() [2/2]

template<typename ValueType>

const ValueType & BALL::TRegularData3D< ValueType >::getClosestValue | ( | const CoordinateType & | x | ) | const

Return a nonmutable reference to the closest non-interpolated value. This method first performs a range check for the argument x and then returns the value of the closest data point to the left or right of x.

Exceptions

  Exception::OutOfGrid | if x is outside the grid boundaries

## getCoordinates() [1/2]

template<typename ValueType>

CoordinateType BALL::TRegularData3D< ValueType >::getCoordinates | ( | const IndexType & | index | ) | const

Returns the exact coordinates of a grid point.

Returns
  CoordinateType

Exceptions

  Exception::OutOfGrid | if the point is outside the grid boundaries

## getCoordinates() [2/2]

template<class ValueType>

BALL_INLINE TRegularData3D< ValueType >::CoordinateType BALL::TRegularData3D< ValueType >::getCoordinates | ( | Position | index | ) | const

Returns the exact coordinates of a grid point.

Returns
  CoordinateType

Exceptions

  Exception::OutOfGrid | if the point is outside the grid boundaries

Definition at line 946 of file regularData3D.h.

## getData() [1/5]

template<class ValueType>

BALL_INLINE const vector< ValueType > & BALL::TRegularData3D< ValueType >::getData | ( |  | ) | const

Get the full data.

Definition at line 877 of file regularData3D.h.

## getData() [2/5]

template<typename ValueType>

ValueType & BALL::TRegularData3D< ValueType >::getData | ( | const IndexType & | index | ) |

Return a mutable reference to a specific data element. This is the range checking version of operator [].

Exceptions

  Exception::OutOfGrid | if index is outside the grid boundaries

## getData() [3/5]

template<typename ValueType>

const ValueType & BALL::TRegularData3D< ValueType >::getData | ( | const IndexType & | index | ) | const

Return a nonmutable reference to a specific data element. This is the range checking version of operator [].

Exceptions

  Exception::OutOfGrid | if index is outside the grid boundaries

## getData() [4/5]

template<class ValueType>

BALL_INLINE ValueType & BALL::TRegularData3D< ValueType >::getData | ( | Position | index | ) |

Return a mutable reference to a specific data element. This is the range checking version of operator [].

Exceptions

  Exception::OutOfGrid | if index is outside the grid boundaries

Definition at line 908 of file regularData3D.h.

## getData() [5/5]

template<class ValueType>

BALL_INLINE const ValueType & BALL::TRegularData3D< ValueType >::getData | ( | Position | index | ) | const

Return a nonmutable reference to a specific data element. This is the range checking version of operator [].

Exceptions

  Exception::OutOfGrid | if index is outside the grid boundaries

Definition at line 897 of file regularData3D.h.

## getDimension()

template<typename ValueType>

const CoordinateType & BALL::TRegularData3D< ValueType >::getDimension | ( |  | ) | const

inline

Return the dimension of the data. The dimension represents the length of the data vector. Hence, the coordinate of the rightmost element, data_[getSize() - 1] is the origin plus the dimension (getOrigin() + getDimension()).

Definition at line 328 of file regularData3D.h.

## getEnclosingIndices()

template<typename ValueType>

BALL_INLINE void BALL::TRegularData3D< ValueType >::getEnclosingIndices | ( | const CoordinateType & | r,
|  | Position & | llf,
|  | Position & | rlf,
|  | Position & | luf,
|  | Position & | ruf,
|  | Position & | llb,
|  | Position & | rlb,
|  | Position & | lub,
|  | Position & | rub ) const

Return the indices of the grid points of the enclosing box. This method calculates the grid box that contains the given vector and returns the indices of the grid points forming this box. The given point lies either in the box or is the lower left front edge of the box.

Parameters

  vector | a point inside the grid
  llf | left lower front corner of the box
  rlf | right lower front corner of the box
  luf | left upper front corner of the box
  ruf | right upper front corner of the box
  llb | left lower back corner of the box
  rlb | right lower back corner of the box
  lub | left upper back corner of the box
  rub | right upper back corner of the box

Exceptions

  Exception::OutOfGrid | if the point is outside the grid boundaries

Definition at line 974 of file regularData3D.h.

## getEnclosingValues()

template<typename ValueType>

BALL_INLINE void BALL::TRegularData3D< ValueType >::getEnclosingValues | ( | const CoordinateType & | r,
|  | ValueType & | llf,
|  | ValueType & | rlf,
|  | ValueType & | luf,
|  | ValueType & | ruf,
|  | ValueType & | llb,
|  | ValueType & | rlb,
|  | ValueType & | lub,
|  | ValueType & | rub ) const

Return the data at the grid points of the enclosing box.

Exceptions

  Exception::OutOfGrid | if the point is outside the grid boundaries

See also
  getEnclosingIndices

Definition at line 1016 of file regularData3D.h.

## getInterpolatedValue()

template<typename ValueType>

BALL_INLINE ValueType BALL::TRegularData3D< ValueType >::getInterpolatedValue | ( | const CoordinateType & | x | ) | const

Return the linearly interpolated value of the surrounding two grid points. This method first performs a range check for the argument x and then calls operator () (x) to determine an interpolated value at that position.

Exceptions

  Exception::OutOfGrid | if x is outside the grid boundaries

Definition at line 1043 of file regularData3D.h.

## getLowerIndex()

template<typename ValueType>

BALL_INLINE TRegularData3D< ValueType >::IndexType BALL::TRegularData3D< ValueType >::getLowerIndex | ( | const CoordinateType & | v | ) | const

Return the position of the next grid point with coordinates smaller than the given vector. This yields the front lower left corner of the cube enclosing the specified position.

Exceptions

  Exception::OutOfGrid | if the point is outside the grid

Definition at line 1147 of file regularData3D.h.

## getOrigin()

template<typename ValueType>

const CoordinateType & BALL::TRegularData3D< ValueType >::getOrigin | ( |  | ) | const

inline

Return the origin of the data. The origin represents the coordinate of the very first (lower left) element, i.e. data_[0].

Definition at line 312 of file regularData3D.h.

## getSize()

template<typename ValueType>

const IndexType & BALL::TRegularData3D< ValueType >::getSize | ( |  | ) | const

inline

Return the size of the grid. This method yields the number of grid points in x- and y-direction. Use size to obtain the total number of points in the grid.

Definition at line 306 of file regularData3D.h.

## getSpacing()

template<typename ValueType>

const CoordinateType & BALL::TRegularData3D< ValueType >::getSpacing | ( |  | ) | const

inline

Return the spacing of the data. The spacing corresponds to the distance between two adjacent data elements.

Definition at line 318 of file regularData3D.h.

## isInside()

template<typename ValueType>

BALL_INLINE bool BALL::TRegularData3D< ValueType >::isInside | ( | const CoordinateType & | r | ) | const

Test if a given point is inside the grid.

Definition at line 840 of file regularData3D.h.

## isOrthogonal()

template<typename ValueType>

BALL_INLINE bool BALL::TRegularData3D< ValueType >::isOrthogonal | ( |  | ) | const

inline

State whether grid is orthogonal or not.

Definition at line 170 of file regularData3D.h.

## mapInverse_()

template<typename ValueType>

const CoordinateType BALL::TRegularData3D< ValueType >::mapInverse_ | ( | CoordinateType | r | ) | const

inline protected

map Cartesian coordinates to indices (note: this does not yet convert the double values to Index)

Definition at line 471 of file regularData3D.h.

## mapToCartesian_()

template<typename ValueType>

const CoordinateType BALL::TRegularData3D< ValueType >::mapToCartesian_ | ( | CoordinateType | r | ) | const

inline protected

map indices to Cartesian coordinates

Definition at line 456 of file regularData3D.h.

## max_size()

template<typename ValueType>

BALL_INLINE size_type BALL::TRegularData3D< ValueType >::max_size | ( |  | ) | const

inline

Definition at line 191 of file regularData3D.h.

## operator!=()

template<typename ValueType>

BALL_INLINE bool BALL::TRegularData3D< ValueType >::operator!= | ( | const TRegularData3D< ValueType > & | grid | ) | const

inline

Inequality operator.

Definition at line 160 of file regularData3D.h.

## operator()()

template<typename ValueType>

BALL_INLINE ValueType BALL::TRegularData3D< ValueType >::operator() | ( | const CoordinateType & | x | ) | const

Function operator. This operator allows the use of a TRegularData1D instance as a unary function. As required by the STL Unary Function concept, the argument x is required to be within the correct range. A more robust (range-checking) version of this operator is implemented as getInterpolatedValue . getInterpolatedValue() . @precondition getOrigin() <= x <= getOrigin() + getDimension()

Definition at line 1055 of file regularData3D.h.

## operator=()

template<typename ValueType>

BALL_INLINE TRegularData3D< ValueType > & BALL::TRegularData3D< ValueType >::operator= | ( | const TRegularData3D< ValueType > & | data | ) |

Assignment operator. Copy the data, the origin, and the dimension (spacing is copied implicitly as well).

Exceptions

  Exception::OutOfMemory | if the memory for the copy could not be allocated

Definition at line 687 of file regularData3D.h.

## operator==()

template<typename ValueType>

bool BALL::TRegularData3D< ValueType >::operator== | ( | const TRegularData3D< ValueType > & | grid | ) | const

Equality operator. Two point grids are equal if they have the same number of points in all three dimensions, same origin, spacing and all array members are identical.

Definition at line 1278 of file regularData3D.h.

## operator[]() [1/4]

template<typename ValueType>

ValueType & BALL::TRegularData3D< ValueType >::operator[] | ( | const IndexType & | index | ) |

inline

Mutable random access operator.

Note
  No range checking is done. For a more robust version, please use getData.

Definition at line 235 of file regularData3D.h.

## operator[]() [2/4]

template<typename ValueType>

const ValueType & BALL::TRegularData3D< ValueType >::operator[] | ( | const IndexType & | index | ) | const

inline

Nonmutable random access operator.

Note
  No range checking is done. For a more robust version, please use getData.

Definition at line 226 of file regularData3D.h.

## operator[]() [3/4]

template<typename ValueType>

ValueType & BALL::TRegularData3D< ValueType >::operator[] | ( | Position | index | ) |

inline

Mutable random access operator.

Note
  No range checking is done. For a more robust version, please use getData.

Definition at line 250 of file regularData3D.h.

## operator[]() [4/4]

template<typename ValueType>

const ValueType & BALL::TRegularData3D< ValueType >::operator[] | ( | Position | index | ) | const

inline

Nonmutable random access operator.

Note
  No range checking is done. For a more robust version, please use getData.

Definition at line 244 of file regularData3D.h.

## rescale()

template<typename ValueType>

void BALL::TRegularData3D< ValueType >::rescale | ( | const IndexType & | new_size | ) |

Rescale the data. Keep the current boundaries of the data and reinterpolate the data to reflect the new size. To create a data set of new_size data points, the data is interpolated linearly at the new data points from the closest points in the old data set.

  Note: this function currently only works on orthogonal grids! For non-orthogonal data calls to rescale are ignored.

Parameters

  new_size | the new data set size

Exceptions

  Exception::OutOfMemory | if the memory for the resized grid could not be allocated

Definition at line 782 of file regularData3D.h.

## resize()

template<typename ValueType>

void BALL::TRegularData3D< ValueType >::resize | ( | const IndexType & | size | ) |

Resize the data. If new_size is larger than the current size, the data vector is extended to the new size and filled with default constructed items of type ValueType. Resizing to a value lesser than the current size truncates the vector.

  The boundaries are adapted and the positions of the retained items fixed, i.e. the dimension is increased or decreased proportionally while the origin remains unchanged.

  Note: this function currently only works on orthogonal grids! For non-orthogonal data calls to resize are ignored.

Parameters

  size | the new size

Exceptions

  Exception::OutOfMemory | if the memory for the resized grid could not be allocated

Definition at line 719 of file regularData3D.h.

## setDimension()

template<typename ValueType>

void BALL::TRegularData3D< ValueType >::setDimension | ( | const CoordinateType & | dimension | ) |

inline

Set the dimension of the data. This will affect neither the origin of the data, nor the number of elements stored (in contrast to resize() ). It will just store the appropriate scaling factor and affect the spacing.

  Note: For non-orthogonal grids, the spacing cannot be correctly deduced and will consequently not be changed.

Definition at line 338 of file regularData3D.h.

## setOrigin()

template<typename ValueType>

void BALL::TRegularData3D< ValueType >::setOrigin | ( | const CoordinateType & | origin | ) |

inline

Set the origin of the data.

Definition at line 321 of file regularData3D.h.

## size()

template<typename ValueType>

BALL_INLINE size_type BALL::TRegularData3D< ValueType >::size | ( |  | ) | const

inline

Definition at line 190 of file regularData3D.h.

## swap()

template<typename ValueType>

BALL_INLINE void BALL::TRegularData3D< ValueType >::swap | ( | TRegularData3D< ValueType > & | grid | ) |

inline

Definition at line 192 of file regularData3D.h.

## Member Data Documentation

## data_

template<typename ValueType>

VectorType BALL::TRegularData3D< ValueType >::data_

protected

The grid data.

Definition at line 488 of file regularData3D.h.

## dimension_

template<typename ValueType>

CoordinateType BALL::TRegularData3D< ValueType >::dimension_

protected

Dimension of the grid.

Definition at line 494 of file regularData3D.h.

## inverse_mapping_

template<typename ValueType>

std::vector<double> BALL::TRegularData3D< ValueType >::inverse_mapping_

protected

Definition at line 510 of file regularData3D.h.

## is_orthogonal_

template<typename ValueType>

bool BALL::TRegularData3D< ValueType >::is_orthogonal_

protected

A flag deciding whether the grid is orthogonal or not.

Definition at line 506 of file regularData3D.h.

## mapping_

template<typename ValueType>

std::vector<double> BALL::TRegularData3D< ValueType >::mapping_

protected

mapping matrix and its inverse

Definition at line 509 of file regularData3D.h.

## origin_

template<typename ValueType>

CoordinateType BALL::TRegularData3D< ValueType >::origin_

protected

Origin of the grid (offset).

Definition at line 491 of file regularData3D.h.

## size_

template<typename ValueType>

IndexType BALL::TRegularData3D< ValueType >::size_

protected

The dimensions in grid points.

Definition at line 500 of file regularData3D.h.

## spacing_

template<typename ValueType>

CoordinateType BALL::TRegularData3D< ValueType >::spacing_

protected

Grid spacing.

Definition at line 497 of file regularData3D.h.