15 #include <gtest/gtest.h> 19 #include "../../include/ecl/geometry/smooth_linear_spline.hpp" 25 using std::cout;
using std::endl;
36 TEST(SmoothLinearSplinesTests,allEggsInOneBasket) {
44 int main(
int argc,
char **argv) {
46 Format<string> string_format; string_format.width(8); string_format.align(RightAlign);
47 Format<double> format; format.width(8); format.precision(2); format.align(RightAlign);
54 x_set << 0.0, 1.0, 2.0, 3.0, 4.0, 5.0;
55 y_set << 1.0, 2.0, 1.0, 3.0, 4.0, 4.0;
56 const double a_max = 10.0;
59 cout <<
"***********************************************************" << endl;
60 cout <<
" Smooth Linear Spline Constructor" << endl;
61 cout <<
"***********************************************************" << endl;
68 cout <<
"***********************************************************" << endl;
69 cout <<
" Output" << endl;
70 cout <<
"***********************************************************" << endl;
74 cout << string_format(
"x ");
75 cout << string_format(
"y ");
76 cout << string_format(
"y' ");
77 cout << string_format(
"y''") << endl;
78 for (
int i = 0; i <= n; ++i ) {
79 double x = x_set[0] + i*(x_set.
back()-x_set.
front())/n;
81 cout << format(spline(x));
87 cout <<
"***********************************************************" << endl;
88 cout <<
" Passed" << endl;
89 cout <<
"***********************************************************" << endl;
92 testing::InitGoogleTest(&argc,argv);
93 return RUN_ALL_TESTS();
Storage container for a smoothed linear spline interpolation.
double dderivative(const double &x) const ecl_assert_throw_decl(StandardException)
Spline second derivative.
int main(int argc, char **argv)
TEST(SmoothLinearSplinesTests, allEggsInOneBasket)
double derivative(const double &x) const ecl_assert_throw_decl(StandardException)
Spline derivative.