![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Data structure for a grid of points and their mapping onto a scalar field. More...
#include <Grid.hh>
Public Member Functions | |
| Grid () | |
| Default constructor, initilizes everything to 0. More... | |
| Grid (const std::vector< Vertex > &vertices) | |
| Vertex constructor, constructs the grid from a vertex vector. More... | |
| Grid (const Matrix< double > &mat, const std::vector< double > &vec) | |
| Matrix constructor, sets matrix of vertices and their mapping on a grid. More... | |
| Grid (double(*fcn)(const std::vector< double > &val), const std::vector< size_t > &number, const std::vector< double > &lower, const std::vector< double > &upper) | |
| Function constructor, constructs the grid from a function. More... | |
| Grid (const std::vector< size_t > &number, const std::vector< double > &lower, const std::vector< double > &upper, const std::string algo="flat") | |
| Random constructor, constructs an N_1*...*N_n random grid between lower and upper. More... | |
| Grid (const Grid &grid) | |
| Copy constructor. More... | |
| Grid & | operator= (const Grid &grid) |
| Equality operator. More... | |
| bool | operator! () const |
| Not operator. More... | |
| Vertex & | operator[] (const size_t id) |
| Returns the vertex. More... | |
| const Vertex & | operator[] (const size_t id) const |
| Returns the vertex. More... | |
| Vertex & | operator[] (const std::vector< size_t > indices) |
| Subscript operator. More... | |
| const Vertex & | operator[] (const std::vector< size_t > indices) const |
| Subscript operator. More... | |
| ~Grid () | |
| Destructor. More... | |
| const size_t | size () const |
| Returns the dimension of the vector field in which the vertex is defined. More... | |
| void | Initialize () |
| Initializes the grid. More... | |
| void | InitializeFromMatrix (const Matrix< double > &mat, const std::vector< double > &vec) |
| Initializes the grid, provided a matrix of vertices and their mapping. More... | |
| void | InitializeFromFunction (double(*fcn)(const std::vector< double > &val)) |
| Initializes the grid, provided a scalar function defined within boundaries. More... | |
| void | InitializeRandom (const std::string &algo) |
| Initializes the grid to random values of scalar field. More... | |
| Grid | GetBestCell (const std::vector< double > &v) const |
| Find the closest cell of the grid to a given point of coordinates v. More... | |
| std::vector< size_t > | GetLowerIndices (const std::vector< double > &v) const |
| Find the IDs of the points on the grid that directly preceed v. More... | |
| Grid | GetCell (const std::vector< size_t > &indices) const |
| Returns a cell of the grid given the lower bound indicies. More... | |
| std::vector< Grid > | GetCellArray () const |
| Returns all the cells of the grid in an array. More... | |
| double | GetCellVolume () const |
| Returns the volume of one of the cell of the grid. More... | |
| const size_t & | GetDimension () const |
| Returns the dimension of the space in which the grid is constructed. More... | |
| const std::vector< size_t > & | GetNpointsArray () const |
| Returns the array of number of points in each dimension. More... | |
| const size_t & | GetNpoints (const size_t i) const |
| Returns the number of points in dimension i. More... | |
| const std::vector< size_t > & | GetStepArray () const |
| Returns the array of step sizes in each dimension. More... | |
| const size_t & | GetStep (const size_t i) const |
| Returns the step size in dimension i. More... | |
| const std::vector< double > & | GetPeriodArray () const |
| Returns the array of period size in each dimension. More... | |
| const double & | GetPeriod (const size_t i) const |
| Returns the period size in dimension i. More... | |
| const std::vector< double > & | GetLowerBoundArray () const |
| Returns the array of lower bounds in each dimension. More... | |
| const double & | GetLowerBound (const size_t i) const |
| Returns the lower bound in dimension i. More... | |
| const std::vector< double > & | GetUpperBoundArray () const |
| Returns the array of upper bounds in each dimension. More... | |
| const double & | GetUpperBound (const size_t i) const |
| Returns the upper bound in dimension i. More... | |
| void | SetVertex (const std::vector< size_t > &indices, const Vertex &vertex) |
| Sets the coordinates of the vertex. More... | |
| const std::vector< Vertex > & | GetVertexArray () const |
| Returns the array of all the vertices. More... | |
| std::vector< Vertex > & | GetVertexArray () |
| Returns the array of all the vertices, allows modifications. More... | |
| const std::vector< double > & | GetPositionArray (const size_t id) const |
| Returns the position of a point of index id. More... | |
| double | GetPosition (const size_t i, const size_t id) const |
| Returns the position in dimension i for a point index id in this dimension. More... | |
| std::vector< double > | GetPosition (const std::vector< size_t > &vi, const std::vector< size_t > &ids) const |
| Returns the position in dimensions vi for a point index ids in these dimension. More... | |
| double | GetVolume () const |
| Returns the volume occupied by the grid. More... | |
| size_t | ID (const std::vector< size_t > &indices) const |
| Returns the id of the element within the vertex matrix. More... | |
| std::vector< size_t > | Indices (size_t id) const |
| Returns the indices of the element within the vertex matrix. More... | |
| bool | IsInside (const std::vector< double > &v) const |
| Returns the indices of the element within the vertex matrix. More... | |
| std::vector< TPolyLine * > | Polygons () const |
| Returns an array of polygons to be drawn in ROOT (only 2D) More... | |
Private Attributes | |
| size_t | _dim |
| Dimension of the space. More... | |
| std::vector< Vertex > | _vertices |
| N_1*...*N_n-vector of vertices (Vertex object) More... | |
| std::vector< size_t > | _number |
| n-vector, number of steps on each axis More... | |
| std::vector< size_t > | _step |
| n-vector, stepping of each axis More... | |
| std::vector< double > | _period |
| n-vector, length of a period of each axis More... | |
| std::vector< double > | _lower |
| n-vector, lower bounds of the grid More... | |
| std::vector< double > | _upper |
| n-vector, upper bounds of the grid More... | |
Data structure for a grid of points and their mapping onto a scalar field.
| Grid::Grid | ( | ) |
Default constructor, initilizes everything to 0.
| Grid::Grid | ( | const std::vector< Vertex > & | vertices | ) |
Vertex constructor, constructs the grid from a vertex vector.
| vertices | Array of vertices and their mapping |
| Grid::Grid | ( | const Matrix< double > & | mat, |
| const std::vector< double > & | vec | ||
| ) |
Matrix constructor, sets matrix of vertices and their mapping on a grid.
| mat | nxN-matrix of vertices, n = dimension, N = number of vertices |
| vec | N-vector of the mapping, one per vertex, same ordering |
| Grid::Grid | ( | double(*)(const std::vector< double > &val) | fcn, |
| const std::vector< size_t > & | number, | ||
| const std::vector< double > & | lower, | ||
| const std::vector< double > & | upper | ||
| ) |
Function constructor, constructs the grid from a function.
| fcn | Function of vector field that returns a scalar field |
| number | Number of steps between min and max values |
| lower | Lower bounds of the grid in each dimension |
| upper | Upper bounds of the grid in each dimension |
| Grid::Grid | ( | const std::vector< size_t > & | number, |
| const std::vector< double > & | lower, | ||
| const std::vector< double > & | upper, | ||
| const std::string | algo = "flat" |
||
| ) |
Random constructor, constructs an N_1*...*N_n random grid between lower and upper.
| number | Number of steps between min and max values |
| lower | Lower bounds of the grid in each dimension |
| upper | Upper bounds of the grid in each dimension |
| algo | Alogrithm for random number generation |
| Grid::Grid | ( | const Grid & | grid | ) |
Copy constructor.
| Grid::~Grid | ( | ) |
Destructor.
| Grid Grid::GetBestCell | ( | const std::vector< double > & | v | ) | const |
Find the closest cell of the grid to a given point of coordinates v.
| v | Vector of coordinates of the n-point |
| Grid Grid::GetCell | ( | const std::vector< size_t > & | indices | ) | const |
Returns a cell of the grid given the lower bound indicies.
| std::vector< Grid > Grid::GetCellArray | ( | ) | const |
Returns all the cells of the grid in an array.
| double Grid::GetCellVolume | ( | ) | const |
Returns the volume of one of the cell of the grid.
|
inline |
Returns the dimension of the space in which the grid is constructed.
|
inline |
Returns the lower bound in dimension i.
|
inline |
Returns the array of lower bounds in each dimension.
| std::vector< size_t > Grid::GetLowerIndices | ( | const std::vector< double > & | v | ) | const |
Find the IDs of the points on the grid that directly preceed v.
|
inline |
Returns the number of points in dimension i.
|
inline |
Returns the array of number of points in each dimension.
|
inline |
Returns the period size in dimension i.
|
inline |
Returns the array of period size in each dimension.
| double Grid::GetPosition | ( | const size_t | i, |
| const size_t | id | ||
| ) | const |
Returns the position in dimension i for a point index id in this dimension.
| std::vector< double > Grid::GetPosition | ( | const std::vector< size_t > & | vi, |
| const std::vector< size_t > & | ids | ||
| ) | const |
Returns the position in dimensions vi for a point index ids in these dimension.
|
inline |
Returns the position of a point of index id.
|
inline |
Returns the step size in dimension i.
|
inline |
Returns the array of step sizes in each dimension.
|
inline |
Returns the upper bound in dimension i.
|
inline |
Returns the array of upper bounds in each dimension.
|
inline |
Returns the array of all the vertices.
|
inline |
Returns the array of all the vertices, allows modifications.
| double Grid::GetVolume | ( | ) | const |
Returns the volume occupied by the grid.
| size_t Grid::ID | ( | const std::vector< size_t > & | indices | ) | const |
Returns the id of the element within the vertex matrix.
| std::vector< size_t > Grid::Indices | ( | size_t | id | ) | const |
Returns the indices of the element within the vertex matrix.
| void Grid::Initialize | ( | ) |
Initializes the grid.
| void Grid::InitializeFromFunction | ( | double(*)(const std::vector< double > &val) | fcn | ) |
Initializes the grid, provided a scalar function defined within boundaries.
| fcn | Function of vector field that returns a scalar field |
| void Grid::InitializeFromMatrix | ( | const Matrix< double > & | mat, |
| const std::vector< double > & | vec | ||
| ) |
Initializes the grid, provided a matrix of vertices and their mapping.
| mat | nxN-matrix of vertices, n = dimension, N = number of vertices |
| vec | N-vector of the mapping, one per vertex, same ordering |
| void Grid::InitializeRandom | ( | const std::string & | algo | ) |
Initializes the grid to random values of scalar field.
| algo | Alogrithm for random number generation |
| bool Grid::IsInside | ( | const std::vector< double > & | v | ) | const |
Returns the indices of the element within the vertex matrix.
|
inline |
Not operator.
|
inline |
Returns the vertex.
|
inline |
Returns the vertex.
|
inline |
Subscript operator.
|
inline |
Subscript operator.
| std::vector< TPolyLine * > Grid::Polygons | ( | ) | const |
Returns an array of polygons to be drawn in ROOT (only 2D)
|
inline |
Sets the coordinates of the vertex.
|
inline |
Returns the dimension of the vector field in which the vertex is defined.
|
private |
Dimension of the space.
|
private |
n-vector, lower bounds of the grid
|
private |
n-vector, number of steps on each axis
|
private |
n-vector, length of a period of each axis
|
private |
n-vector, stepping of each axis
|
private |
n-vector, upper bounds of the grid
1.8.6