Core 1.0
Septic Class Reference

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.
 
 Septic (const Quintic &)
 Creates a septic given a quintic.
 
 Septic (const Quadric &)
 Creates a septic given a quadric.
 
 Septic (const Cubic &)
 Creates a septic given a cubic.
 
 Septic (const Quartic &)
 Creates a septic given a quartic.
 
 ~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.
 
Septicoperator+= (const Septic &)
 Destructive sum of two septics.
 
Septicoperator-= (const Septic &)
 Destructive difference of two septics.
 
Septicoperator*= (const double &)
 Scale a septics by a double value.
 
Septicoperator/= (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.
 
constexpr double operator() (const double &) const
 Evaluates the septic.
 
constexpr double Derivative (const double &) const
 Computes the derivative of the septic.
 
int Solve (double *) const
 Solve the septics equation over a given interval.
 
int Solve (double *, const double &, const double &) const
 Search the roots of a septic equation over a given interval.
 
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.
 

Static Public Member Functions

static double Smooth (const double &)
 Compute the value of smooth C3 interpolating function over unit interval.
 
static double SmoothStep (const double &, const double &, const double &)
 Compute a septic smooth step.
 
static double Gaussian (const double &, const double &, const double &)
 Compute a compactly supported Gaussian-like pulse.
 
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].
 

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 &u, const Septic &v)
 Overloaded.
 
Septic operator- (const Septic &v, const Septic &u)
 Overloaded.
 
Septic operator* (const Septic &u, const double &e)
 Overloaded.
 
Septic operator* (const double &a, const Septic &p)
 Overloaded.
 
Septic operator/ (const Septic &p, const double &a)
 Overloaded.
 
std::ostream & operator<< (std::ostream &s, const Septic &p)
 Overloaded output-stream operator.
 

Detailed Description

Septic (heptic) polynomials.

Constructors should provide the coefficients in descending order. Example of how to code the septic 12x7-x+1:

Septic p(12.0,0.0,0.0,0.0,0.0,-1.0,1.0);
Septic()
Empty.
Definition septic.h:12

Constructor & Destructor Documentation

◆ Septic() [1/5]

Septic::Septic ( const Sextic & p)
inline

Creates a septic given a sextic.

Simply set higher coefficients to 0.

Parameters
pQuintic.

◆ Septic() [2/5]

Septic::Septic ( const Quintic & p)
inline

Creates a septic given a quintic.

Simply set higher coefficients to 0.

Parameters
pQuintic.

◆ Septic() [3/5]

Septic::Septic ( const Quadric & p)
inline

Creates a septic given a quadric.

Simply set higher coefficients to 0.

Parameters
pQuadric.

◆ Septic() [4/5]

Septic::Septic ( const Cubic & p)
inline

Creates a septic given a cubic.

Simply set higher coefficients to 0.

Parameters
pCubic.

◆ Septic() [5/5]

Septic::Septic ( const Quartic & p)
inline

Creates a septic given a quartic.

Parameters
pQuartic.

Member Function Documentation

◆ Derivative()

double Septic::Derivative ( const double & x) const
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.

Parameters
xReal.

◆ Gaussian()

double Septic::Gaussian ( const double & c,
const double & r,
const double & x )
inlinestatic

Compute a compactly supported Gaussian-like pulse.

The function has C3 continuity.

See also
Cubic::Gaussian() and Quintic::Gaussian()
Parameters
cCenter.
rRadius.
xValue.

◆ Hermite()

Septic Septic::Hermite ( const double & a,
const double & b,
const double & da,
const double & db,
const double & sa,
const double & sb,
const double & ta,
const double & tb )
static

Creates an Hermite septic polynomial on interval [0,1].

Author
Loïs Paulin
Parameters
a,bValues at t=0 and t=1.
da,dbDerivatives.
sa,sbSecond derivatives.
ta,tbThird derivatives.

◆ K()

double Septic::K ( const double & a,
const double & b ) const

Compute the Lipschitz constant of the septic.

Parameters
a,bInterval.

◆ operator()()

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

Evaluates the septic.

Parameters
xArgument value of the function.

◆ Range()

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.

Parameters
a,bInterval.
x,yReturned range.

◆ Smooth()

double Septic::Smooth ( const double & x)
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.

Parameters
xArgument in [0,1].
See also
Quintic::Smooth(), Cubic::Smooth()

◆ SmoothStep()

double Septic::SmoothStep ( const double & x,
const double & a,
const double & b )
inlinestatic

Compute a septic smooth step.

The code is slightly more efficient than:

double y=Septic::Smooth(Linear::Step(x,a,b));
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 C3 interpolating function over unit interval.
Definition septic.h:238
Parameters
xInput value.
a,bInterval values.
See also
Cubic::SmoothStep(), Quintic::SmoothStep()

◆ Solve() [1/2]

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.

Parameters
rootsThe array of roots.

◆ Solve() [2/2]

int Septic::Solve ( double * roots,
const double & a,
const double & b ) const

Search the roots of a septic equation over a given interval.

Parameters
rootsArray for storing the roots.
a,bInterval range.

Friends And Related Symbol Documentation

◆ operator<<

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

Overloaded output-stream operator.

Parameters
sStream.
pThe septic.