Definition at line 27 of file CubicHermiteSplineTest.cpp.
◆ Run()
void CubicHermiteSplineTest::Run |
( |
| ) |
|
|
inline |
◆ SetUp()
virtual void CubicHermiteSplineTest::SetUp |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ TearDown()
void CubicHermiteSplineTest::TearDown |
( |
| ) |
|
|
inlineprotected |
◆ InterpolationTest()
void CubicHermiteSplineTest::InterpolationTest |
( |
| ) |
|
|
inlineprotected |
Definition at line 47 of file CubicHermiteSplineTest.cpp.
References diff(), pwiz::analysis::CubicHermiteSpline::Interpolate(), N, ralab::constants::PI(), unit_assert, x, and y.
71 y.push_back(-5.89868e-005);
72 y.push_back(0.233061);
73 y.push_back(0.216427);
74 y.push_back(0.0486148);
75 y.push_back(-0.133157);
76 y.push_back(-0.172031);
77 y.push_back(-0.0456079);
78 y.push_back(0.0906686);
79 y.push_back(0.116462);
80 y.push_back(0.0557287);
81 y.push_back(-0.03875);
82 y.push_back(-0.10346);
83 y.push_back(-0.0734111);
84 y.push_back(0.0298435);
85 y.push_back(0.094886);
86 y.push_back(0.0588743);
87 y.push_back(-0.0171021);
88 y.push_back(-0.0630512);
89 y.push_back(-0.0601684);
90 y.push_back(-0.00994154);
94 const double PI = 3.1415;
97 double step = 4 * PI / (N - 1);
98 for (
int i = 0; i <
N; ++i, xx += step)
101 yIn.push_back(sin(2 * xx) / xx);
105 const int N_out = 20;
107 step = (3 *
PI) / (N_out - 1);
108 for (
int i = 0; i < N_out; ++i, xx += step)
110 double interpolatedX = interpolator.Interpolate(xx);
111 double diff = abs(interpolatedX - y[i]);
void diff(const string &filename1, const string &filename2)
const double PI(3.14159265358979323846264338327950288)
the ratio of the circumference of a circle to its diameter;
An implementation of the IInterpolation interface that acts as a wrapper for a cSpline.
KernelTraitsBase< Kernel >::space_type::abscissa_type x
KernelTraitsBase< Kernel >::space_type::ordinate_type y
◆ CubicSplineDummyInitialize()
void CubicHermiteSplineTest::CubicSplineDummyInitialize |
( |
const vector< double > & |
x, |
|
|
const vector< double > & |
y |
|
) |
| |
|
inlineprotected |
Definition at line 116 of file CubicHermiteSplineTest.cpp.
An implementation of the IInterpolation interface that acts as a wrapper for a cSpline.
◆ ErrorTest()
void CubicHermiteSplineTest::ErrorTest |
( |
| ) |
|
|
inlineprotected |
Definition at line 121 of file CubicHermiteSplineTest.cpp.
References unit_assert_throws_what, x, and y.
134 for (
size_t i = 0; i < x.size(); ++i)
146 for (
size_t i = 0; i < x.size(); ++i)
158 for (
size_t i = 0; i < x.size(); ++i)
#define unit_assert_throws_what(x, exception, whatStr)
void CubicSplineDummyInitialize(const vector< double > &x, const vector< double > &y)
KernelTraitsBase< Kernel >::space_type::abscissa_type x
KernelTraitsBase< Kernel >::space_type::ordinate_type y
◆ DiffAndIntegrateTest()
void CubicHermiteSplineTest::DiffAndIntegrateTest |
( |
| ) |
|
|
inlineprotected |
Definition at line 176 of file CubicHermiteSplineTest.cpp.
References pwiz::analysis::CubicHermiteSpline::Differentiate(), pwiz::analysis::CubicHermiteSpline::Integrate(), pwiz::analysis::CubicHermiteSpline::IsDifferentiable(), pwiz::analysis::CubicHermiteSpline::IsIntegrable(), unit_assert, unit_assert_equal, unit_assert_throws_what, x, and y.
194 if (interpolator.IsDifferentiable())
204 unit_assert_throws_what(interpolator.Differentiate(2.0), runtime_error,
"[CubicHermiteSpline] attempted to differentiate a non-differentiable implementation of IInterpolation.")
207 if (interpolator.IsIntegrable())
217 unit_assert_throws_what(interpolator.Integrate(1.0, 2.0), runtime_error,
"[CubicHermiteSpline] attempted to integrate a non-integrable implementation of IInterpolation.")
#define unit_assert_throws_what(x, exception, whatStr)
#define unit_assert_equal(x, y, epsilon)
An implementation of the IInterpolation interface that acts as a wrapper for a cSpline.
KernelTraitsBase< Kernel >::space_type::abscissa_type x
KernelTraitsBase< Kernel >::space_type::ordinate_type y
The documentation for this class was generated from the following file: