IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Num::Func::Cubic Class Reference

Cubic function, f(x) = a3*x*x*x + a2*x*x + a1*x + a0. Specific properties: Zero - returns a zero. Zero1 - returns the fierst zero. Zero2 - returns the second zero. Zero3 - returns the third zero. NumZeros - returns number of zeros (0, 1 or 3). HasZero - either the function has a zero or not. Min - returns function's strict minimum. Max - returns function's strict maximum. More...

Inheritance diagram for IG::Num::Func::Cubic:
Collaboration diagram for IG::Num::Func::Cubic:

List of all members.

Public Member Functions

 Cubic (double a3, double a2, double a1, double a0)
 Creates a cubic function, coefficients are specified in the descending order.
void SetCoefficients (double a3, double a2, double a1, double a0)
 Sets coefficients of the cubic function represented by the current object.
void SetInterpolation (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
 Initializes the cubic interpolation function with specified four function values.
void SetInterpolation (double x1, double y1, double d1, double x2, double y2, double d2)
 Initializes the cubic interpolation function with specified two function values and one derivative.
int Zeros (out double x1, out double x2, out double x3)
 Calculates and returns real zeros of the function. Also returns the number of real zeros (0, 1 or 3).
override bool HigherDerivativeDefined (int order)
 Tells whether the derivative of the given order is defined for this function (by implementation, not mathematically)

Protected Member Functions

override double RefValue (double x)
 Returns the value of reference (untransformed) function.
override double RefDerivative (double x)
 Returns the first derivative of reference (untransformed) function.
override double RefSecondDerivative (double x)
 Returns the second derivative of the given order of reference (untransformed) function.
override double RefDerivative (double x, int order)
 Returns the derivative of the given order of reference (untransformed) function.
internal override void setHighestDerivativeDefined (int order)
 Sets the internal variable that specifies which is the highest order derivative devined (-1 for unlimited).
override double RefIntegral (double x)
 Returns definite integral of reference (untransformed) function from 0 to the function argument.
override double RefInverse (double y)
 Returns inverse of the reference (untransformed) function.

Protected Attributes

double _a0

Properties

object Lock [get]
 This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.
double a0 [get, set]
 Returns the constant term coefficient of the cubic function.
double a1 [get, set]
 Returns the linear term coefficitne of the cubic function.
double a2 [get, set]
 Returns the quadratic term coefficitne of the cubic function.
double a3 [get, set]
 Returns the cubic term coefficitne of the cubic function.
Quadratic RefQuad [get]
double Zero [get]
 Returns the first zero of the current cubic function. Throws InvalidOperationException if the function does not have real zeros.
double Zero1 [get]
 Returns the first zero of the current cubic function. Throws InvalidOperationException if the function does not have real zeros.
double Zero2 [get]
 Returns the second zero of the current cubic function. Throws InvalidOperationException if the function does not have two distinct real zeros.
double Zero3 [get]
 Returns the third zero of the current cubic function. Throws InvalidOperationException if the function does not have three distinct real zeros.
bool HasZero [get]
 Returns true if this cubic function has at least one real zero, false otherwise.
int NumZeros [get]
 Returns number of zeros of the current cubic function.
bool HasMaximum [get]
 Returns true if this cubic function has a strict maximum.
double Maximum [get]
 Gets strict maximum of this cubic function. If the function does not have one then exeption is thrown.
bool HasMinimum [get]
 Returns true if this cubic function has a strict minimum.
double Minimum [get]
 Gets strict minimum of this cubic function. If the function does not have one then exeption is thrown.
override bool ValueDefined [get, set]
 Tells whether value of the function is defined by implementation.
override bool DerivativeDefined [get, set]
 Tells whether the first derivative is defined for this function (by implementation, not mathematically)
override bool SecondDerivativeDefined [get, set]
 Tells whether the second derivative is defined for this function (by implementation, not mathematically)
override bool IntegralDefined [get, set]
 Tells whether analytical itegral of the function is defined or not.
Cubic RefInv [get]
override bool InverseDefined [get, set]
 Tells whether analytical inverse function is defined or not.

Private Member Functions

int Extremes (ref double x1, ref double y1, ref double d1, ref double x2, ref double y2, ref double d2)
 Calculates and returns extremes of the cubic function, and returns number of extremes.

Private Attributes

object _mainLock = new object()
double _a1
double _a2
double _a3
Quadratic _refquad
Cubic _refinv

Detailed Description

Cubic function, f(x) = a3*x*x*x + a2*x*x + a1*x + a0. Specific properties: Zero - returns a zero. Zero1 - returns the fierst zero. Zero2 - returns the second zero. Zero3 - returns the third zero. NumZeros - returns number of zeros (0, 1 or 3). HasZero - either the function has a zero or not. Min - returns function's strict minimum. Max - returns function's strict maximum.


Constructor & Destructor Documentation

IG::Num::Func::Cubic::Cubic ( double  a3,
double  a2,
double  a1,
double  a0 
) [inline]

Creates a cubic function, coefficients are specified in the descending order.

Parameters:
a3cubic term coefficitnt.
a2quadratic term coefficient.
a1linear term coefficient.
a0constant term coefficient.

Member Function Documentation

void IG::Num::Func::Cubic::SetCoefficients ( double  a3,
double  a2,
double  a1,
double  a0 
) [inline]

Sets coefficients of the cubic function represented by the current object.

Parameters:
a3cubic term coefficient.
a2quadratic term coeficient.
a1linear term coefficient.
a0constant term coefficient.
void IG::Num::Func::Cubic::SetInterpolation ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3,
double  x4,
double  y4 
) [inline]

