12 #include <boost/fusion/sequence/intrinsic/at_c.hpp>
13 #include <boost/fusion/include/at_c.hpp>
14 #include <boost/fusion/container/vector.hpp>
15 #include <boost/fusion/include/vector.hpp>
16 #include <boost/fusion/container/vector/vector_fwd.hpp>
17 #include <boost/fusion/include/vector_fwd.hpp>
18 #include "boost/multi_array.hpp"
19 #include "Grid/grid_key.hpp"
32 template<
unsigned int dim ,
typename T>
class Matrix
39 typedef boost::fusion::vector<T[dim][dim]>
type;
45 static const unsigned int mat = 0;
55 inline T
get(
size_t i,
size_t j)
const
57 return boost::fusion::at_c<mat>(
data)[i][j];
68 inline T&
get(
size_t i,
size_t j)
70 return boost::fusion::at_c<mat>(
data)[i][j];
80 for (
size_t i = 0 ; i < dim ; i++)
82 for (
size_t j = 0 ; j < dim ; j++)
83 get(i,j) = m.
get(i,j);
95 for (
size_t i = 0 ; i < dim ; i++)
97 for (
size_t j = 0 ; j < dim ; j++)
111 for(
size_t i = 0; i < dim ; i++)
113 for (
size_t j = 0 ; j < dim ; j++)
115 get(i,j) = p.get(i,j);
127 for(
size_t i = 0; i < dim ; i++)
138 for(
size_t i = 0; i < dim ; i++)
149 for(
size_t i = 0 ; i < dim ; i++)
178 for (
size_t i = 0 ; i < dim ; i++)
180 for (
size_t j = 0 ; j < dim ; j++)
182 ret.
get(i,j) = (i == j)?1:0;
189 static const unsigned int max_prop = 1;
190 static const unsigned int dims = dim;
mem_id k[dim]
structure that store all the index
grid_key_dx is the key to access any element in the grid
void zero()
Set to zero the point coordinate.
boost::fusion::vector< T[dim][dim]> type
boost fusion that store the point
Matrix(const Matrix< dim, T > &p)
Point constructor from point.
Matrix()
Default contructor.
T get(size_t i, size_t j) const
Get coordinate.
Matrix(std::initializer_list< T > p1)
Constructor from a list.
Matrix(grid_key_dx< dim > key)
Constructor from a grid_key_dx<dim>
This class implement an NxN (dense) matrix.
Matrix< dim, T > & operator=(const Matrix< dim, T > &m)
operator= between Matrix
This class is a trick to indicate the compiler a specific specialization pattern. ...
Matrix(const Matrix< dim, T > &&p)
Point constructor from point.
static Matrix< dim, T > identity()
Identity matrix.
static const unsigned int mat
Property id of the point.
Matrix(const T(&p)[dim][dim])
Constructor from an array.
type data
structure that store the data of the point