16 #ifndef __H2D_SPLINE_H
17 #define __H2D_SPLINE_H
25 class HERMES_API
CubicSpline :
public Hermes::Hermes1DFunction<double>
29 CubicSpline(Hermes::vector<double> points, Hermes::vector<double> values,
30 double bc_left,
double bc_right,
31 bool first_der_left =
true,
bool first_der_right =
true,
32 bool extend_der_left =
true,
bool extend_der_right =
true);
40 void calculate_coeffs();
43 double value(
double x)
const;
46 Hermes::Ord
value(Hermes::Ord x)
const {
return Hermes::Ord(3);};
49 double derivative(
double x)
const;
52 Hermes::Ord
derivative(Hermes::Ord x)
const {
return Hermes::Ord(2);};
60 void plot(
const char* filename,
double extension,
bool plot_derivative =
false,
int subdiv = 50)
const;
65 bool find_interval(
double x_in,
int& m)
const;
68 double extrapolate_value(
double point_end,
double value_end,
double derivative_end,
double x_in)
const;
92 double point_right, value_right, derivative_right;
98 double get_derivative_from_interval(
double x_in,
int m)
const;
101 double get_value_from_interval(
double x_in,
int m)
const;