8 #ifndef OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_HPP_ 9 #define OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_HPP_ 11 #include "Vector/vector_dist.hpp" 12 #include "lib/pdata.hpp" 13 #include "cuda/vector_dist_operators_cuda.cuh" 15 #define PROP_CUSTOM (unsigned int)-2 22 #define VECT_APPLYKER_IN 7 23 #define VECT_APPLYKER_OUT 8 24 #define VECT_APPLYKER_REDUCE 9 25 #define VECT_APPLYKER_IN_GEN 10 26 #define VECT_APPLYKER_OUT_GEN 11 27 #define VECT_APPLYKER_REDUCE_GEN 12 28 #define VECT_APPLYKER_IN_SIM 13 29 #define VECT_APPLYKER_OUT_SIM 14 30 #define VECT_APPLYKER_REDUCE_SIM 15 32 #define VECT_APPLYKER_IN_GEN_SORT 16 33 #define VECT_APPLYKER_IN_SORT 17 34 #define VECT_APPLYKER_IN_SIM_SORT 18 62 #define VECT_TGAMMA 83 63 #define VECT_LGAMMA 84 68 #define VECT_NEARBYINT 89 71 #define VECT_SUB_UNI 92 72 #define VECT_SUM_REDUCE 93 74 #define VECT_NORM_INF 95 77 #define VECT_DCPSE 100 78 #define VECT_DCPSE_V 101 79 #define VECT_DCPSE_V_SUM 102 80 #define VECT_DCPSE_V_DOT 103 81 #define VECT_DCPSE_V_DIV 104 82 #define VECT_DCPSE_V_CURL2D 105 83 #define VECT_COPY_1_TO_N 300 84 #define VECT_COPY_N_TO_N 301 85 #define VECT_COPY_N_TO_1 302 87 #define VECT_SUB_UNI 92 92 template<
bool cond,
typename exp1,
typename exp2>
95 typedef typename exp2::vtype vtype;
97 static auto getVector(
const exp1 & o1,
const exp2 & o2) -> decltype(o2.getVector())
99 return o2.getVector();
103 template<
typename exp1,
typename exp2>
106 typedef typename exp1::vtype vtype;
108 static auto getVector(
const exp1 & o1,
const exp2 & o2) -> decltype(o1.getVector())
110 return o1.getVector();
114 template<
typename T,
typename Sfinae =
void>
127 struct has_vtype<T, typename
Void<typename T::vtype>::type> : std::true_type
142 template<
typename ObjType,
typename Sfinae =
void>
145 template<
typename ObjType>
154 template <typename T, bool has_init = has_init<T>::value >
158 static inline void call(T & r_exp)
169 template <
typename T>
173 static inline void call(T & r_exp)
186 template <
typename exp1,
typename exp2,
unsigned int op>
192 template<
typename v1_type,
typename v2_type>
195 typedef v1_type type;
197 template<
typename exp1,
typename exp2>
198 static const type & getVector(
const exp1 & o1,
const exp2 & o2)
200 return o1.getVector();
203 template<
typename exp1>
204 static const type & getVector(
const exp1 & o1)
206 return o1.getVector();
211 template<
typename v2_type>
214 typedef v2_type type;
216 template<
typename exp1,
typename exp2>
217 static const type & getVector(
const exp1 & o1,
const exp2 & o2)
219 return o2.getVector();
222 template<
typename exp2>
223 static const type & getVector(exp2 & o2)
225 return o2.getVector();
229 template<
typename NN1_type,
typename NN2_type>
232 typedef NN1_type type;
234 template<
typename exp1,
typename exp2>
235 static type * getNN(exp1 & o1, exp2 & o2)
240 template<
typename exp1>
241 static type * getNN(exp1 & o1)
248 template<
typename NN2_type>
251 typedef NN2_type type;
253 template<
typename exp1,
typename exp2>
254 static type * getNN(exp1 & o1, exp2 & o2)
259 template<
typename exp2>
260 static type * getNN(exp2 & o2)
266 template<
bool s1,
bool s2>
269 typedef boost::mpl::bool_<s1 | s2> type;
278 template <
typename exp1,
typename exp2>
296 typedef typename vector_is_sort_result<exp1::is_sort::value,exp2::is_sort::value>::type
is_sort;
299 typedef typename nn_type_result<typename exp1::NN_type,typename exp2::NN_type>::type
NN_type;
337 return o1.value(key) + o2.value(key);
340 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
341 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp)
const 343 o1.template value_nz<Sys_eqs>(p_map,key,cols,coeff, comp);
344 o2.template value_nz<Sys_eqs>(p_map,key,cols,coeff, comp);
378 template<
typename r_type=
typename std::remove_reference<decltype(o1.value(0) + o2.value(0))>::type >
379 __device__ __host__
inline r_type
value(
const unsigned int & key)
const 381 return o1.value(key) + o2.value(key);
392 template <
typename exp1,
typename exp2>
406 typedef typename exp1::is_ker is_ker;
409 typedef typename vector_is_sort_result<exp1::is_sort::value,exp2::is_sort::value>::type
is_sort;
412 typedef typename nn_type_result<typename exp1::NN_type,typename exp2::NN_type>::type
NN_type;
451 return o1.value(key) - o2.value(key);
462 __device__ __host__
inline r_type
value(
const unsigned int & key)
const 464 return o1.value(key) - o2.value(key);
491 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
492 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp)
const 494 o1.template value_nz<Sys_eqs>(p_map,key,cols,coeff,comp);
495 coeff_type tmp = -coeff;
496 o2.template value_nz<Sys_eqs>(p_map,key,cols,tmp,comp);
506 template <
typename exp1,
typename exp2>
520 typedef typename exp1::is_ker is_ker;
523 typedef typename vector_is_sort_result<exp1::is_sort::value,exp2::is_sort::value>::type
is_sort;
526 typedef typename nn_type_result<typename exp1::NN_type,typename exp2::NN_type>::type
NN_type;
554 return o1.value(key) * o2.value(key);
557 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
558 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp)
const 561 auto coeff_tmp = o1.value(key) * coeff;
562 o2.template value_nz<Sys_eqs>(p_map,key,cols,coeff_tmp,comp);
597 __device__ __host__
inline r_type
value(
const unsigned int & key)
const 599 return o1.value(key) * o2.value(key);
609 template <
typename exp1,
typename exp2>
623 typedef typename exp1::is_ker is_ker;
626 typedef typename vector_is_sort_result<exp1::is_sort::value,exp2::is_sort::value>::type
is_sort;
629 typedef typename nn_type_result<typename exp1::NN_type,typename exp2::NN_type>::type
NN_type;
667 return o1.value(key) / o2.value(key);
670 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
671 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp)
const 673 std::cout << __FILE__ <<
":" << __LINE__ <<
" You are trying to divide by an operator, this is not possible " << std::endl;
708 __device__ __host__
inline r_type
value(
const unsigned int & key)
const 710 return o1.value(key) / o2.value(key);
719 template <
typename exp1>
728 typedef typename exp1::is_ker is_ker;
731 typedef typename vector_result<typename exp1::vtype,void>::type
vtype;
734 typedef typename vector_is_sort_result<exp1::is_sort::value,false>::type
is_sort;
737 typedef typename nn_type_result<typename exp1::NN_type,void>::type
NN_type;
779 return o1.getVector();
784 template<
typename r_type=
typename std::remove_reference<decltype(-(o1.value(
vect_dist_key_dx(0))))>::type >
787 return -(o1.value(key));
790 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
791 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp)
const 793 coeff_type coeff_tmp = -coeff;
794 o1.template value_nz<Sys_eqs>(p_map,key,cols,coeff_tmp, comp);
797 template<
typename r_type=
typename std::remove_reference<decltype(-(o1.value(
vect_dist_key_dx(0))))>::type >
798 __device__ __host__
inline r_type
value(
const unsigned int & key)
const 800 return -(o1.value(key));
808 template<
int impl,
bool vect_ker>
811 typedef boost::mpl::int_<impl> type;
817 typedef boost::mpl::int_<-1> type;
823 typedef boost::mpl::int_<-1> type;
826 template<typename vector, bool is_ker = has_vector_kernel<vector>::type::value>
829 typedef vector& type;
832 template<
typename vector>
838 template<
typename vector>
856 template<
unsigned int prp,
typename vector>
878 static const unsigned int prop = prp;
882 void setVarId(
int var_id)
884 this->var_id = var_id;
1002 return this->
value(key);
1014 if (v_exp.
getVector().isSubset() ==
true)
1016 std::cout << __FILE__ <<
":" << __LINE__ <<
" error on the right hand side of the expression you have to use non-subset properties" << std::endl;
1024 ::compute_expr(
v.v,v_exp);
1030 ::compute_expr(
v.v,v_exp);
1047 ::compute_expr(
v.v,v_exp);
1059 template<
typename exp1,
typename exp2,
unsigned int op>
1062 if (v_exp.getVector().isSubset() ==
true)
1064 std::cout << __FILE__ <<
":" << __LINE__ <<
" error on the right hand side of the expression you have to use non-subset properties" << std::endl;
1074 ::compute_expr(
v.v,v_exp);
1082 ::compute_expr(
v.v,v_exp);
1103 ::compute_const(
v.v,d);
1111 ::compute_const(
v.v,d);
1118 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
1119 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp)
const 1121 cols[p_map.
template getProp<0>(key)*Sys_eqs::nvar + var_id + comp] += coeff;
1142 template<
typename T>
1153 typedef T * iterator;
1154 typedef const T * const_iterator;
1171 static const unsigned int prop = 0;
1175 void setVarId(
int var_id)
1177 this->var_id = var_id;
1182 {
return &
v.template get<0>(0); }
1184 const_iterator begin()
const 1185 {
return &
v.template get<0>(0); }
1188 {
return &
v.template get<0>(
v.size()-1)+1; }
1190 const_iterator end()
const 1191 {
return &
v.template get<0>(
v.size()-1)+1; }
1194 {
return v.size(); }
1196 void resize(
size_t n)
1225 template<
typename exp1,
typename exp2,
unsigned int op>
1282 return v.template get<0>(k.getKey());
1295 if (v_exp.
getVector().isSubset() ==
true)
1297 std::cout << __FILE__ <<
":" << __LINE__ <<
" error on the right hand side of the expression you have to use non-subset properties" << std::endl;
1307 ::compute_expr(
v,v_exp);
1313 ::compute_expr(
v,v_exp);
1327 template<
typename exp1,
typename exp2,
unsigned int op>
1330 if (v_exp.getVector().isSubset() ==
true)
1332 std::cout << __FILE__ <<
":" << __LINE__ <<
" error on the right hand side of the expression you have to use non-subset properties" << std::endl;
1336 v.resize(v_exp.getVector().size_local());
1344 ::compute_expr(
v,v_exp);
1352 ::compute_expr(
v,v_exp);
1367 std::cout << __FILE__ <<
":" << __LINE__ <<
" Error: temporal with constants is unsupported" << std::endl;
1371 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
1372 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp)
const 1374 std::cout << __FILE__ <<
":" << __LINE__ <<
" Error: use of temporal is not supported to construct equations";
1392 template<
typename vector,
unsigned int impl>
1395 typedef vector type;
1397 static vector & get(vector & v) {
return v;};
1399 template<
typename exp_type,
typename vector_klist>
1400 static void register_vector(exp_type & exp_v, vector_klist & v,
bool is_sort)
1405 template<
typename vector>
1408 typedef decltype(std::declval<vector>().toKernel()) type;
1410 static type get(vector & v) {
return v.toKernel();};
1412 template<
typename exp_type,
typename vector_klist>
1413 static void register_vector(exp_type & exp_v, vector_klist & v,
bool is_sort)
1415 exp_v.set_vector_dist_ker_list(v.private_get_vector_dist_ker_list(),is_sort);
1423 template <
typename exp1,
int n>
1433 void setVarId(
int var_id)
1435 this->var_id = var_id;
1442 typedef std::false_type is_ker;
1450 typedef typename exp1::vtype vtype;
1455 :o1(o1),var_id(var_id)
1457 for (
int i = 0 ; i < n ; i++)
1458 {this->comp[i] = comp[i];}
1470 return o1.getVector();
1482 return o1.getVector();
1493 typedef typename pos_or_propL<vtype,exp1::prop>::property_act
property_act;
1537 return this->value(key);
1540 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
1541 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp_)
const 1547 std::cout << __FILE__ <<
":" << __LINE__ <<
" Error it only work for tensore of rank 1 ... like vectors " << std::endl;
1552 o1.template value_nz<Sys_eqs>(p_map,key,cols,coeff,comp_ + var_id + comp[0]);
1559 for (
int i = 0 ; i < n ; i++)
1560 {comp_n[i] = comp[i];}
1579 auto & v = getVector();
1586 auto it = v.getDomainIterator();
1590 auto key = it.get();
1591 auto key_orig = v.getOriginKey(key);
1612 auto & v = getVector();
1616 SubsetSelector_impl<std::remove_reference<decltype(v)>::type::is_it_a_subset::value>::check(v2,v);
1618 auto it = v.getDomainIterator();
1622 auto key = it.get();
1623 auto key_orig = v.getOriginKey(key);
1642 if (v_exp.getVector().isSubset() ==
true)
1644 std::cout << __FILE__ <<
":" << __LINE__ <<
" error on the right hand side of the expression you have to use non-subset properties" << std::endl;
1645 return this->getVector();
1652 ::compute_expr_slice(o1.getVector(),v_exp,comp);
1658 ::compute_expr_slice(o1.getVector(),v_exp,comp);
1661 return this->getVector();
1673 auto & v = getVector();
1675 auto it = v.getDomainIterator();
1679 auto key = it.get();
1698 template <
unsigned int prp,
unsigned int impl = comp_host,
typename vector>
1716 template <
unsigned int prp,
typename vector>
1719 auto vk = v.toKernel_sorted();
1722 exp_v.set_vector_dist_ker_list(v.private_get_vector_dist_ker_list(),
true);
1732 template<
unsigned int prp>
1740 typedef std::false_type is_ker;
1775 template<
typename Sys_eqs,
typename pmap_type,
typename unordered_map_type,
typename coeff_type>
1776 inline void value_nz(pmap_type & p_map,
const vect_dist_key_dx & key, unordered_map_type & cols, coeff_type & coeff,
unsigned int comp)
const 1778 cols[p_map.
template getProp<0>(key)*Sys_eqs::nvar + comp] += coeff;
1789 __host__ __device__
inline double value(
const unsigned int & k)
const 1801 template<
unsigned int prp>
1809 typedef std::false_type is_ker;
1815 typedef void NN_type;
1853 __device__ __host__
inline float value(
const unsigned int & k)
const 1867 template<
unsigned int p1,
unsigned int p2,
typename v1,
typename v2>
1884 template<
typename exp1 ,
typename exp2,
unsigned int op1,
unsigned int prp1,
typename v1>
1901 template<
typename exp1 ,
typename exp2,
unsigned int op1,
unsigned int prp1,
typename v1>
1918 template<
typename exp1 ,
typename exp2,
unsigned int op1,
typename exp3 ,
typename exp4,
unsigned int op2>
1935 template<
unsigned int prp1 ,
typename v1>
1952 template<
unsigned int prp1 ,
typename v1>
1969 template<
unsigned int prp1 ,
typename v1>
1986 template<
unsigned int prp1 ,
typename v1>
2003 template<
typename exp1 ,
typename exp2,
unsigned int op1>
2020 template<
typename exp1 ,
typename exp2,
unsigned int op1>
2037 template<
unsigned int p1,
unsigned int p2,
typename v1,
typename v2>
2055 template<
typename exp1,
typename exp2,
unsigned int op1,
unsigned int p2,
typename v2>
2071 template<
typename exp1,
typename exp2_,
unsigned int op1>
2087 template<
unsigned int p1,
typename v1>
2105 template<
typename exp1,
typename exp2,
unsigned int op1,
unsigned int p2,
typename v2>
2122 template<
typename exp1,
typename exp2,
unsigned int op1,
typename exp3,
typename exp4,
unsigned int op2>
2139 template<
unsigned int prp1,
typename v1>
2156 template<
unsigned int prp1,
typename v1>
2173 template<
unsigned int prp1,
typename v1>
2190 template<
unsigned int prp1,
typename v1>
2207 template<
unsigned int p2,
typename v2>
2224 template<
unsigned int p2,
typename v2>
2241 template<
unsigned int p2,
typename v2>
2258 template<
unsigned int p2,
typename v2>
2275 template<
unsigned int p1,
typename v1,
unsigned int p2,
typename v2>
2292 template<
unsigned int p1,
typename v1,
typename exp1,
typename exp2,
unsigned int op1>
2309 template<
unsigned int p1,
typename v1,
typename exp1,
typename exp2,
unsigned int op1>
2326 template<
typename exp1,
typename exp2,
unsigned int op1,
typename exp3 ,
typename exp4,
unsigned int op2>
2343 template<
typename exp1 ,
typename exp2,
unsigned int op1>
2360 template<
typename exp1 ,
typename exp2,
unsigned int op1>
2377 template<
typename exp1 ,
typename exp2,
unsigned int op1>
2394 template<
typename exp1 ,
typename exp2,
unsigned int op1>
2411 template<
typename exp1,
typename exp2,
unsigned int op1>
2428 template<
typename exp1,
typename exp2,
unsigned int op1>
2445 template<
typename exp1,
typename exp2,
unsigned int op1>
2462 template<
typename exp1,
typename exp2,
unsigned int op1>
2479 template<
unsigned int prp1,
typename v1>
2496 template<
unsigned int prp1,
typename v1>
2513 template<
unsigned int prp1,
typename v1>
2530 template<
unsigned int prp1,
typename v1>
2547 template<
unsigned int prp1,
typename v1,
unsigned int prp2,
typename v2>
2564 template<
unsigned int prp1,
typename v1,
typename exp1,
typename exp2,
unsigned int op1>
2581 template<
unsigned int prp1,
typename v1,
typename exp1,
typename exp2,
unsigned int op1>
2598 template<
typename exp1,
typename exp2,
unsigned int op1,
typename exp3,
typename exp4,
unsigned int op2>
2607 #include "vector_dist_operators_apply_kernel.hpp" 2608 #include "vector_dist_operators_functions.hpp" 2609 #include "vector_dist_operators_extensions.hpp" 2610 #include "Operators/Vector/vector_dist_operator_assign.hpp" convert a type into constant type
r_type value(const vect_dist_key_dx &key) const
Evaluate the expression.
const vtype & getVector() const
Return the vector on which is acting.
vector_dist_expression_op(const exp1 &o1, const exp2 &o2)
constructor from two expressions
const vtype & getVector() const
Return the vector on which is acting.
nn_type_result< typename exp1::NN_type, typename exp2::NN_type >::type NN_type
NN_type.
__host__ __device__ auto value(const vect_dist_key_dx &key) const -> decltype(get_vector_dist_expression_op< n, n==rank_gen< property_act >::type::value >::get(o1, vect_dist_key_dx(0), comp))
Return the result of the expression.
first_or_second< has_vtype< exp1 >::value, exp1, exp2 >::vtype vtype
The type of the internal vector.
vector_result< typename exp1::vtype, void >::type vtype
return the vector type on which this expression operate
__device__ __host__ r_type value(const unsigned int &key) const
Evaluate the expression.
NN_type * getNN() const
get the NN object
vector_dist_expression(const double &d)
constructor from a constant expression
vector & operator=(const vector_dist_expression_op< exp1, exp2, op > &v_exp)
Fill the vector property with the evaluated expression.
__host__ auto value(const vect_dist_key_dx &k) const -> decltype(v.template get< 0 >(k.getKey()))
Evaluate the expression.
__host__ __device__ auto value(const vect_dist_key_dx &k) const -> decltype(pos_or_propR< vector, prp >::value(v.v, k))
Evaluate the expression.
vector & operator=(const vector_dist_expression< prp2, vector2 > &v_exp)
Fill the vector property with the evaluated expression.
vector_dist_expression_op(const exp1 &o1, const exp2 &o2)
constructor of the expression to sum two expression
first_or_second< has_vtype< exp1 >::value, exp1, exp2 >::vtype vtype
The type of the internal vector.
__device__ __host__ r_type value(const unsigned int &key) const
return the result of the expression
void add(vector_dist_ker_type &v, bool is_sorted)
Add a new vector_dist_kernel to track.
vector_is_sort_result< exp1::is_sort::value, exp2::is_sort::value >::type is_sort
result for is sort
auto get(const vect_dist_key_dx &key) const -> decltype(value(key))
Return the result of the expression.
vector_is_sort_result< exp1::is_sort::value, exp2::is_sort::value >::type is_sort
result for is sort
__device__ __host__ vtype & getVector()
Return the vector on which is acting.
void * getNN() const
get the NN object
vtype & operator=(const vector_dist_expression_op< exp1_, exp2_, op > &v_exp)
Fill the vector property with the evaluated expression.
__device__ __host__ const vtype & getVector() const
Return the vector on which is acting.
vtype & operator=(double d)
Fill the vector property with the double.
__device__ __host__ const vector & getVector() const
Return the vector on which is acting.
has_init check if a type has defined a method called init
__device__ __host__ r_type value(const unsigned int &key) const
Evaluate the expression.
void init() const
This function must be called before value.
double d
constant parameter
const vtype & getVector() const
Return the vector on which is acting.
boost::mpl::bool_< false > NN_type
result for is sort
vector vtype
The type of the internal vector.
Grid key for a distributed grid.
first_or_second< has_vtype< exp1 >::value, exp1, exp2 >::vtype vtype
return the vector type on which this expression operate
const vtype & getVector()
Return the vector on which is acting.
nn_type_result< typename exp1::NN_type, typename exp2::NN_type >::type NN_type
NN_type.
const exp1 o1
expression 1
static void call(T &r_exp)
it call the function init for r_exp if T has the function init
float value(const vect_dist_key_dx &k) const
Evaluate the expression.
vector & operator=(const vector_dist_expression_op< exp1, exp2, op > &v_exp)
Fill the vector property with the evaluated expression.
vector_is_sort_result< exp1::is_sort::value, false >::type is_sort
result for is sort
__device__ static __host__ auto value(vector &v, const vect_dist_key_dx &k) -> decltype(v.template getProp< prp >(k))
return the value (position or property) of the particle k in the vector v
boost::mpl::bool_< false > is_sort
result for is sort
pos_or_propL< vtype, exp1::prop >::property_act property_act
property on which this view is acting
void * getNN() const
get the NN object
void init() const
This function must be called before value.
__device__ __host__ r_type value(const unsigned int &key) const
Evaluate the expression.
boost::mpl::bool_< false > is_sort
result for is sort
boost::mpl::bool_< false > is_sort
result for is sort
__device__ __host__ double value(const vect_dist_key_dx &k) const
Evaluate the expression.
vector vtype
The type of the internal vector.
selector for position or properties right side position
__device__ __host__ const vector & getVector() const
Return the vector on which is acting.
vector_is_sort_result< exp1::is_sort::value, exp2::is_sort::value >::type is_sort
result for is sort
NN_type * getNN() const
get the NN object
const exp1 o1
expression 1
Unknown operation specialization.
nn_type_result< typename exp1::NN_type, void >::type NN_type
NN_type.
void init() const
This function must be called before value.
nn_type_result< typename exp1::NN_type, typename exp2::NN_type >::type NN_type
NN_type.
vector_dist_expression(const float &d)
constrictor from constant value
const vtype & getVector()
Return the underlying vector.
void init() const
This function must be called before value.
void init() const
This function must be called before value.
vector v
The temporal vector.
void init() const
initialize the expression tree
vector_dist_expression_op(const exp1 &o1, const exp2 &o2)
Costruct a subtraction expression out of two expressions.
vtype & operator=(const vector_dist_expression< 0, openfpm::vector< aggregate< T >>> &v_exp)
Fill the vector property with the evaluated expression.
__device__ __host__ r_type value(const unsigned int &key) const
Evaluate the expression.
const exp1 o1
expression 1
vector & operator=(const vector_dist_expression< prp2, vector > &v_exp)
Fill the vector property with the evaluated expression.
Main class that encapsulate a vector properties operand to be used for expressions construction.
const exp2 o2
expression 2
__host__ __device__ double value(const unsigned int &k) const
Evaluate the expression.
boost::mpl::bool_< false > is_sort
result for is sort
r_type value(const vect_dist_key_dx &key) const
Evaluate the expression.
vector & operator=(double d)
Fill the vector property with the double.
void init() const
initialize the expression tree
exp1::is_ker is_ker
indicate if this vector is kernel type
vector_is_sort_result< exp1::is_sort::value, exp2::is_sort::value >::type is_sort
result for is sort
first_or_second< has_vtype< exp1 >::value, exp1, exp2 >::vtype vtype
The type of the internal vector.
Main class that encapsulate a float constant.
Expression implementation computation selector.
vector_dist_expression_op(const exp1 &o1, int(&comp)[n], int var_id)
constructor from an expresssion
vector & operator=(double d)
Fill the vector property with the double.
__device__ __host__ r_type value(const vect_dist_key_dx &key) const
return the result of the expression
__device__ __host__ auto value(const unsigned int &k) -> decltype(pos_or_propR< vector, prp >::value(v.v, k))
Evaluate the expression.
void init() const
This function must be called before value.
void init() const
This function must be called before value.
vtype & operator=(const vector_dist_expression< prp2, vtype > &v_exp)
Fill the vector property with the evaluated expression.
v_mem_mutable< typename vector_expression_transform< vector >::type > v
The vector.
__device__ __host__ float value(const unsigned int &k) const
Evaluate the expression.
__host__ __device__ auto value(const vect_dist_key_dx &key) -> decltype(get_vector_dist_expression_op< n, n==rank_gen< property_act >::type::value >::get(o1, vect_dist_key_dx(0), comp))
Return the result of the expression.
vector_dist_expression_op(const exp1 &o1, const exp2 &o2)
constructor from two expressions
const vtype & getVector()
Return the vector on which is acting.
vector & operator=(const vector_dist_expression< 0, openfpm::vector< aggregate< T >>> &v_exp)
Fill the vector property with the evaluated expression.
void set_vector_dist_ker_list(vector_dist_ker_list< vector > &vdkl, bool is_sort)
set vector_dist_ker_list
const vtype & getVector() const
Return the vector on which is acting.
Main class that encapsulate a vector properties operand to be used for expressions construction Tempo...
void remove(vector_dist_ker_type &v)
Remove one vector_dist_kernels entry.
Call the init function if a type T has the function init.
const exp2 o2
expression 2
~vector_dist_expression()
constructor for an external vector
__device__ __host__ vector & getVector()
Return the vector on which is acting.
const vtype & getVector()
Return the vector on which is acting.
it take an expression and create the negatove of this expression
const exp2 o2
expression 2
boost::mpl::bool_< false > is_sort
result for is sort
like std::rank but it also work for openfpm structures like Point where it return 1
const exp2 o2
expression 2
static const unsigned int prop
Property id of the point.
nn_type_result< typename exp1::NN_type, typename exp2::NN_type >::type NN_type
NN_type.
Implementation of 1-D std::vector like structure.
NN_type * getNN() const
get the NN object
__host__ __device__ auto value(const vect_dist_key_dx &k) -> decltype(pos_or_propR< vector, prp >::value(v.v, k))
Evaluate the expression.
__device__ __host__ vector & getVector()
Return the vector on which is acting.
T value_type
The type of the internal value.
const exp1 o1
expression 1
__device__ __host__ r_type value(const vect_dist_key_dx &key) const
Evaluate the expression.
openfpm::vector< aggregate< T > > vector
Internal vector.
void init() const
This function must be called before value.
vector_dist_expression(vector &v)
constructor for an external vector
__device__ __host__ r_type value(const vect_dist_key_dx &key) const
Evaluate the expression.
NN_type * getNN() const
get the NN object
const vtype & getVector()
Return the vector on which is acting.
const vtype & getVector() const
Return the vector on which is acting.
const exp1 o1
expression 1
vector_dist_expression_op(const exp1 &o1)
constructor from an expresssion
__device__ __host__ auto value(const unsigned int &k) const -> decltype(pos_or_propR< vector, prp >::value(v.v, k))
Evaluate the expression.
static void call(T &r_exp)
it call the function init for r_exp if T has the function init