3#include <isce3/math/complexOperations.h>
7namespace isce3::core::detail {
22template<
typename KernelType>
23void interp1d_coeffs(
const Kernel<KernelType>& kernel,
const double t,
24 long* low, KernelType coeffs[])
26 int width = int(ceil(kernel.width()));
29 i0 =
static_cast<long>(ceil(t));
31 i0 =
static_cast<long>(round(t));
33 *low = i0 - width / 2;
34 for (
int i = 0; i < width; ++i) {
35 double ti = i + (*low) - t;
36 coeffs[i] = kernel(ti);
54template<
typename DataType>
55const DataType* get_contiguous_view_or_copy(DataType block[],
int width,
56 long low,
const DataType* data,
size_t size,
size_t stride,
59 const long high = low + width;
60 if ((stride == 1) and (low >= 0) and (high < size)) {
65 for (
int i = 0; i < width; ++i) {
66 long j = ((low + i) % size) * stride;
70 for (
int i = 0; i < width; ++i) {
71 long j = (low + i) * stride;
72 if ((j >= 0) and (j < size)) {
75 block[i] =
static_cast<DataType
>(0);
90template<
typename TX,
typename TY>
91auto inner_product(
const int width,
const TX x[],
const TY y[])
93 using namespace isce3::math::complex_operations;
94 using TO =
typename std::common_type<TX, TY>::type;
99 #pragma omp declare reduction(cpxsum:TO : omp_out += omp_in) \
100 initializer(omp_priv = 0)
102 #pragma omp simd reduction(cpxsum : sum)
103 for (
int i = 0; i < width; ++i) {