Medusa  1.1
Coordinate Free Mehless Method implementation
test/approximations/WeightFunction_test.cpp
#include "gtest/gtest.h"
namespace mm {
TEST(Approximations, RBFWeight2D) {
double s = 1.23;
RBFWeight<Gaussian<double>, Vec2d> weight(s);
Vec2d p(1.37, -0.97);
EXPECT_NEAR(0.15528149718493840, weight(p), 1e-15);
// EXPECT_NEAR(-0.28122896575235060, weight(p, {1, 0}), 1e-14);
// EXPECT_NEAR(0.545584193559560000, weight(p, {1, 1}), 1e-14);
// EXPECT_NEAR(0.050053899223872840, weight(p, {0, 2}), 1e-12);
}
TEST(Approximations, DISABLED_RBFWeightUsageExample) {
double s = 1.23;
RBFWeight<Gaussian<double>, Vec2d> weight(s);
Vec2d p(1.37, -0.97);
double val = weight(p);
std::cout << weight << std::endl;
(void) val;
}
} // namespace mm
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
Vec_fwd.hpp
Gaussian.hpp
WeightFunction.hpp
mm::Vec2d
Vec< double, 2 > Vec2d
Convenience typedef for 2d vector of doubles.
Definition: Vec_fwd.hpp:34