isce3 0.25.0
Loading...
Searching...
No Matches
Kernels.h
1#pragma once
2
3#include "forward.h"
4
5#include <cmath>
6#include <vector>
7
8#include <isce3/math/Bessel.h>
9
10namespace isce3 { namespace core {
11
18template<typename T>
19class Kernel {
20public:
21 using value_type = T;
22
23 Kernel(double width) : _halfwidth(fabs(width / 2.0)) {}
24
26 virtual ~Kernel() {}
27
29 virtual T operator()(double x) const = 0;
30
35 double width() const { return _halfwidth * 2; }
36
37protected:
38 double _halfwidth;
39};
40
42template<typename T>
43class BartlettKernel : public Kernel<T> {
44public:
46 BartlettKernel(double width) : Kernel<T>(width) {}
47
48 T operator()(double x) const override;
49};
50
52template<typename T>
53class LinearKernel : public BartlettKernel<T> {
54public:
55 LinearKernel() : BartlettKernel<T>(2.0) {}
56};
57
64template<typename T>
65class KnabKernel : public Kernel<T> {
66public:
73 KnabKernel(double width, double bandwidth)
74 : Kernel<T>(width), _bandwidth(bandwidth)
75 {}
76
77 T operator()(double x) const override;
78
80 double bandwidth() const { return _bandwidth; }
81
82private:
83 double _bandwidth;
84};
85
93template<typename T>
94class NFFTKernel : public Kernel<T> {
95public:
102 NFFTKernel(int m, int n, int fft_size);
103
104 T operator()(double x) const override;
105
106private:
107 int _m;
108 int _n;
109 int _fft_size;
110 T _scale;
111 T _b;
112};
113
118template<typename T>
119class AzimuthKernel : public Kernel<T> {
120public:
126 AzimuthKernel(double scale) : Kernel<T>(2 * scale) {} // non-zero on 2L
127
128 T operator()(double x) const override;
129};
130
132template<typename T>
133class TabulatedKernel : public Kernel<T> {
134public:
140 template<typename Tin>
141 TabulatedKernel(const Kernel<Tin>& kernel, int n);
142
143 T operator()(double x) const override;
144
145 const std::vector<T>& table() const { return _table; }
146
147private:
148 std::vector<T> _table;
149 int _imax;
150 T _1_dx;
151};
152
154template<typename T>
155class ChebyKernel : public Kernel<T> {
156public:
162 template<typename Tin>
163 ChebyKernel(const Kernel<Tin>& kernel, int n);
164
165 T operator()(double x) const override;
166
167 const std::vector<T>& coeffs() const { return _coeffs; }
168
169private:
170 std::vector<T> _coeffs;
171 T _scale;
172};
173
174}} // namespace isce3::core
175
176#include "Kernels.icc"
AzimuthKernel(double scale)
Constructor.
Definition Kernels.h:126
T operator()(double x) const override
Evaluate kernel at given location in [-halfwidth, halfwidth].
Definition Kernels.icc:95
T operator()(double x) const override
Evaluate kernel at given location in [-halfwidth, halfwidth].
Definition Kernels.icc:16
BartlettKernel(double width)
Triangle function constructor.
Definition Kernels.h:46
T operator()(double x) const override
Evaluate kernel at given location in [-halfwidth, halfwidth].
Definition Kernels.icc:192
ChebyKernel(const Kernel< Tin > &kernel, int n)
Constructor that computes fit of another Kernel.
Definition Kernels.icc:158
double width() const
Get width of kernel.
Definition Kernels.h:35
virtual T operator()(double x) const =0
Evaluate kernel at given location in [-halfwidth, halfwidth].
virtual ~Kernel()
Virtual destructor (allow destruction of base Kernel pointer)
Definition Kernels.h:26
double bandwidth() const
Get bandwidth of kernel.
Definition Kernels.h:80
T operator()(double x) const override
Evaluate kernel at given location in [-halfwidth, halfwidth].
Definition Kernels.icc:48
KnabKernel(double width, double bandwidth)
Constructor of Knab's kernel.
Definition Kernels.h:73
T operator()(double x) const override
Evaluate kernel at given location in [-halfwidth, halfwidth].
Definition Kernels.icc:73
NFFTKernel(int m, int n, int fft_size)
Constructor of NFFT kernel.
Definition Kernels.icc:60
TabulatedKernel(const Kernel< Tin > &kernel, int n)
Constructor of tabulated kernel.
T operator()(double x) const override
Evaluate kernel at given location in [-halfwidth, halfwidth].
Definition Kernels.icc:139
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5

Generated for ISCE3.0 by doxygen 1.13.2.