Core 1.0
|
Septic (heptic) polynomials. More...
#include <septic.h>
Public Member Functions | |
Septic () | |
Empty. | |
Septic (const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &) | |
Creates a septic polynomial. | |
Septic (const Sextic &) | |
Creates a septic given a sextic. More... | |
Septic (const Quintic &) | |
Creates a septic given a quintic. More... | |
Septic (const Quadric &) | |
Creates a septic given a quadric. More... | |
Septic (const Cubic &) | |
Creates a septic given a cubic. More... | |
Septic (const Quartic &) | |
Creates a septic given a quartic. More... | |
~Septic () | |
Empty. | |
constexpr double & | operator[] (int) |
Access to the coefficients of the septic. | |
constexpr double | operator[] (int) const |
Overloaded. | |
int | CheckDegree () const |
Check the degree of the septic. | |
Septic | operator- () const |
Unary. | |
Septic & | operator+= (const Septic &) |
Destructive sum of two septics. | |
Septic & | operator-= (const Septic &) |
Destructive difference of two septics. | |
Septic & | operator*= (const double &) |
Scale a septics by a double value. | |
Septic & | operator/= (const double &) |
Scale a septics by a double value. | |
Sextic | Prime () const |
Computes the first derivative of a septic, which is a quintic. | |
Quintic | Second () const |
Computes the second derivative of a septic. | |
Quartic | Third () const |
Computes the third derivative of a septic. | |
double | K (const double &, const double &) const |
Compute the Lipschitz constant of the septic. More... | |
constexpr double | operator() (const double &) const |
Evaluates the septic. More... | |
constexpr double | Derivative (const double &) const |
Computes the derivative of the septic. More... | |
int | Solve (double *) const |
Solve the septics equation over a given interval. More... | |
int | Solve (double *, const double &, const double &) const |
Search the roots of a septic equation over a given interval. More... | |
void | Range (double &, double &, const double &=0.0, const double &=1.0) const |
Compute the range of values taken by a septic over a given interval. More... | |
Static Public Member Functions | |
static double | Smooth (const double &) |
Compute the value of smooth C3 interpolating function over unit interval. More... | |
static double | SmoothStep (const double &, const double &, const double &) |
Compute a septic smooth step. More... | |
static double | Gaussian (const double &, const double &, const double &) |
Compute a compactly supported Gaussian-like pulse. More... | |
static Septic | Hermite (const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &) |
Creates an Hermite septic polynomial on interval [0,1]. More... | |
Static Public Attributes | |
static double | epsilon = 1.0e-10 |
Epsilon value used to check discriminant terms in the root finding process. | |
Protected Attributes | |
double | c [8] = { 0.0 } |
Array of coefficients. | |
Friends | |
Septic | operator+ (const Septic &, const Septic &) |
Overloaded. | |
Septic | operator- (const Septic &, const Septic &) |
Overloaded. | |
Septic | operator* (const Septic &, const double &) |
Overloaded. | |
Septic | operator* (const double &, const Septic &) |
Overloaded. | |
Septic | operator/ (const Septic &, const double &) |
Overloaded. | |
std::ostream & | operator<< (std::ostream &, const Septic &) |
Overloaded output-stream operator. More... | |
Septic (heptic) polynomials.
Constructors should provide the coefficients in descending order. Example of how to code the septic 12x7-x+1:
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Computes the derivative of the septic.
This function is more efficient than using Prime() and then evaluating the derivative for a given input value.
x | Real. |
|
inlinestatic |
Compute a compactly supported Gaussian-like pulse.
The function has C3 continuity.
c | Center. |
r | Radius. |
x | Value. |
|
static |
Creates an Hermite septic polynomial on interval [0,1].
a,b | Values at t=0 and t=1. |
da,db | Derivatives. |
sa,sb | Second derivatives. |
ta,tb | Third derivatives. |
double Septic::K | ( | const double & | a, |
const double & | b | ||
) | const |
Compute the Lipschitz constant of the septic.
a,b | Interval. |
|
inlineconstexpr |
Evaluates the septic.
x | Argument value of the function. |
void Septic::Range | ( | double & | x, |
double & | y, | ||
const double & | a = 0.0 , |
||
const double & | b = 1.0 |
||
) | const |
Compute the range of values taken by a septic over a given interval.
a,b | Interval. |
x,y | Returned range. |
|
inlinestatic |
Compute the value of smooth C3 interpolating function over unit interval.
The septic is defined as x4(-20 x3 + 70 x2 -84 x + 35). Its first, second and third derivatives at 0.0 and 1.0 are 0.0.
The Lipschitz constant of the smooth septic over [0,1] is λ=35/16.
x | Argument in [0,1]. |
|
inlinestatic |
Compute a septic smooth step.
The code is slightly more efficient than:
x | Input value. |
a,b | Interval values. |
int Septic::Solve | ( | double * | roots | ) | const |
Solve the septics equation over a given interval.
This function stores the sorted roots in an array and returns the number of roots.
This function calls Polynomial::Solve() if the highest coefficient is not nul, otherwise it calls Quartic::Solve() and other lower degree polynomial solvers which are more efficient.
roots | The array of roots. |
int Septic::Solve | ( | double * | roots, |
const double & | a, | ||
const double & | b | ||
) | const |
Search the roots of a septic equation over a given interval.
roots | Array for storing the roots. |
a,b | Interval range. |
|
friend |
Overloaded output-stream operator.
s | Stream. |
p | The septic. |