1 #ifndef LINEAR_1D_INTERPOLATION_HPP
2 #define LINEAR_1D_INTERPOLATION_HPP
14 template<
typename T,
typename T2>
16 const int n = x.size();
17 if (x1 >= x(0) && x1 <= x(n-1)){
31 double slope = (y(ie)-y(is))/(x(ie)-x(is));
32 return (y(is) + slope * (x1-x(is)));
36 double slope = (y(1)-y(0)) / (x(1)-x(0));
37 return (y(0) + slope * (x1-x(0)));
38 }
else if (x1 > x(n-1)){
39 double slope = (y(n-1)-y(n-2)) / (x(n-1)-x(n-2));
40 return (y(n-1) + slope * (x1-x(n-1)));
58 Kokkos::parallel_for(
"interpol_1d", Kokkos::RangePolicy<typename T::execution_space>( 0,x1.size() ), KOKKOS_LAMBDA(
const int i){
KOKKOS_INLINE_FUNCTION T2 linear_1d_interpolation(const T &x, const T &y, const T2 x1)
Definition: linear_1d_interpolation.hpp:15
void parallel_for(const std::string name, int n_ptl, Function func, Option option, HostAoSoA aosoa_h, DeviceAoSoA aosoa_d)
Definition: streamed_parallel_for.hpp:252