#include <Grid.hxx>
Inheritance diagram for SeldonData::RegularGrid< T >:
Public Types | |
typedef T | value_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
Public Member Functions | |
RegularGrid () throw () | |
Default constructor. | |
RegularGrid (int length, int variable=0) throw () | |
Constructor. | |
RegularGrid (value_type start, value_type inc, int length, int variable=0) throw () | |
RegularGrid (const Array< value_type, 1 > &values, int variable=0) throw () | |
RegularGrid (const Grid< T > &G) throw () | |
Copy constructor. | |
RegularGrid (const RegularGrid< T > &G) throw () | |
Copy constructor for regular grids. | |
~RegularGrid () throw () | |
Destructor. | |
RegularGrid< T > & | operator= (const Grid< T > &) |
Affectation operator. | |
RegularGrid< T > & | operator= (const RegularGrid< T > &) |
Affectation operator for regular grids. | |
int | GetLength () const |
Returns grid length. | |
int | GetLength (int i) const |
Returns grid length along dimension i. | |
int | GetNbElements () const |
Returns the number of elements in the grid. | |
Array< value_type, 1 > & | GetArray () |
Returns a reference to the array storing points coordinates. | |
const Array< value_type, 1 > & | GetArray () const |
Returns a reference to the array storing points coordinates. | |
Grid< T > * | Duplicate () const |
Duplicates the grid and returns a pointer to the new copy. | |
Grid< T > * | Copy () |
Returns a pointer to a copy of the grid or to the grid itself. | |
reference | operator() (int i) |
Returns a reference to the i-th element of the grid. | |
value_type | operator() (int i) const |
Returns the i-th element of the grid. | |
reference | Value (int i0, int i1=-1, int i2=-1, int i3=-1, int i4=-1, int i5=-1, int i6=-1, int i7=-1, int i8=-1, int i9=-1) |
Returns a reference to an element of the grid. | |
value_type | Value (int i0, int i1=-1, int i2=-1, int i3=-1, int i4=-1, int i5=-1, int i6=-1, int i7=-1, int i8=-1, int i9=-1) const |
Returns an element of the grid. | |
template<class F> | |
void | Apply (F &function) |
Applies a given function on all elements. | |
template<class T0, class F> | |
void | Apply (RegularGrid< T0 > &, F &function) |
void | Print () const |
Displays grid values. | |
Protected Attributes | |
Array< value_type, 1 > | values_ |
Grid values. |
SeldonData::RegularGrid< T >::RegularGrid | ( | ) | throw () |
Default constructor.
All is set to zero (including grid length).
SeldonData::RegularGrid< T >::RegularGrid | ( | int | length, | |
int | variable = 0 | |||
) | throw () |
Constructor.
Constructs a regular grid of length 'length', related to dimension 'dimension', with zero as initial point, and with one as increment.
length | grid length. | |
variable | dimension number related to the grid. |
SeldonData::RegularGrid< T >::RegularGrid | ( | const Grid< T > & | G | ) | throw () |
Copy constructor.
G | grid to be copied. |
SeldonData::RegularGrid< T >::RegularGrid | ( | const RegularGrid< T > & | G | ) | throw () |
Copy constructor for regular grids.
G | regular grid to be copied. |
RegularGrid< T > & SeldonData::RegularGrid< T >::operator= | ( | const Grid< T > & | G | ) | [virtual] |
Affectation operator.
G | grid to be copied. |
Reimplemented from SeldonData::Grid< T >.
RegularGrid< T > & SeldonData::RegularGrid< T >::operator= | ( | const RegularGrid< T > & | G | ) |
Affectation operator for regular grids.
G | regular grid to be copied. |
int SeldonData::RegularGrid< T >::GetLength | ( | ) | const [inline, virtual] |
int SeldonData::RegularGrid< T >::GetLength | ( | int | i | ) | const [inline, virtual] |
Returns grid length along dimension i.
i | dimension number. |
Reimplemented from SeldonData::Grid< T >.
int SeldonData::RegularGrid< T >::GetNbElements | ( | ) | const [inline, virtual] |
Returns the number of elements in the grid.
Reimplemented from SeldonData::Grid< T >.
Array< typename RegularGrid< T >::value_type, 1 > & SeldonData::RegularGrid< T >::GetArray | ( | ) | [inline] |
Returns a reference to the array storing points coordinates.
const Array< typename RegularGrid< T >::value_type, 1 > & SeldonData::RegularGrid< T >::GetArray | ( | ) | const [inline] |
Returns a reference to the array storing points coordinates.
Grid< T > * SeldonData::RegularGrid< T >::Duplicate | ( | ) | const [virtual] |
Duplicates the grid and returns a pointer to the new copy.
After duplication, no memory is shared with the new grid.
SeldonData::NoMemory | no more memory is available; duplication is impossible. |
Reimplemented from SeldonData::Grid< T >.
Grid< T > * SeldonData::RegularGrid< T >::Copy | ( | ) | [virtual] |
Returns a pointer to a copy of the grid or to the grid itself.
After copy, no memory is shared with the new grid if 'duplicate_' is set to true. Otherwise, the new grid is the same as the current grid, and the returned pointer is the 'this'.
SeldonData::NoMemory | no more memory is available; duplication is impossible. |
Reimplemented from SeldonData::Grid< T >.
RegularGrid< T >::reference SeldonData::RegularGrid< T >::operator() | ( | int | i | ) | [inline, virtual] |
Returns a reference to the i-th element of the grid.
i | index of the element to be returned. |
SeldonData::WrongIndex | index is out of range. |
Reimplemented from SeldonData::Grid< T >.
RegularGrid< T >::value_type SeldonData::RegularGrid< T >::operator() | ( | int | i | ) | const [inline, virtual] |
Returns the i-th element of the grid.
i | index of the element to be returned. |
SeldonData::WrongIndex | index is out of range. |
Reimplemented from SeldonData::Grid< T >.
RegularGrid< T >::reference SeldonData::RegularGrid< T >::Value | ( | int | i0, | |
int | i1 = -1 , |
|||
int | i2 = -1 , |
|||
int | i3 = -1 , |
|||
int | i4 = -1 , |
|||
int | i5 = -1 , |
|||
int | i6 = -1 , |
|||
int | i7 = -1 , |
|||
int | i8 = -1 , |
|||
int | i9 = -1 | |||
) | [inline, virtual] |
Returns a reference to an element of the grid.
i0 | index along dimension #0. | |
i1 | index along dimension #1. | |
i2 | index along dimension #2. | |
i3 | index along dimension #3. | |
i4 | index along dimension #4. | |
i5 | index along dimension #5. | |
i6 | index along dimension #6. | |
i7 | index along dimension #7. | |
i8 | index along dimension #8. | |
i9 | index along dimension #9. |
SeldonData::WrongIndex | index is out of range. |
Reimplemented from SeldonData::Grid< T >.
RegularGrid< T >::value_type SeldonData::RegularGrid< T >::Value | ( | int | i0, | |
int | i1 = -1 , |
|||
int | i2 = -1 , |
|||
int | i3 = -1 , |
|||
int | i4 = -1 , |
|||
int | i5 = -1 , |
|||
int | i6 = -1 , |
|||
int | i7 = -1 , |
|||
int | i8 = -1 , |
|||
int | i9 = -1 | |||
) | const [inline, virtual] |
Returns an element of the grid.
i0 | index along dimension #0. | |
i1 | index along dimension #1. | |
i2 | index along dimension #2. | |
i3 | index along dimension #3. | |
i4 | index along dimension #4. | |
i5 | index along dimension #5. | |
i6 | index along dimension #6. | |
i7 | index along dimension #7. | |
i8 | index along dimension #8. | |
i9 | index along dimension #9. |
SeldonData::WrongIndex | index is out of range. |
Reimplemented from SeldonData::Grid< T >.
Applies a given function on all elements.
function | function to be applied. |
void SeldonData::RegularGrid< T >::Apply | ( | RegularGrid< T0 > & | G, | |
F & | function | |||
) |
G | grid. | |
function | function to be applied on 'G'. |
void SeldonData::RegularGrid< T >::Print | ( | ) | const [virtual] |
Displays grid values.
Displays "Regular grid:" followed by the dimension and the grid values.
Reimplemented from SeldonData::Grid< T >.