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
52 PiecewiseLinearInterpolation(std::vector<int> const& supporting_points,
53 std::vector<double> const& values_at_supp_pnts,
54 bool supp_pnts_sorted = false);
55
64 double getValue(double pnt_to_interpolate) const;
65
78 double getDerivative(double const pnt_to_interpolate) const;
79 double getSupportMax() const;
80 double getSupportMin() const;
81
82protected:
83 std::vector<double> supp_pnts_;
84 std::vector<double> values_at_supp_pnts_;
85};
86} // 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.