Initializes the cubic interpolation function with specified four function values.

Parameters:
x1Abscissa of the first point.
y1Value at the first point.
x2Abscissa of the second point.
y2Value at the second point.
x3Abscissa of the third point.
y3Value at the third point.
x4Abscissa of the third point.
y4Value at the third point.
void IG::Num::Func::Cubic::SetInterpolation ( double  x1,
double  y1,
double  d1,
double  x2,
double  y2,
double  d2 
) [inline]

Initializes the cubic interpolation function with specified two function values and one derivative.

Parameters:
x1Abscissa of the first point.
y1Value at the first point.
d1Derivative at the first point.
x2Abscissa of the second point.
y2Value at the second point.
d2Derivative at the second point.
int IG::Num::Func::Cubic::Zeros ( out double  x1,
out double  x2,
out double  x3 
) [inline]

Calculates and returns real zeros of the function. Also returns the number of real zeros (0, 1 or 3).

Parameters:
x1The first zero (output parameter).
x2The second zero (output parameter).
x3The third real zero (output parameter).
Returns:
Number of distinct real zeros.
int IG::Num::Func::Cubic::Extremes ( ref double  x1,
ref double  y1,
ref double  d1,
ref double  x2,
ref double  y2,
ref double  d2 
) [inline, private]

Calculates and returns extremes of the cubic function, and returns number of extremes.

Parameters:
x1Abscissa of the first extreme.
y1Value in the first extreme.
d1Second derivative in the first extreme.
x2Abscissa of the first extreme.
y2Function value in the first extreme.
d2Second derivative in the first extreme.
Returns:
override double IG::Num::Func::Cubic::RefValue ( double  x) [inline, protected, virtual]

Returns the value of reference (untransformed) function.

Reimplemented from IG::Num::RealFunction.

override double IG::Num::Func::Cubic::RefDerivative ( double  x) [inline, protected, virtual]

Returns the first derivative of reference (untransformed) function.

Reimplemented from IG::Num::RealFunction.

override double IG::Num::Func::Cubic::RefSecondDerivative ( double  x) [inline, protected, virtual]

Returns the second derivative of the given order of reference (untransformed) function.

Reimplemented from IG::Num::RealFunction.

override double IG::Num::Func::Cubic::RefDerivative ( double  x,
int  order 
) [inline, protected, virtual]

Returns the derivative of the given order of reference (untransformed) function.

Reimplemented from IG::Num::RealFunction.

override bool IG::Num::Func::Cubic::HigherDerivativeDefined ( int  order) [inline]

Tells whether the derivative of the given order is defined for this function (by implementation, not mathematically)

