17 #ifndef BILINEARSPLINEFUNCTION_H
18 #define BILINEARSPLINEFUNCTION_H
22 std::vector<double>
xs;
23 std::vector<SplineFunction>
xspls;
31 const std::vector<double>&
y,
32 const std::vector<double>& vals)
37 const std::vector<double>&
y,
38 const std::vector<double>& vals) {
43 for (
unsigned int i = 0;
i <
x.size(); ++
i) {
44 if (
fabs(
x[
i] - cx) > 1e-6) {
55 double Eval(
double x,
double y)
const {
56 if (
xs.size() < 2)
return -1.;
57 unsigned int indx = 0;
58 std::vector<double>::const_iterator it =
59 lower_bound(
xs.begin(),
xs.end(),
x);
60 indx = distance(
xs.begin(), it);
61 int ind1 = 0, ind2 = 0;
65 }
else if (indx ==
xs.size()) {
72 double f1v =
xspls[ind1].f(
y);
73 double f2v =
xspls[ind2].f(
y);
74 return f1v + (
x -
xs[ind1]) * (f2v - f1v) / (
xs[ind2] -
xs[ind1]);