#include <Function.hpp>
Public Member Functions |
| | Function () |
| virtual double | getValue (const double x) const |
| | Evaluate the function at x.
|
| virtual void | setScale (const double x) |
| virtual double | getDf (const double x) const |
| | Evaluate the first-order derivative at x.
|
| virtual double | getFrequency () const |
| | return the central frequency
|
| double | rtnewt (const double x1, const double x2, const double xacc) const |
| | Use the Newton-Raphson method, find the root of a function known to line in the interval [x1, x2].
|
| double | rtsecan (double xn_1, double xn, const double xacc) const |
| | o * Use the secant method to find the root of a function with the initial guess at xn_1 and xn.
|
| virtual | ~Function () |
Constructor & Destructor Documentation
| virtual Function::~Function |
( |
| ) |
|
|
inlinevirtual |
Member Function Documentation
| double Function::getDf |
( |
const double |
x | ) |
const |
|
virtual |
| double Function::getFrequency |
( |
| ) |
const |
|
virtual |
| double Function::getValue |
( |
const double |
x | ) |
const |
|
virtual |
| double Function::rtnewt |
( |
const double |
x1, |
|
|
const double |
x2, |
|
|
const double |
xacc |
|
) |
| const |
Use the Newton-Raphson method, find the root of a function known to line in the interval [x1, x2].
The root rtnewt will be refined until its accuracy in known within +/-xacc. The maximum number of iteration is 1e5. See Numerical Recipes [Pre02] for the algorithm.
- Parameters
-
| x1 | lower bound |
| x2 | upper bound |
| xacc | tolerance on the derivative at current x |
| double Function::rtsecan |
( |
double |
xn_1, |
|
|
double |
xn, |
|
|
const double |
xacc |
|
) |
| const |
o * Use the secant method to find the root of a function with the initial guess at xn_1 and xn.
The method stop if it exceeds the maximum number of iteration IMAX = 100 or if |xn-xn_1| < xacc.
- Parameters
-
| xn_1 | initial guess at n-1 |
| xn | initial guess at n |
| xacc | distance between xn_1 and xn |
| void Function::setScale |
( |
const double |
x | ) |
|
|
virtual |
The documentation for this class was generated from the following files: