vector_dist_operators_extensions.hpp 1.3 KB
 Pietro Incardona committed Jul 20, 2016 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ``````/* * vector_dist_operators_extensions.hpp * * Created on: Jul 18, 2016 * Author: i-bird */ #ifndef OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_EXTENSIONS_HPP_ #define OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_EXTENSIONS_HPP_ /*! \Create an expression from a Point * * \tpatam prp property * \param v * */ template inline vector_dist_expression<16384,Point > getVExpr(Point & v) { vector_dist_expression<(unsigned int)16384,Point> exp_v(v); return exp_v; } `````` incardon committed Jan 03, 2017 26 ``````/*! \brief This class represent a constant parameter in a vector expression `````` Pietro Incardona committed Jul 20, 2016 27 `````` * `````` incardon committed Jan 03, 2017 28 `````` * \tparam point type of point `````` Pietro Incardona committed Jul 20, 2016 29 30 31 32 33 `````` * */ template class vector_dist_expression<16384,point> { `````` incardon committed Jan 03, 2017 34 `````` //! constant point stored `````` Pietro Incardona committed Jul 20, 2016 35 36 37 38 `````` point p; public: `````` incardon committed Jan 03, 2017 39 `````` //! vector expression from a constant point `````` Pietro Incardona committed Jul 20, 2016 40 41 42 43 44 45 46 47 48 49 50 51 52 53 `````` vector_dist_expression(point p) :p(p) {} /*! \brief This function must be called before value * * it initialize the expression if needed * */ inline void init() const {} /*! \brief Evaluate the expression * `````` incardon committed Jan 03, 2017 54 55 56 `````` * \param k where to evaluate the expression (ignored) * * \return the point stored `````` Pietro Incardona committed Jul 20, 2016 57 58 59 60 61 62 63 64 65 66 `````` * */ inline point value(const vect_dist_key_dx & k) const { return p; } }; #endif /* OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_EXTENSIONS_HPP_ */``````