OGS
PiecewiseLinearInterpolation.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <vector>
18
19namespace MathLib
20{
26{
27public:
48 PiecewiseLinearInterpolation(std::vector<double> supporting_points,
49 std::vector<double> values_at_supp_pnts,
50 bool supp_pnts_sorted = false);
51
60 double getValue(double pnt_to_interpolate) const;
61
74 double getDerivative(double const pnt_to_interpolate) const;
75 double getSupportMax() const;
76 double getSupportMin() const;
77
78protected:
79 std::vector<double> supp_pnts_;
80 std::vector<double> values_at_supp_pnts_;
81};
82} // end namespace MathLib
PiecewiseLinearInterpolation(std::vector< double > supporting_points, std::vector< double > values_at_supp_pnts, bool supp_pnts_sorted=false)
double getDerivative(double const pnt_to_interpolate) const
Calculates derivative using quadratic interpolation and central difference quotient.
double getValue(double pnt_to_interpolate) const
Calculates the interpolation value.