![]() |
Rosetta Utilities
2015.09
|
#include <polynomial.hh>
Public Member Functions | |
Polynomial_1d (std::string const &polynomial_name, Real const xmin, Real const xmax, Real const min_val, Real const max_val, Real const root1, Real const root2, Size degree, utility::vector1< Real > const &coefficients) | |
ctor More... | |
Polynomial_1d (Polynomial_1d const &src) | |
virtual | ~Polynomial_1d () |
void | check_invariants () const |
std::string | name () const |
Real | xmin () const |
Real | xmax () const |
Real | min_val () const |
Real | max_val () const |
Real | root1 () const |
Real | root2 () const |
Size | degree () const |
utility::vector1< Real > const & | coefficients () const |
void | operator() (double const variable, double &value, double &deriv) const |
Evaluate the polynomial and its derivative. More... | |
double | eval (double const variable) |
just evaluate the polynomial, w/o derivatives More... | |
void | show (std::ostream &out) const |
![]() | |
ReferenceCount () | |
Default constructor. More... | |
virtual | ~ReferenceCount () |
Private Attributes | |
std::string | polynomial_name_ |
Real | xmin_ |
Real | xmax_ |
Real | min_val_ |
Real | max_val_ |
Real | root1_ |
Real | root2_ |
Size | degree_ |
utility::vector1< Real > | coefficients_ |
Additional Inherited Members | |
![]() | |
typedef platform::Size | Size |
typedef platform::Size | size_type |
numeric::Polynomial_1d::Polynomial_1d | ( | std::string const & | polynomial_name, |
Real const | xmin, | ||
Real const | xmax, | ||
Real const | min_val, | ||
Real const | max_val, | ||
Real const | root1, | ||
Real const | root2, | ||
Size | degree, | ||
utility::vector1< Real > const & | coefficients | ||
) |
ctor
References check_invariants().
numeric::Polynomial_1d::Polynomial_1d | ( | Polynomial_1d const & | src | ) |
References check_invariants().
|
virtual |
void numeric::Polynomial_1d::check_invariants | ( | ) | const |
References coefficients_, degree_, xmax_, and xmin_.
Referenced by Polynomial_1d().
References coefficients_.
double numeric::Polynomial_1d::eval | ( | double const | variable | ) |
string numeric::Polynomial_1d::name | ( | ) | const |
References polynomial_name_.
void numeric::Polynomial_1d::operator() | ( | double const | variable, |
double & | value, | ||
double & | deriv | ||
) | const |
Evaluate the polynomial and its derivative.
evaluate the polynomial and its derivative.
operator()
variable | - [in] - evaluate polynomial(value) |
value | - [out] - returned output |
deriv | - [out] - returned output |
Polynomial value and derivative using Horner's rule value = Sum_(i = 1,...,N) [ coeff_i * variable^(i-1) ] deriv = Sum_(i = 2,...,N) [ ( i - 1 ) * coeff_i * variable^(i-2) ] JSS: Horner's rule for evaluating polynomials is based on rewriting the polynomial as: JSS: p(x) = a0 + x*(a1 + x*(a2 + x*(... x*(aN)...))) JSS: or value_k = a_k + x*value_k+1 for k = N-1 to 0 JSS: and the derivative is JSS: deriv_k = value_k+1 + deriv_k+1 for k = N-1 to 1
References coefficients_, degree_, max_val_, min_val_, xmax_, and xmin_.
void numeric::Polynomial_1d::show | ( | std::ostream & | out | ) | const |
References coefficients_, degree_, max_val_, min_val_, polynomial_name_, root1_, root2_, xmax_, and xmin_.
Referenced by numeric::operator<<().
|
private |
Referenced by check_invariants(), coefficients(), eval(), operator()(), and show().
|
private |
Referenced by check_invariants(), degree(), eval(), operator()(), and show().
|
private |
Referenced by eval(), max_val(), operator()(), and show().
|
private |
Referenced by eval(), min_val(), operator()(), and show().
|
private |
Referenced by check_invariants(), eval(), operator()(), show(), and xmax().
|
private |
Referenced by check_invariants(), eval(), operator()(), show(), and xmin().