A N-dimensional Point representation.
More...
#include <Point.h>
|
typedef std::vector< T >::const_iterator | const_iterator |
|
|
| Point (T x) |
| Creates a one dimensional point with the specified value. More...
|
|
| Point (T x, T y) |
| Creates a two dimensional point with the specified values. More...
|
|
| Point (T x, T y, T z) |
| Creates a three dimensional point with the specified values. More...
|
|
| Point (std::vector< T > coordinates) |
| Creates a multi-dimensional point with the specified values. More...
|
|
T | getX () const |
| Gets the x coordinate of the point. More...
|
|
T | getY () const |
| Gets the y coordinate of the point. More...
|
|
T | getZ () const |
| Gets the z coordinate of the point. More...
|
|
T | getCoordinate (int coordIndex) const |
| Gets the coodinate of the point in the specified dimension. More...
|
|
void | add (const Point< T > &pt) |
| Adds the specified GridPoint to this GridPoint. More...
|
|
size_t | dimensionCount () const |
| Gets the number of dimensions of this point. More...
|
|
const T & | operator[] (size_t index) const |
| Gets the coordinate value at the specified index. More...
|
|
T & | operator[] (size_t index) |
| Gets the coordinate value at the specified index. More...
|
|
const std::vector< T > & | coords () const |
| Gets the coordinates of this point as a vector. More...
|
|
const_iterator | begin () const |
| Gets the start of an iterator over the coordinates of this point. More...
|
|
const_iterator | end () const |
| Gets the end of an iterator over the coordinates of this point. More...
|
|
void | copy (std::vector< T > &out) const |
| Copies the point into the specified vector. More...
|
|
|
struct | HashGridPoint< T > |
|
class | boost::serialization::access |
|
bool | operator== (const Point< T > &one, const Point< T > &two) |
|
std::ostream & | operator<< (std::ostream &os, const Point< T > &pt) |
|
template<typename T>
class repast::Point< T >
A N-dimensional Point representation.
N dimensional point for addressing matrix locations.
- Parameters
-
T | a numeric type. In repast and relogo these are limited to int and double. |
◆ Point() [1/4]
Creates a one dimensional point with the specified value.
- Parameters
-
x | the x coordinate of the point |
◆ Point() [2/4]
Creates a two dimensional point with the specified values.
- Parameters
-
x | the x coordinate of the point |
y | the y coordinate of the point |
◆ Point() [3/4]
Creates a three dimensional point with the specified values.
- Parameters
-
x | the x coordinate of the point |
y | the y coordinate of the point |
z | the z coordinate of the point |
◆ Point() [4/4]
Creates a multi-dimensional point with the specified values.
- Parameters
-
coordinates | the coordinate values of the point. The first element will be x, the second y and so on. |
◆ add()
Adds the specified GridPoint to this GridPoint.
This GridPoint contains the result.
- Exceptions
-
invalid_argument | exception if the pt doesn't have the same number of dimensions as this GridPoint. |
◆ begin()
Gets the start of an iterator over the coordinates of this point.
- Returns
- the start of an iterator over the coordinates of this point.
◆ coords()
Gets the coordinates of this point as a vector.
- Returns
- a vector containing the coordinates of this point.
◆ copy()
Copies the point into the specified vector.
Assumes the array is the same length as this GridPoint.
- Parameters
-
[out] | the | vector to copy the point coordinates into |
◆ dimensionCount()
Gets the number of dimensions of this point.
- Returns
- the number of dimensions of this point.
◆ end()
Gets the end of an iterator over the coordinates of this point.
- Returns
- the end of an iterator over the coordinates of this point.
◆ getCoordinate()
Gets the coodinate of the point in the specified dimension.
- Parameters
-
coordIndex | the dimension of the point to get the coordinate for. X is the first, y is the second and so on. |
- Returns
- the coordinate of the point in the specified dimension.
- Exceptions
-
an | out_of_range exception if this GridPoint has doesn't have the specified dimension. |
◆ getX()
Gets the x coordinate of the point.
- Returns
- the x coordinate of the point.
◆ getY()
Gets the y coordinate of the point.
- Returns
- the y coordinate of the point.
- Exceptions
-
an | out_of_range exception if this GridPoint has less than 2 dimensions. |
◆ getZ()
Gets the z coordinate of the point.
- Returns
- the z coordinate of the point.
- Exceptions
-
an | out_of_range exception if this GridPoint has less than 3 dimensions. |
◆ operator[]() [1/2]
Gets the coordinate value at the specified index.
- Parameters
-
index | the dimension of the point to get the coordinate for. X is the first, y is the second and so on. |
- Returns
- the coordinate of the point in the specified dimension.
◆ operator[]() [2/2]
Gets the coordinate value at the specified index.
- Parameters
-
index | the dimension of the point to get the coordinate for. X is the first, y is the second and so on. |
- Returns
- the coordinate of the point in the specified dimension.
The documentation for this class was generated from the following file:
- /home/nick/Documents/repos/repast.hpc/src/repast_hpc/Point.h