|
Core 1.0
|
Octic polynomials. More...
#include <octic.h>
Public Member Functions | |
| Octic () | |
| Empty. | |
| Octic (const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &) | |
| Creates a Octic polynomial. | |
| Octic (const Septic &) | |
| Creates an octic given a septic. The degree-8 coefficient is set to zero. | |
| Octic (const Sextic &) | |
| Creates an octic given a sextic. Higher coefficients are set to zero. | |
| Octic (const Quintic &) | |
| Creates an octic given a quintic. Higher coefficients are set to zero. | |
| Octic (const Quartic &) | |
| Creates an octic given a quartic. Higher coefficients are set to zero. | |
| Octic (const Cubic &) | |
| Creates an octic given a cubic. Higher coefficients are set to zero. | |
| Octic (const Quadric &) | |
| Creates an octic given a quadric. Higher coefficients are set to zero. | |
| ~Octic () | |
| Empty. | |
| constexpr double & | operator[] (int) |
| Access to the coefficients of the octic. | |
| constexpr double | operator[] (int) const |
| Overloaded. | |
| int | CheckDegree () const |
| Check the degree of the octic. | |
| Octic | operator- () const |
| Unary. | |
| Octic & | operator+= (const Octic &) |
| Destructive sum of two octics. | |
| Octic & | operator-= (const Octic &) |
| Destructive difference of two octics. | |
| Octic & | operator*= (const double &) |
| Scale an octic by a double value. | |
| Octic & | operator/= (const double &) |
| Scale an octic by a double value. | |
| int | Solve (double *) const |
| Solve the octic equation. | |
| int | Solve (double *, const double &, const double &) const |
| Search the roots of an octic equation within a given interval. | |
| Septic | Prime () const |
| Computes the first derivative of a Octic. | |
| Sextic | Second () const |
| Computes the second derivative of a Octic. | |
| Quintic | Third () const |
| Computes the third derivative of a Octic. | |
| constexpr double | operator() (const double &) const |
| Evaluates the Octic. | |
| constexpr double | Derivative (const double &) const |
| Computes the derivative of the octic. | |
Static Public Attributes | |
| static const double | epsilon = 1.0e-10 |
| Epsilon value used to check discriminant terms in the root finding process. | |
Protected Attributes | |
| double | c [9] = { 0.0 } |
| Array of coefficients. | |
Friends | |
| Octic | operator+ (const Octic &u, const Octic &v) |
| Overloaded. | |
| Octic | operator- (const Octic &v, const Octic &u) |
| Overloaded. | |
| Octic | operator* (const Octic &u, const double &e) |
| Overloaded. | |
| Octic | operator* (const double &a, const Octic &p) |
| Overloaded. | |
| Octic | operator/ (const Octic &p, const double &a) |
| Overloaded. | |
| Octic | operator* (const Quartic &u, const Quartic &v) |
| Multiply two quartics. | |
| Octic | operator* (const Sextic &s, const Quadric &q) |
| Multiply a sextic by a quadric. | |
| std::ostream & | operator<< (std::ostream &s, const Octic &p) |
| Overloaded output-stream operator. | |
Octic polynomials.
Constructors should provide the coefficients in descending order. Example of how to code the octic \( 19x^8 - x + 1 \):
|
inline |
Creates an octic given a septic. The degree-8 coefficient is set to zero.
| p | Septic. |
|
inline |
Creates an octic given a sextic. Higher coefficients are set to zero.
| p | Sextic. |
|
inline |
Creates an octic given a quintic. Higher coefficients are set to zero.
| p | Quintic. |
|
inline |
Creates an octic given a quartic. Higher coefficients are set to zero.
| p | Quartic. |
|
inline |
Creates an octic given a cubic. Higher coefficients are set to zero.
| p | Cubic. |
|
inline |
Creates an octic given a quadric. Higher coefficients are set to zero.
| p | Quadric. |
|
inlineconstexpr |
Computes the derivative of the octic.
This function is more efficient than using Prime() and then evaluating the derivative for a given input value.
| x | Real. |
|
inlineconstexpr |
Evaluates the Octic.
| x | Argument value of the function. |
| int Octic::Solve | ( | double * | roots | ) | const |
Solve the octic equation.
Calls Polynomial::Solve() when the leading coefficient is non-zero. Otherwise cascades to lower-degree solvers (Septic down to Quadric) by dropping zero leading coefficients.
| roots | The array of roots. |
| int Octic::Solve | ( | double * | roots, |
| const double & | a, | ||
| const double & | b ) const |
Search the roots of an octic equation within a given interval.
| roots | Array for storing the roots. |
| a,b | Interval range. |
Multiply two quartics.
| u,v | Argument quartics. |
Multiply a sextic by a quadric.
| s | Sextic. |
| q | Quadric. |