isce3 0.25.0
Loading...
Searching...
No Matches
Interp1d.icc
1#include "detail/Interp1d.h"
2#include "detail/SSOBuffer.h"
3
4namespace isce3 { namespace core {
5
6template<typename KernelType, typename DataType>
7DataType interp1d(const Kernel<KernelType>& kernel, const DataType* x,
8 size_t length, size_t stride, double t, bool periodic)
9{
10 // Small-size optimization to avoid heap allocation.
11 const auto width = static_cast<int>(ceil(kernel.width()));
14
15 long low = 0;
16 detail::interp1d_coeffs(kernel, t, &low, coeffs.data());
17 const DataType* px = detail::get_contiguous_view_or_copy(
18 data.data(), width, low, x, length, stride, periodic);
19 auto sum = detail::inner_product(width, coeffs.data(), px);
20
21 return sum;
22}
23
24template<typename KernelType, typename DataType>
25DataType interp1d(const Kernel<KernelType>& kernel,
26 const std::valarray<DataType>& x, double t, bool periodic)
27{
28 return interp1d(kernel, &x[0], x.size(), 1, t, periodic);
29}
30
31}} // namespace isce3::core
Abstract base class for all kernels.
Definition Kernels.h:19
Small-size optimized (SSO) buffer.
Definition SSOBuffer.h:13
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5

Generated for ISCE3.0 by doxygen 1.13.2.