Class for a structured grid. More...
#include <StructuredGrid.h>
Public Types | |
typedef T | Number |
The number type. | |
typedef ads::FixedArray< M, Number > | Point |
The point type. | |
typedef ads::Array< N, Point > | Array |
The array of points. | |
typedef BBox< N, Number > | BBox |
A bounding box. | |
typedef Array::value_type | Value |
The element type of the grid is a point. | |
typedef Array::pointer | Pointer |
A pointer to a grid element. | |
typedef Array::const_pointer | ConstPointer |
A pointer to a constant grid element. | |
typedef Array::iterator | Iterator |
An iterator on points. | |
typedef Array::const_iterator | ConstIterator |
A const iterator on points. | |
typedef Array::reference | Reference |
A reference to a point. | |
typedef Array::const_reference | ConstReference |
A const reference to a point. | |
typedef Array::size_type | SizeType |
The size type. | |
typedef Array::difference_type | DifferenceType |
Pointer difference type. | |
typedef Array::index_type | Index |
A multi-index. Index in N dimensions. | |
Public Member Functions | |
Constructors etc. | |
StructuredGrid () | |
Default constructor. Empty grid. | |
template<bool A> | |
StructuredGrid (const ads::Array< N, Point, A > &grid) | |
Construct from an array of points. | |
StructuredGrid (const Index &extents) | |
Construct from the grid extents. | |
StructuredGrid (const StructuredGrid &other) | |
Copy constructor. | |
StructuredGrid & | operator= (const StructuredGrid &other) |
Assignment operator. | |
~StructuredGrid () | |
Destructor. Free allocated memory. | |
Mathematical Functions | |
BBox | computeBBox () const |
Make a bounding box containing the points in the grid. | |
Manipulators | |
Iterator | getBeginning () |
Return an iterator to the beginning of the points. | |
Iterator | getEnd () |
Return an iterator to the end of the points. | |
Reference | operator() (const Index &mi) |
Return a reference to the given point. | |
ConstReference | operator() (const int i, const int j) |
Return a reference to the given point. | |
ConstReference | operator() (const int i, const int j, const int k) |
Return a reference to the given point. | |
Equality | |
bool | isEqualTo (const StructuredGrid &x) const |
Return true if the grid is equal to the argument. | |
File I/O | |
void | put (std::ostream &out) const |
Write in ascii format. | |
void | get (std::istream &in) |
Read in ascii format. | |
void | writeIndexedSimplexSet (std::ostream &out) const |
Write as an indexed simplex set. | |
Related Functions | |
(Note that these are not member functions.) | |
template<int N, int M, typename T > | |
std::ostream & | operator<< (std::ostream &out, const StructuredGrid< N, M, T > &x) |
Write a grid in ascii format. | |
template<int N, int M, typename T > | |
std::istream & | operator>> (std::istream &in, StructuredGrid< N, M, T > &x) |
Read a grid in ascii format. | |
template<int N, int M, typename T > | |
bool | operator== (const StructuredGrid< N, M, T > &a, const StructuredGrid< N, M, T > &b) |
Return true if the grids are equal. | |
template<int N, int M, typename T > | |
bool | operator!= (const StructuredGrid< N, M, T > &a, const StructuredGrid< N, M, T > &b) |
Return true if the grids are not equal. | |
Accessors | |
| |
const Index & | getExtents () const |
Return the grid extents. | |
SizeType | getSize () const |
Return the number of grid points. | |
ConstIterator | getBeginning () const |
Return a const iterator to the beginning of the points. | |
ConstIterator | getEnd () const |
Return a const iterator to the end of the points. | |
const Array & | getGrid () const |
Return a const reference to the grid array. | |
ConstReference | operator() (const Index &mi) const |
Return a const reference to the given point. | |
ConstReference | operator() (const int i, const int j) const |
Return a const reference to the given point. | |
ConstReference | operator() (const int i, const int j, const int k) const |
Return a const reference to the given point. | |
static int | getSpaceDimension () |
Return the dimension of the space. | |
static int | getGridDimension () |
Return the dimension of the grid. |
Class for a structured grid.
N | is the space dimension. | |
M | is the grid dimension. | |
T | is the number type. By default it is double. |
A structured grid is an N-dimensional array of M-dimensional points.
StructuredGrid< N, M, T >::StructuredGrid | ( | const ads::Array< N, Point, A > & | grid | ) | [inline] |
Construct from an array of points.
grid | is the array of points. |
StructuredGrid< N, M, T >::StructuredGrid | ( | const Index & | extents | ) | [inline] |
Construct from the grid extents.
extents | are the grid extents. |
bool operator!= | ( | const StructuredGrid< N, M, T > & | a, | |
const StructuredGrid< N, M, T > & | b | |||
) | [related] |
Return true if the grids are not equal.
std::ostream & operator<< | ( | std::ostream & | out, | |
const StructuredGrid< N, M, T > & | x | |||
) | [related] |
Write a grid in ascii format.
bool operator== | ( | const StructuredGrid< N, M, T > & | a, | |
const StructuredGrid< N, M, T > & | b | |||
) | [related] |
Return true if the grids are equal.
References StructuredGrid< N, M, T >::isEqualTo().
std::istream & operator>> | ( | std::istream & | in, | |
StructuredGrid< N, M, T > & | x | |||
) | [related] |
Read a grid in ascii format.
References StructuredGrid< N, M, T >::get().