From 71a958cd600856850c6f8f80ebc33c89f6a6dcf4 Mon Sep 17 00:00:00 2001 From: Pietro Incardona <incardon@mpi-cbg.de> Date: Sat, 10 Jun 2017 11:18:13 +0200 Subject: [PATCH] Adding missing files --- src/interpolation/mp4_kernel.hpp | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/interpolation/mp4_kernel.hpp diff --git a/src/interpolation/mp4_kernel.hpp b/src/interpolation/mp4_kernel.hpp new file mode 100644 index 00000000..f9ccff79 --- /dev/null +++ b/src/interpolation/mp4_kernel.hpp @@ -0,0 +1,34 @@ +/* + * mp4_kernel.hpp + * + * Created on: May 5, 2017 + * Author: i-bird + */ + +#ifndef OPENFPM_NUMERICS_SRC_INTERPOLATION_MP4_KERNEL_HPP_ +#define OPENFPM_NUMERICS_SRC_INTERPOLATION_MP4_KERNEL_HPP_ + +#include <iostream> + +template<typename st> +class mp4_kernel +{ +public: + + static const int np = 4; + + static inline st value(st x, size_t i) + { + if (i == 0) + return st(2.0) + (st(-4.0)+(st(2.5)-st(0.5)*-x)*-x)*-x; + else if (i == 1) + return st(1.0) + (st(-2.5)+st(1.5)*-x)*x*x; + else if (i == 2) + return st(1.0) + (st(-2.5)+st(1.5)*x)*x*x; + else if (i == 3) + return st(2.0) + (st(-4.0)+(st(2.5)-st(0.5)*x)*x)*x; + return 0.0; + } +}; + +#endif /* OPENFPM_NUMERICS_SRC_INTERPOLATION_MP4_KERNEL_HPP_ */ -- GitLab