4 #include "Grid/comb.hpp"
5 #include "Grid/grid_key_expression.hpp"
6 #include "Space/Shape/Point.hpp"
17 template<
unsigned int dim>
25 for (
size_t i = 0 ; i < dim ; i++)
26 this->
k[i] = exp.value(i);
42 for (
size_t i = 0 ; i < dim ; i++)
49 for (
size_t i = 0 ; i < dim ; i++)
56 for (
size_t i = 0 ; i < dim ; i++)
61 template<
typename ...T>
inline grid_key_dx(
const size_t v,
const T...t)
64 if (
sizeof...(t) != dim -1)
65 std::cerr <<
"Error grid_key: " << __FILE__ <<
" " << __LINE__ <<
"creating a key of dimension " << dim <<
" require " << dim <<
" numbers " <<
sizeof...(t) + 1 <<
" provided" <<
"\n";
76 for (
size_t i = 0 ; i < dim ; i++)
85 for (
size_t i = 0 ; i < dim ; i++)
94 for (
size_t i = 0 ; i < dim ; i++)
107 for (
size_t i = 0 ; i < dim ; i++)
122 for (
size_t i = 0 ; i < dim ; i++)
214 for (
size_t i = 0 ; i < dim ; i++)
216 if (
k[i] != key_t.
k[i])
227 template<
typename a,
typename ...T>
void set(a v, T...t)
230 if (
sizeof...(t) != dim -1)
231 std::cerr <<
"Error grid_key: " << __FILE__ <<
" " << __LINE__ <<
"setting a key of dimension " << dim <<
" require " << dim <<
" numbers " <<
sizeof...(t) + 1 <<
" provided" <<
"\n";
246 for (
size_t i = 0; i < dim ; i++)
273 for (
size_t i = 0; i < dim ; i++)
302 mem_id
get(
size_t i)
const
320 std::cerr <<
"grid_key_dx error: " << __FILE__ <<
" " << __LINE__ <<
" try to access dimension " << i <<
" on a grid_key_dx of size " << dim <<
"\n";
342 template<
typename a,
typename ...T>
void invert_assign(a v)
363 template<
unsigned int dim,
unsigned int p>
369 template<
typename a,
typename ...T>
grid_key_d(a v,T...t)
375 template<
typename a,
typename ...T>
void invert_assign(a v,T...t)
381 template<
typename a,
typename ...T>
void invert_assign(a v)
Main class that encapsulate a sub expression.
mem_id value(size_t i) const
Get the i index.
mem_id k[dim]
structure that store all the index
grid_key_dx(const size_t(&k)[dim])
Constructor from buffer reference.
grid_key_dx(const grid_key_dx< dim > &key)
Constructor from an other key.
grid_key_dx(const size_t v, const T...t)
Construct a grid key from a list of numbers.
grid_key_dx is the key to access any element in the grid
Position of the element of dimension d in the hyper-cube of dimension dim.
grid_key_dx(const long int(&k)[dim])
Constructor from buffer reference.
std::string to_string()
convert the information into a string
This class implement the point shape in an N-dimensional space.
Point< dim, size_t > toPoint() const
Convert to a point the grid_key_dx.
grid_key_dx()
Constructor.
Point< dim, long int > toPointS() const
Convert to a point the grid_key_dx.
Expression template for grid_key_dx.
T get(int i) const
Get coordinate.
grid_key_dx(const comb< dim > &cmb)
Construct a grid key from a list of numbers.
This class is a trick to indicate the compiler a specific specialization pattern. ...
void invert_assign(a v, T...t)
Recursively invert the assignment.
void set(a v, T...t)
set the grid key from a list of numbers
grid_key_d is the key to access any element in the grid
void set_d(size_t i, mem_id id)
Set the i index.
Main class that encapsulate a sum expression.