50 template <
typename ScalarT>
51 void func(ScalarT& f,
const ScalarT& x) {
55 int main(
int argc,
char **argv)
67 for (
int k=0; k<deg; k++) {
78 std::cout <<
"Taylor series solution = " << std::endl
89 std::cout <<
"Exact expansion = " << std::endl
95 for (
int k=0; k<=deg; k++) {
97 if (err > max_err) max_err = err;
99 std::cout <<
"Maximum relative error = " << max_err << std::endl;
101 double tol = 1.0e-12;
103 std::cout <<
"\nExample passed!" << std::endl;
107 std::cout <<
"\nSomething is wrong, example failed!" << std::endl;
void resize(int d, bool keep_coeffs)
Resize polynomial to degree d.
T & fastAccessCoeff(int i)
Returns degree i term without bounds checking.
const T * coeff() const
Returns Taylor coefficient array.
void reserve(int d)
Reserve space for a degree d polynomial.
const T func(int n, T *x)