#include <cmath>
#include "gtest/gtest.h"
TEST(Approximations, PolyharmonicEvaluateCompileTime) {
Polyharmonic<double, 3> ph;
double r0 = 0;
double r2 = 1.23;
EXPECT_NEAR(0, ph(r0), 1e-15);
EXPECT_NEAR(std::sqrt(r2*r2*r2), ph(r2), 1e-15);
EXPECT_NEAR(0, ph(r0, 0), 1e-15);
EXPECT_NEAR(std::sqrt(r2*r2*r2), ph(r2), 1e-15);
EXPECT_NEAR(0, ph(r0, 1), 1e-15);
EXPECT_NEAR(1.5*std::sqrt(r2), ph(r2, 1), 1e-15);
EXPECT_NEAR(0, ph(r0, 2), 1e-15);
EXPECT_NEAR(0.75/std::sqrt(r2), ph(r2, 2), 1e-15);
EXPECT_NEAR(0, ph(r0, 3), 1e-15);
EXPECT_NEAR(-0.375 / r2 / std::sqrt(r2), ph(r2, 3), 1e-15);
}
TEST(Approximations, DISABLED_PolyharmonicUsageExample) {
Polyharmonic<double, 3> ph;
double val = ph(4.0);
double der = ph(0.0, 2);
std::cout << ph << std::endl;
std::cout << val << der;
}
}