Commit 8d2ef5c8 authored by Damien L-G's avatar Damien L-G

Add bilinear_eval functions to the interface

parent f8577336
......@@ -4,6 +4,31 @@
using namespace noname;
double bilinear_eval(char const *o, double x, double y) {
auto spline = Map<Spline2D<Bilinear>>::get_spline(o);
return spline->eval(x, y);
}
double bilinear_eval_deriv_x(char const *o, double x, double y) {
auto spline = Map<Spline2D<Bilinear>>::get_spline(o);
return spline->eval_deriv_x(x, y);
}
double bilinear_eval_deriv_y(char const *o, double x, double y) {
auto spline = Map<Spline2D<Bilinear>>::get_spline(o);
return spline->eval_deriv_y(x, y);
}
double bilinear_eval_deriv_xx(char const *o, double x, double y) {
auto spline = Map<Spline2D<Bilinear>>::get_spline(o);
return spline->eval_deriv_xx(x, y);
}
double bilinear_eval_deriv_yy(char const *o, double x, double y) {
auto spline = Map<Spline2D<Bilinear>>::get_spline(o);
return spline->eval_deriv_yy(x, y);
}
double bilinear_eval_deriv_xy(char const *o, double x, double y) {
auto spline = Map<Spline2D<Bilinear>>::get_spline(o);
return spline->eval_deriv_xy(x, y);
}
double bicubic_eval(char const *o, double x, double y) {
auto spline = Map<Spline2D<Bicubic>>::get_spline(o);
return spline->eval(x, y);
......
......@@ -27,6 +27,13 @@
extern "C" {
#endif
EXPORT double bilinear_eval(char const *o, double x, double y);
EXPORT double bilinear_eval_deriv_x(char const *o, double x, double y);
EXPORT double bilinear_eval_deriv_y(char const *o, double x, double y);
EXPORT double bilinear_eval_deriv_xx(char const *o, double x, double y);
EXPORT double bilinear_eval_deriv_yy(char const *o, double x, double y);
EXPORT double bilinear_eval_deriv_xy(char const *o, double x, double y);
EXPORT double bicubic_eval(char const *o, double x, double y);
EXPORT double bicubic_eval_deriv_x(char const *o, double x, double y);
EXPORT double bicubic_eval_deriv_y(char const *o, double x, double y);
......
......@@ -23,9 +23,10 @@ int main() {
double const y = std::stod(e);
std::getline(sz, e, ',');
double const z_ref = std::stod(e);
double const z_eval = noname_spline2d_eval(k.c_str(), x, y);
std::cout << i << " " << x << " " << y << " " << z_ref << " " << z_eval
<< "\n";
double const z_eval1 = bilinear_eval(k.c_str(), x, y);
double const z_eval3 = bicubic_eval(k.c_str(), x, y);
std::cout << i << " " << x << " " << y << " " << z_ref << " " << z_eval1
<< " " << z_eval3 << "\n";
}
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment