6#include <janus/math/Interpolate.hpp>
7#include <janus/math/ScatteredInterpolator.hpp>
13using janus::RBFKernel;
39 janus::Interpolator m_interp;
51 const janus::NumericVector &x,
const janus::NumericVector &y,
52 janus::InterpolationMethod
method = janus::InterpolationMethod::Linear)
53 : m_interp(x, y,
method) {}
64 template <janus::JanusScalar Scalar>
76 template <
typename Derived>
77 auto operator()(
const Eigen::MatrixBase<Derived> &x)
const {
84 janus::InterpolationMethod
method()
const {
return m_interp.method(); }
89 bool valid()
const {
return m_interp.valid(); }
125 janus::Interpolator m_interp;
139 const std::vector<janus::NumericVector> &grid_points,
140 const janus::NumericVector &values,
141 janus::InterpolationMethod
method = janus::InterpolationMethod::Linear)
142 : m_interp(grid_points, values,
method),
143 m_dims(static_cast<int>(grid_points.size())) {}
152 template <janus::JanusScalar Scalar>
153 Scalar
operator()(
const janus::JanusVector<Scalar> &x)
const {
164 template <
typename Derived>
172 int dims()
const {
return m_dims; }
177 janus::InterpolationMethod
method()
const {
return m_interp.method(); }
182 bool valid()
const {
return m_interp.valid(); }
210 janus::ScatteredInterpolator m_interp;
223 const janus::NumericVector &y,
int grid_resolution = 50,
224 RBFKernel kernel = RBFKernel::ThinPlateSpline)
225 : m_interp(x, y, grid_resolution, kernel) {}
234 template <janus::JanusScalar Scalar>
245 return m_interp.reconstruction_error();
251 int dims()
const {
return m_interp.dims(); }
256 bool valid()
const {
return m_interp.valid(); }
287 janus::ScatteredInterpolator m_interp;
302 const janus::NumericMatrix &points,
const janus::NumericVector &values,
303 int grid_resolution = 20, RBFKernel kernel = RBFKernel::ThinPlateSpline,
304 double epsilon = 1.0,
305 janus::InterpolationMethod method = janus::InterpolationMethod::Linear)
306 : m_interp(points, values, grid_resolution, kernel, epsilon, method) {}
319 const janus::NumericMatrix &points,
const janus::NumericVector &values,
320 const std::vector<janus::NumericVector> &grid_points,
321 RBFKernel kernel = RBFKernel::ThinPlateSpline,
double epsilon = 1.0,
322 janus::InterpolationMethod method = janus::InterpolationMethod::Linear)
323 : m_interp(points, values, grid_points, kernel, epsilon, method) {}
332 template <janus::JanusScalar Scalar>
333 Scalar
operator()(
const janus::JanusVector<Scalar> &x)
const {
343 return m_interp.reconstruction_error();
349 int dims()
const {
return m_interp.dims(); }
354 bool valid()
const {
return m_interp.valid(); }
double reconstruction_error() const
Get RMS reconstruction error at original data points.
Definition TableInterpolator.hpp:244
bool valid() const
Check if table is valid (initialized).
Definition TableInterpolator.hpp:256
ScatteredTable1D(const janus::NumericVector &x, const janus::NumericVector &y, int grid_resolution=50, RBFKernel kernel=RBFKernel::ThinPlateSpline)
Construct 1D scattered interpolation table.
Definition TableInterpolator.hpp:222
int dims() const
Get number of dimensions (always 1).
Definition TableInterpolator.hpp:251
Scalar operator()(const Scalar &x) const
Query table at a single point.
Definition TableInterpolator.hpp:235
bool valid() const
Check if table is valid (initialized).
Definition TableInterpolator.hpp:354
ScatteredTableND(const janus::NumericMatrix &points, const janus::NumericVector &values, int grid_resolution=20, RBFKernel kernel=RBFKernel::ThinPlateSpline, double epsilon=1.0, janus::InterpolationMethod method=janus::InterpolationMethod::Linear)
Construct N-D scattered interpolation table.
Definition TableInterpolator.hpp:301
int dims() const
Get number of input dimensions.
Definition TableInterpolator.hpp:349
ScatteredTableND(const janus::NumericMatrix &points, const janus::NumericVector &values, const std::vector< janus::NumericVector > &grid_points, RBFKernel kernel=RBFKernel::ThinPlateSpline, double epsilon=1.0, janus::InterpolationMethod method=janus::InterpolationMethod::Linear)
Construct with explicit per-dimension grid specification.
Definition TableInterpolator.hpp:318
double reconstruction_error() const
Get RMS reconstruction error at original data points.
Definition TableInterpolator.hpp:342
Scalar operator()(const janus::JanusVector< Scalar > &x) const
Query table at a single N-D point.
Definition TableInterpolator.hpp:333
auto operator()(const Eigen::MatrixBase< Derived > &x) const
Query table at multiple points (batch evaluation).
Definition TableInterpolator.hpp:77
Scalar operator()(const Scalar &x) const
Query table at a single point.
Definition TableInterpolator.hpp:65
bool valid() const
Check if table is valid (initialized).
Definition TableInterpolator.hpp:89
janus::InterpolationMethod method() const
Get the interpolation method.
Definition TableInterpolator.hpp:84
Table1D(const janus::NumericVector &x, const janus::NumericVector &y, janus::InterpolationMethod method=janus::InterpolationMethod::Linear)
Construct 1D interpolation table.
Definition TableInterpolator.hpp:50
TableND(const std::vector< janus::NumericVector > &grid_points, const janus::NumericVector &values, janus::InterpolationMethod method=janus::InterpolationMethod::Linear)
Construct N-dimensional interpolation table.
Definition TableInterpolator.hpp:138
Scalar operator()(const janus::JanusVector< Scalar > &x) const
Query table at a single N-D point.
Definition TableInterpolator.hpp:153
auto operator()(const Eigen::MatrixBase< Derived > &x) const
Query table at multiple N-D points (batch evaluation).
Definition TableInterpolator.hpp:165
bool valid() const
Check if table is valid (initialized).
Definition TableInterpolator.hpp:182
int dims() const
Get number of dimensions.
Definition TableInterpolator.hpp:172
janus::InterpolationMethod method() const
Get the interpolation method.
Definition TableInterpolator.hpp:177
Definition Aerodynamics.hpp:11