Reaktoro
A unified framework for modeling chemically reactive systems
BilinearInterpolator Class Reference

A class used to calculate bilinear interpolation of data in two dimensions. More...

#include <BilinearInterpolator.hpp>

Public Member Functions

 BilinearInterpolator ()
 Construct a default BilinearInterpolator instance.
 
 BilinearInterpolator (const std::vector< double > &xcoordinates, const std::vector< double > &ycoordinates, const std::vector< double > &data)
 Construct a BilinearInterpolator instance with given data. More...
 
 BilinearInterpolator (const std::vector< double > &xcoordinates, const std::vector< double > &ycoordinates, const std::function< double(double, double)> &function)
 Construct a BilinearInterpolator instance with given function. More...
 
auto setCoordinatesX (const std::vector< double > &xcoordinates) -> void
 setCoordinatesY the x-coordinates of the interpolation
 
auto setCoordinatesY (const std::vector< double > &ycoordinates) -> void
 Set the y-coordinates of the interpolation.
 
auto setData (const std::vector< double > &data) -> void
 Set the x-coordinates of the interpolation.
 
auto xCoordinates () const -> const std::vector< double > &
 Return the x-coordinates of the interpolation.
 
auto yCoordinates () const -> const std::vector< double > &
 Return the y-coordinates of the interpolation.
 
auto data () const -> const std::vector< double > &
 Return the interpolation data.
 
auto empty () const -> bool
 Check if the BilinearInterpolator instance is empty.
 
auto operator() (double x, double y) const -> double
 Calculate the interpolation at the provided (x, y) point. More...
 

Detailed Description

A class used to calculate bilinear interpolation of data in two dimensions.

Constructor & Destructor Documentation

◆ BilinearInterpolator() [1/2]

BilinearInterpolator ( const std::vector< double > &  xcoordinates,
const std::vector< double > &  ycoordinates,
const std::vector< double > &  data 
)

Construct a BilinearInterpolator instance with given data.

Parameters
xcoordinatesThe x-coordinates for the interpolation
ycoordinatesThe y-coordinates for the interpolation
dataThe data to be interpolated over the (x, y) coordinates

◆ BilinearInterpolator() [2/2]

BilinearInterpolator ( const std::vector< double > &  xcoordinates,
const std::vector< double > &  ycoordinates,
const std::function< double(double, double)> &  function 
)

Construct a BilinearInterpolator instance with given function.

Parameters
xcoordinatesThe x-coordinates for the interpolation
ycoordinatesThe y-coordinates for the interpolation
functionThe function to be interpolated over the (x, y) coordinates

Member Function Documentation

◆ operator()()

auto operator() ( double  x,
double  y 
) const -> double

Calculate the interpolation at the provided (x, y) point.

Parameters
xThe x-coordinate of the point
yThe y-coordinate of the point
Returns
The interpolation of the data at (x, y) point

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