Implements IG::Num::IRealFunction.

internal override void IG::Num::Func::Cubic::setHighestDerivativeDefined ( int  order) [inline, protected, virtual]

Sets the internal variable that specifies which is the highest order derivative devined (-1 for unlimited).

Parameters:
orderHighest order for which derivative is defined. -1 means that all derivatives are defined.

Reimplemented from IG::Num::RealFunction.

override double IG::Num::Func::Cubic::RefIntegral ( double  x) [inline, protected, virtual]

Returns definite integral of reference (untransformed) function from 0 to the function argument.

Reimplemented from IG::Num::RealFunction.

override double IG::Num::Func::Cubic::RefInverse ( double  y) [inline, protected, virtual]

Returns inverse of the reference (untransformed) function.

Reimplemented from IG::Num::RealFunction.


Member Data Documentation

object IG::Num::Func::Cubic::_mainLock = new object() [private]
double IG::Num::Func::Cubic::_a0 [protected]
double IG::Num::Func::Cubic::_a1 [private]
double IG::Num::Func::Cubic::_a2 [private]
double IG::Num::Func::Cubic::_a3 [private]

Property Documentation

object IG::Num::Func::Cubic::Lock [get]

This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.

Implements IG::Lib::ILockable.

double IG::Num::Func::Cubic::a0 [get, set]

Returns the constant term coefficient of the cubic function.

double IG::Num::Func::Cubic::a1 [get, set]

Returns the linear term coefficitne of the cubic function.

double IG::Num::Func::Cubic::a2 [get, set]

Returns the quadratic term coefficitne of the cubic function.

double IG::Num::Func::Cubic::a3 [get, set]

Returns the cubic term coefficitne of the cubic function.

Quadratic IG::Num::Func::Cubic::RefQuad [get, protected]
double IG::Num::Func::Cubic::Zero [get]

Returns the first zero of the current cubic function. Throws InvalidOperationException if the function does not have real zeros.

double IG::Num::Func::Cubic::Zero1 [get]

Returns the first zero of the current cubic function. Throws InvalidOperationException if the function does not have real zeros.

double IG::Num::Func::Cubic::Zero2 [get]

Returns the second zero of the current cubic function. Throws InvalidOperationException if the function does not have two distinct real zeros.

double IG::Num::Func::Cubic::Zero3 [get]

Returns the third zero of the current cubic function. Throws InvalidOperationException if the function does not have three distinct real zeros.

bool IG::Num::Func::Cubic::HasZero [get]

Returns true if this cubic function has at least one real zero, false otherwise.

int IG::Num::Func::Cubic::NumZeros [get]

Returns number of zeros of the current cubic function.

bool IG::Num::Func::Cubic::HasMaximum [get]

Returns true if this cubic function has a strict maximum.

double IG::Num::Func::Cubic::Maximum [get]

Gets strict maximum of this cubic function. If the function does not have one then exeption is thrown.

bool IG::Num::Func::Cubic::HasMinimum [get]

Returns true if this cubic function has a strict minimum.

double IG::Num::Func::Cubic::Minimum [get]

Gets strict minimum of this cubic function. If the function does not have one then exeption is thrown.

override bool IG::Num::Func::Cubic::ValueDefined [get, set]

Tells whether value of the function is defined by implementation.

Implements IG::Num::IRealFunction.

override bool IG::Num::Func::Cubic::DerivativeDefined [get, set]

Tells whether the first derivative is defined for this function (by implementation, not mathematically)

Implements IG::Num::IRealFunction.

override bool IG::Num::Func::Cubic::SecondDerivativeDefined [get, set]

Tells whether the second derivative is defined for this function (by implementation, not mathematically)

Implements IG::Num::IRealFunction.

override bool IG::Num::Func::Cubic::IntegralDefined [get, set]

Tells whether analytical itegral of the function is defined or not.

Implements IG::Num::IRealFunction.

Cubic IG::Num::Func::Cubic::RefInv [get, protected]
override bool IG::Num::Func::Cubic::InverseDefined [get, set]

Tells whether analytical inverse function is defined or not.

Implements IG::Num::IRealFunction.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events