8 #ifndef OPENFPM_DATA_SRC_SPACE_SHAPE_POINT_OPERATORS_HPP_
9 #define OPENFPM_DATA_SRC_SPACE_SHAPE_POINT_OPERATORS_HPP_
11 template<
unsigned int dim ,
typename T>
class Point;
17 #define POINT_MUL_POINT 5
26 #define POINT_EXPM1 11
28 #define POINT_LOG10 13
30 #define POINT_LOG1P 15
42 #define POINT_ASINH 28
43 #define POINT_ACOSH 29
44 #define POINT_ATANH 30
47 #define POINT_TGAMMA 33
48 #define POINT_LGAMMA 34
50 #define POINT_FLOOR 36
51 #define POINT_TRUNC 37
52 #define POINT_ROUND 38
53 #define POINT_NEARBYINT 39
55 #define POINT_SUB_UNI 41
57 constexpr
unsigned int max_expr(
unsigned int dim1,
unsigned int dim2)
59 return (dim1 > dim2)?dim1:dim2;
71 template <
unsigned int op1_dim,
unsigned int op2_dim,
unsigned int op>
77 value = max_expr(op1_dim,op2_dim),
104 template <
unsigned int op1_dim,
unsigned int op2_dim>
142 template <
unsigned int r,
typename orig>
154 template <
typename orig>
158 typedef typename orig::coord_type
type;
181 static const unsigned int nvals = 1;
208 inline T
value(
const size_t k)
const
224 template <
typename orig,
typename exp1,
typename exp2,
unsigned int op>
237 template <
typename orig,
typename exp1,
typename exp2>
290 template<
typename r_type=
typename std::remove_reference<decltype(o1.value(0))>::type >
inline r_type
value(
size_t k)
const
292 return o1.value(k) + o2.value(k);
299 template<typename T, typename test=typename boost::disable_if_c< std::is_same<T,orig>::value || exp1::nvals != 1 || exp2::nvals != 1 >::type >
inline operator T()
const
302 return o1.value(0) + o2.value(0);
312 template <
typename orig,
typename exp1,
typename exp2>
365 template<
typename r_type=
typename std::remove_reference<decltype(o1.value(0))>::type >
inline r_type
value(
size_t k)
const
367 return o1.value(k) - o2.value(k);
374 template<typename T, typename test=typename boost::disable_if_c< std::is_same<T,orig>::value || exp1::nvals != 1 || exp2::nvals != 1 >::type >
operator T()
const
377 return o1.value(0) - o2.value(0);
388 template <
typename orig,
typename exp1,
typename exp2>
395 mutable typename orig::coord_type
scal;
412 static const unsigned int nvals = exp1::nvals;
436 template<
typename r_type=
typename std::remove_reference<decltype(o1.value(0))>::type >
inline r_type
value(
size_t k)
const
438 return -(o1.value(k));
442 template <typename T, typename check = typename std::enable_if<!std::is_same<T,orig>::value >::type >
operator T()
const
445 return -(o1.value(0));
458 template <
typename orig,
typename exp1,
typename exp2>
467 mutable typename std::remove_const<typename orig::coord_type>::type
scal;
484 static const unsigned int nvals = 1;
493 :o1(o1),o2(o2),scal(0.0)
506 for (
size_t i = 0 ; i < orig::dims ; i++)
507 scal += o1.value(i) * o2.value(i);
517 template<
typename r_type=
typename std::remove_reference<decltype(o1.value(0))>::type >
inline r_type
value(
size_t k)
const
523 template<typename T, typename test=typename boost::disable_if_c< std::is_same<T,orig>::value >::type >
operator T()
const
538 template <
typename orig,
typename exp1,
typename exp2>
589 template<
typename r_type=
typename std::remove_reference<decltype(o1.value(0))>::type >
inline r_type
value(
size_t k)
const
591 return o1.value(k) * o2.value(k);
598 template<typename T, typename test=typename boost::disable_if_c< std::is_same<T,orig>::value || exp1::nvals != 1 || exp2::nvals != 1 >::type >
operator T()
const
601 return o1.value(0) * o2.value(0);
612 template <
typename orig,
typename exp1,
typename exp2>
665 template<
typename r_type=
typename std::remove_reference<decltype(o1.value(0))>::type >
inline r_type
value(
size_t k)
const
667 return o1.value(k) / o2.value(k);
675 template<typename T, typename test=typename boost::disable_if_c< std::is_same<T,orig>::value || exp1::nvals != 1 || exp2::nvals != 1 >::type >
operator T()
const
678 return o1.value(0) / o2.value(0);
711 #define CREATE_POINT_OPERATOR(operator_name,OP_ID) \
714 template<unsigned int dim, typename T>\
715 inline point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<const T[dim]>,OP_ID>\
716 operator_name(const Point<dim,T> & va, const point_expression<const T[(unsigned int)dim]> & vb)\
718 point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<const T[dim]>,OP_ID> exp_sum(va,vb);\
723 template<unsigned int dim, typename T>\
724 inline point_expression_op<Point<dim,T>,point_expression<const T[dim]>,Point<dim,T>,OP_ID>\
725 operator_name(const point_expression<const T[(unsigned int)dim]> & va, const Point<dim,T> & vb)\
727 point_expression_op<Point<dim,T>,point_expression<const T[dim]>,Point<dim,T>,OP_ID> exp_sum(va,vb);\
732 template<unsigned int dim, typename T>\
733 inline point_expression_op<Point<dim,T>,point_expression<const T[dim]>,point_expression<double>,OP_ID>\
734 operator_name(const point_expression<const T[dim]> & va, double d)\
736 point_expression_op<Point<dim,T>,point_expression<const T[dim]>,point_expression<double>,OP_ID> exp_sum(va,point_expression<double>(d));\
741 template<unsigned int dim, typename T>\
742 inline point_expression_op<Point<dim,T>,point_expression<double>,point_expression<const T[dim]>,OP_ID>\
743 operator_name(double d, const point_expression<const T[dim]> & va)\
745 point_expression_op<Point<dim,T>,point_expression<double>,point_expression<const T[dim]>,OP_ID> exp_sum(point_expression<double>(d),va);\
750 template<unsigned int dim, typename T>\
751 inline point_expression_op<Point<dim,T>,point_expression<const T[dim]>,point_expression<const T[dim]>,OP_ID>\
752 operator_name(const point_expression<const T[dim]> & va, const point_expression<const T[dim]> & vb)\
754 point_expression_op<Point<dim,T>,point_expression<const T[dim]>,point_expression<const T[dim]>,OP_ID> exp_sum(va,vb);\
759 template<unsigned int dim, typename T>\
760 inline point_expression_op<Point<dim,T>,point_expression<const T[dim]>,point_expression<T[dim]>,OP_ID>\
761 operator_name(const point_expression<const T[dim]> & va, const point_expression<T[dim]> & vb)\
763 point_expression_op<Point<dim,T>,point_expression<const T[dim]>,point_expression<T[dim]>,OP_ID> exp_sum(va,vb);\
768 template<unsigned int dim, typename T>\
769 inline point_expression_op<Point<dim,T>,point_expression<T[dim]>,point_expression<const T[dim]>,OP_ID>\
770 operator_name(const point_expression<T[dim]> & va, const point_expression<const T[dim]> & vb)\
772 point_expression_op<Point<dim,T>,point_expression<T[dim]>,point_expression<const T[dim]>,OP_ID> exp_sum(va,vb);\
777 template<typename orig, typename exp1 , typename exp2, unsigned int op1, unsigned int dim, typename T>\
778 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T[dim]>,OP_ID>\
779 operator_name(const point_expression_op<orig,exp1,exp2,op1> & va, const point_expression<T[dim]> & vb)\
781 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T[dim]>,OP_ID> exp_sum(va,vb);\
786 template<typename orig, typename exp1 , typename exp2, unsigned int op1, unsigned int dim, typename T>\
787 inline point_expression_op<orig,point_expression<T[dim]>,point_expression_op<orig,exp1,exp2,op1>,OP_ID>\
788 operator_name(const point_expression<T[dim]> & va, const point_expression_op<orig,exp1,exp2,op1> & vb)\
790 point_expression_op<orig,point_expression<T[dim]>,point_expression_op<orig,exp1,exp2,op1>,OP_ID> exp_sum(va,vb);\
796 template<unsigned int dim, typename T>\
797 inline point_expression_op<Point<dim,T>,Point<dim,T>,Point<dim,T>,OP_ID>\
798 operator_name(const Point<dim,T> & va, const Point<dim,T> & vb)\
800 point_expression_op<Point<dim,T>,Point<dim,T>,Point<dim,T>,OP_ID> exp_sum(va,vb);\
805 template<typename orig, typename exp1 , typename exp2, unsigned int op1, unsigned int dim, typename T>\
806 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,Point<dim,T>,OP_ID>\
807 operator_name(const point_expression_op<orig,exp1,exp2,op1> & va, const Point<dim,T> & vb)\
809 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,Point<dim,T>,OP_ID> exp_sum(va,vb);\
814 template<typename orig,typename exp1 , typename exp2, unsigned int op1, unsigned int dim, typename T>\
815 inline point_expression_op<Point<dim,T>,Point<dim,T>,point_expression_op<orig,exp1,exp2,op1>,OP_ID>\
816 operator_name(const Point<dim,T> & va, const point_expression_op<orig,exp1,exp2,op1> & vb)\
818 point_expression_op<Point<dim,T>,Point<dim,T>,point_expression_op<orig,exp1,exp2,op1>,OP_ID> exp_sum(va,vb);\
823 template<typename orig, typename exp1 , typename exp2, unsigned int op1, typename T>\
824 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T>,OP_ID>\
825 operator_name(const point_expression_op<orig,exp1,exp2,op1> & va, T d)\
827 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T>,OP_ID> exp_sum(va,d);\
832 template<typename orig,typename exp1 , typename exp2, unsigned int op1, typename T>\
833 inline point_expression_op<orig,point_expression<T>,point_expression_op<orig,exp1,exp2,op1>,OP_ID>\
834 operator_name(T d, const point_expression_op<orig,exp1,exp2,op1> & vb)\
836 point_expression_op<orig,point_expression<T>,point_expression_op<orig,exp1,exp2,op1>,OP_ID> exp_sum(d,vb);\
841 template<typename orig,typename exp1 , typename exp2, unsigned int op1, typename exp3 , typename exp4, unsigned int op2>\
842 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression_op<orig,exp3,exp4,op2>,OP_ID>\
843 operator_name(const point_expression_op<orig,exp1,exp2,op1> & va, const point_expression_op<orig,exp3,exp4,op2> & vb)\
845 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression_op<orig,exp3,exp4,op2>,OP_ID> exp_sum(va,vb);\
850 template<unsigned int dim , typename T, typename check=typename std::enable_if< !std::is_same<T,double>::value >::type >\
851 inline point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<T>,OP_ID>\
852 operator_name(const Point<dim,T> & va, T d)\
854 point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<T>,OP_ID> exp_sum(va,point_expression<T>(d));\
859 template<unsigned int dim , typename T>\
860 inline point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<double>,OP_ID>\
861 operator_name(const Point<dim,T> & va, double d)\
863 point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<double>,OP_ID> exp_sum(va,point_expression<double>(d));\
868 template<unsigned int dim , typename T, typename check=typename std::enable_if< !std::is_same<T,double>::value >::type >\
869 inline point_expression_op<Point<dim,T>,point_expression<T>,Point<dim,T>,OP_ID>\
870 operator_name(T d, const Point<dim,T> & vb)\
872 point_expression_op<Point<dim,T>,point_expression<T>,Point<dim,T>,OP_ID> exp_sum(point_expression<T>(d),vb);\
877 template<unsigned int dim, typename T, typename check=typename std::enable_if< !std::is_same<T,double>::value >::type>\
878 inline point_expression_op<Point<dim,T>,point_expression<T[dim]>,Point<dim,T>,OP_ID>\
879 operator_name(T (& d)[dim], const Point<dim,T> & vb)\
881 point_expression_op<Point<dim,T>,point_expression<T[dim]>,Point<dim,T>,OP_ID> exp_sum(point_expression<T[dim]>(d),vb);\
886 template<unsigned int dim , typename T>\
887 inline point_expression_op<Point<dim,T>,point_expression<double>,Point<dim,T>,OP_ID>\
888 operator_name(double d, const Point<dim,T> & vb)\
890 point_expression_op<Point<dim,T>,point_expression<double>,Point<dim,T>,OP_ID> exp_sum(point_expression<double>(d),vb);\
895 template<typename orig, typename exp1 , typename exp2, unsigned int op1, typename T, typename check=typename std::enable_if< !std::is_same<T,double>::value >::type >\
896 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T>,OP_ID>\
897 operator_name(const point_expression_op<orig,exp1,exp2,op1> & va, T d)\
899 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T>,OP_ID> exp_sum(va,point_expression<T>(d));\
904 template<typename orig, typename exp1 , typename exp2, unsigned int op1, typename T>\
905 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<double>,OP_ID>\
906 operator_name(const point_expression_op<orig,exp1,exp2,op1> & va, double d)\
908 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<double>,OP_ID> exp_sum(va,point_expression<double>(d));\
914 CREATE_POINT_OPERATOR(
operator+,POINT_SUM)
915 CREATE_POINT_OPERATOR(operator-,POINT_SUB)
916 CREATE_POINT_OPERATOR(operator/,POINT_DIV)
926 template<typename orig, typename exp1 , typename exp2,
unsigned int op1, typename T, typename check=typename std::enable_if< ! std::is_same<T,orig>::value >::type >
946 template<
typename orig,
typename exp1 ,
typename exp2,
unsigned int op1,
typename T>
964 template<
typename orig,
typename exp1,
typename exp2,
unsigned int op1>
968 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,void,POINT_SUB_UNI> exp_sum(va);
980 template<
unsigned int dim,
typename T>
982 operator-(
const Point<dim,T> & va)
984 point_expression_op<Point<dim,T>,Point<dim,T>,void,POINT_SUB_UNI> exp_sum(va);
994 template<
unsigned int dim,
typename T>
998 point_expression_op<Point<dim,T>,point_expression<T[dim]>,point_expression<double>,POINT_MUL> exp_sum(va,point_expression<double>(d));
1003 template<
unsigned int dim,
typename T>
1004 inline point_expression_op<Point<dim,T>,point_expression<double>,point_expression<T[dim]>,POINT_MUL>
1007 point_expression_op<Point<dim,T>,point_expression<double>,point_expression<T[dim]>,POINT_MUL> exp_sum(point_expression<double>(d),va);
1012 template<
unsigned int dim,
typename T>
1013 inline point_expression_op<Point<dim,T>,point_expression<T[dim]>,point_expression<T[dim]>,POINT_MUL_POINT>
1016 point_expression_op<Point<dim,T>,point_expression<T[dim]>,point_expression<T[dim]>,POINT_MUL_POINT> exp_sum(va,vb);
1021 template<unsigned int dim, typename T, typename check=typename std::enable_if< !std::is_same<T,double>::value >::type>
1023 operator*(T d,
const Point<dim,T> & vb)
1025 point_expression_op<Point<dim,T>,point_expression<T>,Point<dim,T>,POINT_MUL> exp_sum(point_expression<T>(d),vb);
1030 template<
typename orig,
typename exp1 ,
typename exp2,
unsigned int op1,
unsigned int dim,
typename T>
1031 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T[dim]>,POINT_MUL_POINT>
1034 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T[dim]>,POINT_MUL_POINT> exp_sum(va,vb);
1039 template<
typename orig,
typename exp1 ,
typename exp2,
unsigned int op1,
unsigned int dim,
typename T>
1041 operator*(
const point_expression<T[dim]> & va,
const point_expression_op<orig,exp1,exp2,op1> & vb)
1043 point_expression_op<orig,point_expression<T[dim]>,point_expression_op<orig,exp1,exp2,op1>,POINT_MUL_POINT> exp_sum(va,vb);
1056 template<
unsigned int dim,
typename T>
1057 inline point_expression_op<Point<dim,T>,point_expression<double>,Point<dim,T>,POINT_MUL>
1058 operator*(
double d,
const Point<dim,T> & vb)
1060 point_expression_op<Point<dim,T>,point_expression<double>,Point<dim,T>,POINT_MUL> exp_sum(point_expression<double>(d),vb);
1073 template<unsigned int dim, typename T, typename check=typename std::enable_if< !std::is_same<T,double>::value >::type >
1074 inline point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<T>,POINT_MUL>
1075 operator*(
const Point<dim,T> & va, T d)
1077 point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<T>,POINT_MUL> exp_sum(va,point_expression<T>(d));
1090 template<
unsigned int dim,
typename T>
1091 inline point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<double>,POINT_MUL>
1092 operator*(
const Point<dim,T> & va,
double d)
1094 point_expression_op<Point<dim,T>,Point<dim,T>,point_expression<double>,POINT_MUL> exp_sum(va,point_expression<double>(d));
1107 template<
unsigned int dim,
typename T>
1108 inline point_expression_op<Point<dim,T>,Point<dim,T>,Point<dim,T>,POINT_MUL_POINT>
1109 operator*(
const Point<dim,T> & va,
const Point<dim,T> & vb)
1111 point_expression_op<Point<dim,T>,Point<dim,T>,Point<dim,T>,POINT_MUL_POINT> exp_sum(va,vb);
1124 template<
typename orig,
1130 typename sfinae =
typename std::enable_if<point_expression_op<orig,exp1,exp2,op1>::nvals != 1>::type >
1132 operator*(
const Point<dim,T> & va,
const point_expression_op<orig,exp1,exp2,op1> & vb)
1134 point_expression_op<orig,Point<dim,T>,point_expression_op<orig,exp1,exp2,op1>,POINT_MUL_POINT> exp_sum(va,vb);
1147 template<
typename orig,
1153 typename sfinae =
typename std::enable_if<point_expression_op<orig,exp1,exp2,op1>::nvals == 1>::type >
1154 inline point_expression_op<orig,Point<dim,T>,point_expression_op<orig,exp1,exp2,op1>,POINT_MUL>
1155 operator*(
const Point<dim,T> & va,
const point_expression_op<orig,exp1,exp2,op1> & vb)
1157 point_expression_op<orig,Point<dim,T>,point_expression_op<orig,exp1,exp2,op1>,POINT_MUL> exp_sum(va,vb);
1170 template<
typename orig,
1176 typename sfinae =
typename std::enable_if<point_expression_op<orig,exp1,exp2,op1>::nvals != 1>::type >
1177 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,Point<dim,T>,POINT_MUL_POINT>
1178 operator*(
const point_expression_op<orig,exp1,exp2,op1> & va,
const Point<dim,T> & vb)
1180 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,Point<dim,T>,POINT_MUL_POINT> exp_sum(va,vb);
1193 template<
typename orig,
1199 typename check =
typename std::enable_if<point_expression_op<orig,exp1,exp2,op1>::nvals == 1>::type >
1200 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,Point<dim,T>,POINT_MUL>
1201 operator*(
const point_expression_op<orig,exp1,exp2,op1> & va,
const Point<dim,T> & vb)
1203 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,Point<dim,T>,POINT_MUL> exp_sum(va,vb);
1216 template<
typename orig,
typename T,
typename exp1,
typename exp2,
unsigned int op1>
1218 operator*(T d,
const point_expression_op<orig,exp1,exp2,op1> & vb)
1220 point_expression_op<orig,point_expression<T>,point_expression_op<orig,exp1,exp2,op1>,POINT_MUL> exp_sum(point_expression<T>(d),vb);
1234 template<
typename orig,
typename exp1,
typename exp2,
unsigned int op1,
typename T>
1235 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T>,POINT_MUL>
1236 operator*(
const point_expression_op<orig,exp1,exp2,op1> & va, T d)
1238 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression<T>,POINT_MUL> exp_sum(va,point_expression<T>(d));
1252 template<
typename orig,
1261 operator*(
const point_expression_op<orig,exp1,exp2,op1> & va,
const point_expression_op<orig,exp3,exp4,op2> & vb)
1263 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression_op<orig,exp3,exp4,op2>,POINT_MUL_POINT> exp_sum(va,vb);
1276 template<
typename orig,
1284 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression_op<orig,exp3,exp4,op2>,POINT_MUL>
1285 operator*(
const point_expression_op<orig,exp1,exp2,op1> & va,
const point_expression_op<orig,exp3,exp4,op2> & vb)
1287 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression_op<orig,exp3,exp4,op2>,POINT_MUL> exp_sum(va,vb);
1302 template<
unsigned int dim,
typename T>
1303 inline point_expression_op<Point<dim,T>,Point<dim,T>,Point<dim,T>,POINT_MUL>
1304 pmul(
const Point<dim,T> & va,
const Point<dim,T> & vb)
1306 point_expression_op<Point<dim,T>,Point<dim,T>,Point<dim,T>,POINT_MUL> exp_sum(va,vb);
1319 template<
typename orig,
unsigned int dim,
typename T,
typename exp1,
typename exp2,
unsigned int op1>
1320 inline point_expression_op<orig,Point<dim,T>,point_expression_op<orig,exp1,exp2,op1>,POINT_MUL>
1321 pmul(
const Point<dim,T> & va,
const point_expression_op<orig,exp1,exp2,op1> & vb)
1323 point_expression_op<orig,Point<dim,T>,point_expression_op<orig,exp1,exp2,op1>,POINT_MUL> exp_sum(va,vb);
1336 template<
typename orig,
unsigned int dim,
typename T,
typename exp1,
typename exp2,
unsigned int op1>
1337 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,Point<dim,T>,POINT_MUL>
1338 pmul(
const point_expression_op<orig,exp1,exp2,op1> & va,
const Point<dim,T> & vb)
1340 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,Point<dim,T>,POINT_MUL> exp_sum(va,vb);
1353 template<
typename orig,
typename exp1,
typename exp2,
unsigned int op1,
typename exp3 ,
typename exp4,
unsigned int op2>
1354 inline point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression_op<orig,exp3,exp4,op2>,POINT_MUL>
1355 pmul(
const point_expression_op<orig,exp1,exp2,op1> & va,
const point_expression_op<orig,exp3,exp4,op2> & vb)
1357 point_expression_op<orig,point_expression_op<orig,exp1,exp2,op1>,point_expression_op<orig,exp3,exp4,op2>,POINT_MUL> exp_sum(va,vb);
1369 template<
typename T,
unsigned int dim>
1412 for (
size_t i = 0; i < dim ; i++)
1413 d[i] = p_exp.value(i);
1449 template<
typename T,
unsigned int dim>
1500 #include "Point_operators_functions.hpp"
void init() const
This function must be called before value.
int has_init
indicate that init must be called before value
int is_expression
indicate that this class encapsulate an expression
point_expression_op(const exp1 &o1, const exp2 &o2)
constructor from 2 expressions
T value(const size_t k) const
Evaluate the expression.
r_type value(size_t k) const
Evaluate the expression.
point_expression_op(const exp1 &o1, const exp2 &o2)
constructor from expression 1 and expression 2
orig orig_type
original type
r_type value(size_t k) const
Evaluate the expression.
It return the dimansionality of the operation given the dimensionality of the 2 operators.
Specialization for an array of dimension dim as expression.
orig orig_type
origin type
int has_init
indicate that init must be called before value
point_expression_op(const exp1 &o1, const exp2 &o2)
Constructor from 2 point expressions.
int has_init
indicate that init must be called before value
int has_init
indicate that this class has an init function
orig::coord_type return_type
return type of the expression
point_expression(T &d)
constructor from a value
point_expression(const T(&d)[dim])
construct from an array of dimension dim
void init() const
This function must be called before value.
orig orig_type
Original type.
orig orig_type
original type
void init() const
This function must be called before value.
Unknown operation specialization.
orig::coord_type scal
scalar value produced by the expression
std::remove_const< typename orig::coord_type >::type scal
the expression produce a scalar
int has_init
indicate that init must be called before value
This class implement the point shape in an N-dimensional space.
Main class that encapsulate a constant number used in a point expression.
orig::coord_type type
meta-function return a scalar or the expression produce a scalar
point_expression_op(const exp1 &o1, const exp2 &o2)
constructor from 2 expression
const exp2 o2
expression 2
const exp1 o1
first expression
const exp1 o1
expression 1
point_expression< T[dim]> & operator=(const point_expression_op< orig, exp1, exp2, op > &p_exp)
Operator= for point expression.
int is_expression
indicate that this class encapsulate an expression
int has_init
indicate that init must be called before value
const exp1 o1
expression 1
int is_expression
indicate that this class encapsulate an expression
point_expression_op(const exp1 &o1, const exp2 &o2)
constructor from 2 expressions
static const unsigned int nvals
this operation produce a vector as result of size dims
orig return_type
return type of the expression
Return type of the expression.
void init() const
This function must be called before value.
r_type value(size_t k) const
Evaluate the expression.
void init() const
This function must be called before value.
int is_expression
indicate that is an expression
orig::coord_type return_type
return type of the expression evaluation
void init() const
initialize the the expression
r_type value(size_t k) const
evaluate the expression
void init() const
This function must be called before value.
int is_expression
indicate that this class encapsulate an expression
int is_expression
indicate that this class encapsulate an expression
orig orig_type
base type of the expression
Specialization for a const array of dimension dim.
int is_expression
indicate that this class encapsulate an expression
const exp1 o1
expression 1
r_type_p< r_type_dim< exp1::nvals, exp2::nvals, POINT_SUM >::value, orig >::type return_type
return type of the expression
void init() const
This function must be called before value.
orig return_type
return type of the expression
point_expression(T(&d)[dim])
constructor from an array
int has_init
indicate that init must be called before value
T value(const size_t k) const
Evaluate the expression at coordinate k.
r_type value(size_t k) const
Evaluate the expression at coordinate k.
r_type value(size_t k) const
Evaluate the expression at coordinate k.
const exp1 o1
first expression
const exp2 o2
expression 2
orig orig_type
original type of the point expression
const exp2 o2
second expression
int has_init
indicate that init must be called before value
orig return_type
return type of the expression
T value(const size_t k) const
Evaluate the expression at coordinate k.
const exp2 o2
second expression
int is_expression
indicate that this class encapsulate an expression
int has_init
indicate that init must be called before value
int is_expression
indicate that this class encapsulate an expression
const exp2 o2
expression 2
orig type
meta-function return orig or the expression produce a vector
void init() const
This function must be called before value.
point_expression_op(const exp1 &o1)