OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
point_expression_op< orig, exp1, exp2, POINT_SUM > Class Template Reference

Sum operation. More...

Detailed Description

template<typename orig, typename exp1, typename exp2>
class point_expression_op< orig, exp1, exp2, POINT_SUM >

Sum operation.

Template Parameters
origoriginal type
exp1expression1
exp2expression2

Definition at line 348 of file Point_operators.hpp.

#include <Point_operators.hpp>

Public Types

typedef first_or_second_pt< has_coordtype< exp1 >::value, exp1, exp2 >::coord_type coord_type
 The type of the internal vector.
 
typedef orig orig_type
 original type of the point expression
 
typedef int is_expression
 indicate that this class encapsulate an expression
 
typedef int has_init
 indicate that init must be called before value
 
typedef r_type_p< r_type_dim< exp1::nvals, exp2::nvals, POINT_SUM >::value, orig >::type return_type
 return type of the expression
 

Public Member Functions

__device__ __host__ point_expression_op (const exp1 &o1, const exp2 &o2)
 Constructor from 2 point expressions.
 
__device__ __host__ void init () const
 This function must be called before value.
 
template<typename r_type = typename best_conv<typename std::remove_reference<decltype(o1.value(0))>::type, typename std::remove_reference<decltype(o2.value(0))>::type>::type>
__device__ __host__ r_type value (size_t k) const
 Evaluate the expression at coordinate k.
 
template<typename T , typename test = typename boost::disable_if_c< std::is_same<T,orig>::value || exp1::nvals != 1 || exp2::nvals != 1 >::type>
__device__ __host__ operator T () const
 conversion of the class to double or float or ...
 
template<typename r_type = typename best_conv<typename std::remove_reference<decltype(o1.value(0))>::type, typename std::remove_reference<decltype(o2.value(0))>::type>::type>
__device__ __host__ r_type operator[] (size_t i)
 Get the component i.
 

Static Public Attributes

static const unsigned int nvals = r_type_dim<exp1::nvals,exp2::nvals,POINT_SUM>::value
 this operation produce a vector as result of size dims
 

Private Attributes

const exp1 o1
 first expression
 
const exp2 o2
 second expression
 

Member Typedef Documentation

◆ coord_type

template<typename orig , typename exp1 , typename exp2 >
typedef first_or_second_pt<has_coordtype<exp1>::value,exp1,exp2>::coord_type point_expression_op< orig, exp1, exp2, POINT_SUM >::coord_type

The type of the internal vector.

Definition at line 358 of file Point_operators.hpp.

◆ has_init

template<typename orig , typename exp1 , typename exp2 >
typedef int point_expression_op< orig, exp1, exp2, POINT_SUM >::has_init

indicate that init must be called before value

Definition at line 367 of file Point_operators.hpp.

◆ is_expression

template<typename orig , typename exp1 , typename exp2 >
typedef int point_expression_op< orig, exp1, exp2, POINT_SUM >::is_expression

indicate that this class encapsulate an expression

Definition at line 364 of file Point_operators.hpp.

◆ orig_type

template<typename orig , typename exp1 , typename exp2 >
typedef orig point_expression_op< orig, exp1, exp2, POINT_SUM >::orig_type

original type of the point expression

Definition at line 361 of file Point_operators.hpp.

◆ return_type

template<typename orig , typename exp1 , typename exp2 >
typedef r_type_p<r_type_dim<exp1::nvals,exp2::nvals,POINT_SUM>::value,orig>::type point_expression_op< orig, exp1, exp2, POINT_SUM >::return_type

return type of the expression

Definition at line 370 of file Point_operators.hpp.

Constructor & Destructor Documentation

◆ point_expression_op()

template<typename orig , typename exp1 , typename exp2 >
__device__ __host__ point_expression_op< orig, exp1, exp2, POINT_SUM >::point_expression_op ( const exp1 &  o1,
const exp2 &  o2 
)
inline

Constructor from 2 point expressions.

Parameters
o1expression1
o2expression2

Definition at line 381 of file Point_operators.hpp.

Member Function Documentation

◆ init()

template<typename orig , typename exp1 , typename exp2 >
__device__ __host__ void point_expression_op< orig, exp1, exp2, POINT_SUM >::init ( ) const
inline

This function must be called before value.

it calculate the scalar product before return the values

Definition at line 390 of file Point_operators.hpp.

◆ operator T()

template<typename orig , typename exp1 , typename exp2 >
template<typename T , typename test = typename boost::disable_if_c< std::is_same<T,orig>::value || exp1::nvals != 1 || exp2::nvals != 1 >::type>
__device__ __host__ point_expression_op< orig, exp1, exp2, POINT_SUM >::operator T ( ) const
inline

conversion of the class to double or float or ...

Definition at line 415 of file Point_operators.hpp.

◆ operator[]()

template<typename orig , typename exp1 , typename exp2 >
template<typename r_type = typename best_conv<typename std::remove_reference<decltype(o1.value(0))>::type, typename std::remove_reference<decltype(o2.value(0))>::type>::type>
__device__ __host__ r_type point_expression_op< orig, exp1, exp2, POINT_SUM >::operator[] ( size_t  i)
inline

Get the component i.

Parameters
icomponent
Returns
the i-component

Definition at line 430 of file Point_operators.hpp.

◆ value()

template<typename orig , typename exp1 , typename exp2 >
template<typename r_type = typename best_conv<typename std::remove_reference<decltype(o1.value(0))>::type, typename std::remove_reference<decltype(o2.value(0))>::type>::type>
__device__ __host__ r_type point_expression_op< orig, exp1, exp2, POINT_SUM >::value ( size_t  k) const
inline

Evaluate the expression at coordinate k.

Parameters
kcoordinate
Returns
the value of the expression for the coordinate k

Definition at line 405 of file Point_operators.hpp.

Field Documentation

◆ nvals

template<typename orig , typename exp1 , typename exp2 >
const unsigned int point_expression_op< orig, exp1, exp2, POINT_SUM >::nvals = r_type_dim<exp1::nvals,exp2::nvals,POINT_SUM>::value
static

this operation produce a vector as result of size dims

Definition at line 373 of file Point_operators.hpp.

◆ o1

template<typename orig , typename exp1 , typename exp2 >
const exp1 point_expression_op< orig, exp1, exp2, POINT_SUM >::o1
private

first expression

Definition at line 351 of file Point_operators.hpp.

◆ o2

template<typename orig , typename exp1 , typename exp2 >
const exp2 point_expression_op< orig, exp1, exp2, POINT_SUM >::o2
private

second expression

Definition at line 353 of file Point_operators.hpp.


The documentation for this class was generated from the following file: