Janus 2.0.0
High-performance C++20 dual-mode numerical framework
Loading...
Searching...
No Matches
janus::ScatteredInterpolator Class Reference

#include <ScatteredInterpolator.hpp>

Public Member Functions

 ScatteredInterpolator ()=default
 Default constructor (invalid state).
 ScatteredInterpolator (const NumericMatrix &points, const NumericVector &values, int grid_resolution=20, RBFKernel kernel=RBFKernel::ThinPlateSpline, double epsilon=1.0, InterpolationMethod method=InterpolationMethod::Linear)
 Construct from scattered N-D points with uniform grid resolution.
 ScatteredInterpolator (const NumericMatrix &points, const NumericVector &values, const std::vector< NumericVector > &grid_points, RBFKernel kernel=RBFKernel::ThinPlateSpline, double epsilon=1.0, InterpolationMethod method=InterpolationMethod::Linear)
 Construct with explicit per-dimension grid specification.
 ScatteredInterpolator (const NumericVector &x, const NumericVector &y, int grid_resolution=50, RBFKernel kernel=RBFKernel::ThinPlateSpline)
 1D convenience constructor
template<JanusScalar Scalar>
Scalar operator() (const JanusVector< Scalar > &query) const
 Evaluate at N-D point.
template<JanusScalar Scalar>
Scalar operator() (const Scalar &query) const
 Evaluate at scalar (1D only).
int dims () const
 Get number of input dimensions.
bool valid () const
 Check if interpolator is valid (initialized).
const Interpolatorgridded () const
 Get underlying gridded interpolator (for inspection).
double reconstruction_error () const
 Get RMS reconstruction error at original scattered points.

Constructor & Destructor Documentation

◆ ScatteredInterpolator() [1/4]

janus::ScatteredInterpolator::ScatteredInterpolator ( )
default

Default constructor (invalid state).

◆ ScatteredInterpolator() [2/4]

janus::ScatteredInterpolator::ScatteredInterpolator ( const NumericMatrix & points,
const NumericVector & values,
int grid_resolution = 20,
RBFKernel kernel = RBFKernel::ThinPlateSpline,
double epsilon = 1.0,
InterpolationMethod method = InterpolationMethod::Linear )
inline

Construct from scattered N-D points with uniform grid resolution.

Parameters
pointsData locations, shape (n_points, n_dims)
valuesFunction values at each point (length n_points)
grid_resolutionPoints per dimension for resampling grid
kernelRBF kernel type (default: ThinPlateSpline)
epsilonShape parameter for Multiquadric/Gaussian kernels
methodGridded interpolation method for final queries
Exceptions
InterpolationErrorif inputs are invalid

◆ ScatteredInterpolator() [3/4]

janus::ScatteredInterpolator::ScatteredInterpolator ( const NumericMatrix & points,
const NumericVector & values,
const std::vector< NumericVector > & grid_points,
RBFKernel kernel = RBFKernel::ThinPlateSpline,
double epsilon = 1.0,
InterpolationMethod method = InterpolationMethod::Linear )
inline

Construct with explicit per-dimension grid specification.

Parameters
pointsData locations, shape (n_points, n_dims)
valuesFunction values at each point
grid_pointsExplicit grid coordinates per dimension
kernelRBF kernel type
epsilonShape parameter for Multiquadric/Gaussian kernels
methodGridded interpolation method for final queries

◆ ScatteredInterpolator() [4/4]

janus::ScatteredInterpolator::ScatteredInterpolator ( const NumericVector & x,
const NumericVector & y,
int grid_resolution = 50,
RBFKernel kernel = RBFKernel::ThinPlateSpline )
inline

1D convenience constructor

Parameters
xScattered x-coordinates
yFunction values at each x
grid_resolutionPoints for resampling grid
kernelRBF kernel type

Member Function Documentation

◆ dims()

int janus::ScatteredInterpolator::dims ( ) const
inline

Get number of input dimensions.

Returns
Number of dimensions

◆ gridded()

const Interpolator & janus::ScatteredInterpolator::gridded ( ) const
inline

Get underlying gridded interpolator (for inspection).

Returns
Reference to gridded interpolator

◆ operator()() [1/2]

template<JanusScalar Scalar>
Scalar janus::ScatteredInterpolator::operator() ( const JanusVector< Scalar > & query) const
inline

Evaluate at N-D point.

Template Parameters
ScalarScalar type (NumericScalar or SymbolicScalar)
Parameters
queryQuery point vector
Returns
Interpolated value

◆ operator()() [2/2]

template<JanusScalar Scalar>
Scalar janus::ScatteredInterpolator::operator() ( const Scalar & query) const
inline

Evaluate at scalar (1D only).

Template Parameters
ScalarScalar type (NumericScalar or SymbolicScalar)
Parameters
queryScalar query value
Returns
Interpolated value

◆ reconstruction_error()

double janus::ScatteredInterpolator::reconstruction_error ( ) const
inline

Get RMS reconstruction error at original scattered points.

Measures how well the gridded approximation reproduces the original scattered data. Lower is better.

◆ valid()

bool janus::ScatteredInterpolator::valid ( ) const
inline

Check if interpolator is valid (initialized).

Returns
True if initialized

The documentation for this class was generated from the following file: