Core 1.0
Octic Class Reference

Octic polynomials. More...

#include <nonic.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 ()
 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 octic.
 
Octic operator- () const
 Unary.
 
Octicoperator+= (const Octic &)
 Destructive sum of two octics.
 
Octicoperator-= (const Octic &)
 Destructive difference of two octics.
 
Octicoperator*= (const double &)
 Scale an octic by a double value.
 
Octicoperator/= (const double &)
 Scale an octic by a double value.
 
int Solve (double *) const
 Solve the octic equation over 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 sextic.
 

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 [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.
 

Detailed Description

Octic polynomials.

Constructors should provide the coefficients in descending order. Example of how to code the octic 19x8-x+1:

Octic p(19.0,0.0,0.0,0.0,0.0,0.0,-1.0,1.0);
Octic()
Empty.
Definition octic.h:13

Member Function Documentation

◆ Derivative()

double Octic::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
xReal.

◆ operator()()

double Octic::operator() ( const double & x) const
inlineconstexpr

Evaluates the Octic.

Parameters
xArgument value of the function.

◆ Solve()

int Octic::Solve ( double * roots) const

Solve the octic equation over a given interval.

Parameters
rootsRoots.

Friends And Related Symbol Documentation

◆ operator* [1/2]

Octic operator* ( const Quartic & u,
const Quartic & v )
friend

Multiply two quartics.

Parameters
u,vArgument quartics.

◆ operator* [2/2]

Octic operator* ( const Sextic & s,
const Quadric & q )
friend

Multiply a sextic by a quadric.

Parameters
sSextic.
qQuadric.

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const Octic & p )
friend

Overloaded output-stream operator.

Parameters
sStream.
pThe Octic.