ReFRACtor
|
A one-dimensional polynomial class. More...
#include <polynomial_eval.h>
Public Member Functions | |
Poly1d (const ArrayAd< double, 1 > &Coefficients, const bool Decreasing_order=true) | |
The polynomial's coefficients, in decreasing powers. More... | |
double | operator() (double Value) const |
Evaluate polynomial for a value. More... | |
AutoDerivative< double > | operator() (const AutoDerivative< double > &Value) const |
blitz::Array< double, 1 > | operator() (const blitz::Array< double, 1 > &Arr) const |
Evaluate polynomial for an array. More... | |
ArrayAd< double, 1 > | operator() (const ArrayAd< double, 1 > &Arr) const |
virtual void | print (std::ostream &Os) const |
std::string | print_to_string () const |
Print to string. More... | |
A one-dimensional polynomial class.
A convenience class, used to encapsulate "natural" operations on polynomials so that said operations may take on their customary form in code.
Evaluation is done Horner's Scheme to reduce problems due to round off error and overflows.
Inspired by numpy.poly1d
Additionally handles ArrayAd data correctly.
Definition at line 21 of file polynomial_eval.h.
|
inline |
The polynomial's coefficients, in decreasing powers.
Definition at line 27 of file polynomial_eval.h.
double Poly1d::operator() | ( | double | Value | ) | const |
Evaluate polynomial for a value.
Definition at line 6 of file polynomial_eval.cc.
AutoDerivative< double > Poly1d::operator() | ( | const AutoDerivative< double > & | Value | ) | const |
Definition at line 17 of file polynomial_eval.cc.
Array< double, 1 > Poly1d::operator() | ( | const blitz::Array< double, 1 > & | Arr | ) | const |
Evaluate polynomial for an array.
Definition at line 37 of file polynomial_eval.cc.
Definition at line 29 of file polynomial_eval.cc.
|
virtual |
Definition at line 57 of file polynomial_eval.cc.
|
inlineinherited |
Print to string.
This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.
Definition at line 31 of file printable.h.