Nonic polynomials.
More...
#include <nonic.h>
|
| Nonic () |
| Empty.
|
|
| Nonic (const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &) |
| Creates a Nonic polynomial.
|
|
| ~Nonic () |
| Empty.
|
|
constexpr double & | operator[] (int) |
| Access to the coefficients of the sextic.
|
|
constexpr double | operator[] (int) const |
| Overloaded.
|
|
int | CheckDegree () const |
| Check the degree of the Nonic.
|
|
Nonic | operator- () const |
| Unary.
|
|
Nonic & | operator+= (const Nonic &) |
| Destructive sum of two Nonics.
|
|
Nonic & | operator-= (const Nonic &) |
| Destructive difference of two Nonics.
|
|
Nonic & | operator*= (const double &) |
| Scale a Nonics by a double value.
|
|
Nonic & | operator/= (const double &) |
| Scale a Nonics by a double value.
|
|
int | Solve (double *) const |
| Solve the octic equation over a given interval.
|
|
Octic | Prime () const |
| Computes the first derivative of a septic, which is a quintic.
|
|
Septic | Second () const |
| Computes the second derivative of a Nonic.
|
|
Sextic | Third () const |
| Computes the third derivative of a Nonic.
|
|
constexpr double | operator() (const double &) const |
| Evaluates the Nonic.
|
|
constexpr double | Derivative (const double &) const |
| Computes the derivative of the sextic.
|
|
|
static Nonic | Compose (const Cubic &, const Cubic &) |
| Compose the cubic by another one.
|
|
static double | Smooth (const double &) |
| Compute the value of smooth C4 interpolating function over unit interval.
|
|
static double | SmoothStep (const double &, const double &, const double &) |
| Compute a Nonic smooth step.
|
|
static double | Gaussian (const double &, const double &, const double &) |
| Compute a compactly supported Gaussian-like pulse.
|
|
|
static double | epsilon = 1.0e-10 |
| Epsilon value used to check discriminant terms in the root finding process.
|
|
|
double | c [10] = { 0.0 } |
| Array of coefficients.
|
|
|
Nonic | operator+ (const Nonic &u, const Nonic &v) |
| Overloaded.
|
|
Nonic | operator- (const Nonic &v, const Nonic &u) |
| Overloaded.
|
|
Nonic | operator* (const Nonic &u, const double &e) |
| Overloaded.
|
|
Nonic | operator* (const double &a, const Nonic &p) |
| Overloaded.
|
|
Nonic | operator/ (const Nonic &p, const double &a) |
| Overloaded.
|
|
std::ostream & | operator<< (std::ostream &s, const Nonic &p) |
| Overloaded output-stream operator.
|
|
Nonic polynomials.
Constructors should provide the coefficients in descending order. Example of how to code the Nonic 19x9-x+1:
Nonic p(19.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,1.0);
Nonic()
Empty.
Definition nonic.h:12
◆ Compose()
Compose the cubic by another one.
This function computes p ( q(x) ), where p denotes the cubic and q the argument.
- Parameters
-
q | The cubic. |
p | The argument cubic. |
◆ Derivative()
double Nonic::Derivative |
( |
const double & | x | ) |
const |
|
inlineconstexpr |
Computes the derivative of the sextic.
This function is more efficient than using Prime() and then evaluating the derivative for a given input value.
- Parameters
-
◆ Gaussian()
double Nonic::Gaussian |
( |
const double & | c, |
|
|
const double & | r, |
|
|
const double & | x ) |
|
inlinestatic |
◆ operator()()
double Nonic::operator() |
( |
const double & | x | ) |
const |
|
inlineconstexpr |
Evaluates the Nonic.
- Parameters
-
x | Argument value of the function. |
◆ Smooth()
double Nonic::Smooth |
( |
const double & | x | ) |
|
|
inlinestatic |
Compute the value of smooth C4 interpolating function over unit interval.
The Nonic is defined as x4(-20 x3 + 70 x2 -84 x + 35). Its first four derivatives at 0.0 and 1.0 are 0.0.
The Lipschitz constant of the smooth nonic over [0,1] is λ=315/128.
- Parameters
-
- See also
- Septic::Smooth(), Quintic::Smooth(), Cubic::Smooth()
◆ SmoothStep()
double Nonic::SmoothStep |
( |
const double & | x, |
|
|
const double & | a, |
|
|
const double & | b ) |
|
inlinestatic |
Compute a Nonic smooth step.
The code is slightly more efficient than:
static double Step(const double &, const double &, const double &)
Create a linear step.
Definition linear.h:195
static double Smooth(const double &)
Compute the value of smooth C4 interpolating function over unit interval.
Definition nonic.h:154
- Parameters
-
x | Input value. |
a,b | Interval values. |
- See also
- Septic::SmoothStep(), Cubic::SmoothStep(), Quintic::SmoothStep()
◆ Solve()
int Nonic::Solve |
( |
double * | roots | ) |
const |
Solve the octic equation over a given interval.
- Parameters
-
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | s, |
|
|
const Nonic & | p ) |
|
friend |
Overloaded output-stream operator.
- Parameters
-