OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
mp4_kernel.hpp
1/*
2 * mp4_kernel.hpp
3 *
4 * Created on: May 5, 2017
5 * Author: i-bird
6 */
7
8#ifndef OPENFPM_NUMERICS_SRC_INTERPOLATION_MP4_KERNEL_HPP_
9#define OPENFPM_NUMERICS_SRC_INTERPOLATION_MP4_KERNEL_HPP_
10
11#include <iostream>
12
13template<typename st>
15{
16public:
17
18 static const int np = 4;
19
20 static inline st value(st x, size_t i)
21 {
22 if (i == 0)
23 return st(2.0) + (st(-4.0)+(st(2.5)-st(0.5)*-x)*-x)*-x;
24 else if (i == 1)
25 return st(1.0) + (st(-2.5)+st(1.5)*-x)*x*x;
26 else if (i == 2)
27 return st(1.0) + (st(-2.5)+st(1.5)*x)*x*x;
28 else if (i == 3)
29 return st(2.0) + (st(-4.0)+(st(2.5)-st(0.5)*x)*x)*x;
30 return 0.0;
31 }
32};
33
34#endif /* OPENFPM_NUMERICS_SRC_INTERPOLATION_MP4_KERNEL_HPP_ */