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++)
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++)
129 for (
size_t j = 0 ; j < dim ; j++)
143 for(
size_t i = 0; i < dim ; i++)
145 for (
size_t j = 0 ; j < dim ; j++)
165 for (
size_t i = 0 ; i < dim ; i++)
167 for (
size_t j = 0 ; j < dim ; j++)
170 ret.
get(i,j) = (i == j)?1:0;
181 static const unsigned int dims = dim;
T get(size_t i, size_t j) const
Get coordinate.
void zero()
Set to zero the point coordinate.
T & get(size_t i, size_t j)
Get coordinate.
boost::fusion::vector< T[dim][dim]> type
boost fusion that store the point
static const unsigned int max_prop
1 property
Matrix(const Matrix< dim, T > &p)
Point constructor from point.
Matrix()
Default contructor.
static const unsigned int dims
dimension of the matrix (it is a square matrix)
This class implement an NxN (dense) matrix.
Matrix< dim, T > & operator=(const Matrix< dim, T > &m)
operator= between Matrix
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