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

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Private Attributes

# IG::Num::Func::Quadratic Class Reference

Quadratic function, f(x) = a2*x*x + a1*x + a0. Specific properties: Zero - returns a zero. Zero1 - returns the fierst zero. Zero2 - returns the second zero. NumZeros - 0, 1 or 2, returns number of zeros. HasZero - either the function has a zero or not. More...

Inheritance diagram for IG::Num::Func::Quadratic:
[legend]
Collaboration diagram for IG::Num::Func::Quadratic:
[legend]

List of all members.

## Public Member Functions
| Quadratic (double a2, double a1, double a0)
| Creates a quadratic function, coefficients are specified in the descending order.
void | SetCoefficients (double a2, double a1, double a0)
| Sets coefficients of the quadratic function represented by the current object.
void | SetInterpolation (double x1, double y1, double x2, double y2, double x3, double y3)
| Initializes the quadratic interpolation function with specified three function values.
void | SetInterpolation (double x1, double y1, double d1, double x2, double y2)
| Initializes the quadratic interpolation function with specified two function values and one derivative.
void | SetInterpolation2der (double x1, double y1, double d1, double x2, double y2, double d2)
| Initializes the quadratic interpolation function with specified two function values and two approximate derivative. The interpolation becomes average between bunctio nobtained by taking into account the first derivative and the second derivative.
int | Zeros (out double x1, out double x2)
| Calculates and returns real zeros of the function. Also returns the number of real zeros (0, 1 or 2).
override bool | HigherDerivativeDefined (int order)
| Tells whether the derivative of the given order is defined for this function (by implementation, not mathematically). Returns true if either the internal variable indicates true or the appropriate delegate is non-null.
## 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
double | a0`[get, set]`
| Returns the constant term coefficient of the quadratic function.
double | a2`[get, set]`
| Returns the quadratic term coefficitne of the quadratic function.
double | a1`[get, set]`
| Returns the linear term coefficitne of the quadratic function.
double | Zero`[get]`
| Returns the first zero of the current quadratic function. Throws InvalidOperationException if the function does not have real zeros.
double | Zero1`[get]`
| Returns the first zero of the current quadratic function. Throws InvalidOperationException if the function does not have real zeros.
double | Zero2`[get]`
| Returns the second zero of the current quadratic function. Throws InvalidOperationException if the function does not have two distinct real zeros.
bool | HasZero`[get]`
| Returns true if this quadratic function has at least one real zero, false otherwise.
int | NumZeros`[get]`
| Returns number of zeros of the current quadratic function.
bool | HasMaximum`[get]`
| Returns true if this quadratic function has a strict maximum.
double | Maximum`[get]`
| Gets strict maximum of this quadratic function. If the function does not have one then exeption is thrown.
bool | HasMinimum`[get]`
| Returns true if this quadratic function has a strict minimum.
double | Minimum`[get]`
| Gets strict minimum of this quadratic 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. Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
override bool | DerivativeDefined`[get, set]`
| Tells whether the first derivative is defined for this function (by implementation, not mathematically). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
override bool | SecondDerivativeDefined`[get, set]`
| Tells whether the second derivative is defined for this function (by implementation, not mathematically). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
override bool | IntegralDefined`[get, set]`
| Indicates whether integral is defined for this function (w.r. implementation). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
override bool | InverseDefined`[get, set]`
| Indicates whether inverse is defined for this function (w.r. implementation). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
## Private Attributes
double | _a1
double | _a2

## Detailed Description

Quadratic function, f(x) = a2*x*x + a1*x + a0. Specific properties: Zero - returns a zero. Zero1 - returns the fierst zero. Zero2 - returns the second zero. NumZeros - 0, 1 or 2, returns number of zeros. HasZero - either the function has a zero or not.

## Constructor & Destructor Documentation

IG::Num::Func::Quadratic::Quadratic | ( | double | a2,
|  | double | a1,
|  | double | a0
| ) |  | `[inline]`

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

Parameters:

  a2 | quadratic term coefficient.
  a1 | linear term coefficient.
  a0 | constant term coefficient.

## Member Function Documentation

void IG::Num::Func::Quadratic::SetCoefficients | ( | double | a2,
|  | double | a1,
|  | double | a0
| ) |  | `[inline]`

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

Parameters:

  a2 | quadratic term coeficient.
  a1 | linear term coefficient.
  a0 | constant term coefficient.

void IG::Num::Func::Quadratic::SetInterpolation | ( | double | x1,
|  | double | y1,
|  | double | x2,
|  | double | y2,
|  | double | x3,
|  | double | y3
| ) |  | `[inline]`

Initializes the quadratic interpolation function with specified three function values.

Parameters:

  x1 | Abscissa of the first point.
  y1 | Value at the first point.
  x2 | Abscissa of the second point.
  y2 | Value at the second point.
  x3 | Abscissa of the third point.
  y3 | Value at the third point.

void IG::Num::Func::Quadratic::SetInterpolation | ( | double | x1,
|  | double | y1,
|  | double | d1,
|  | double | x2,
|  | double | y2
| ) |  | `[inline]`

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

Parameters:

  x1 | Abscissa of the first point.
  y1 | Value at the first point.
  d1 | Derivative at the first point.
  x2 | Abscissa of the second point.
  y2 | Value at the second point.

void IG::Num::Func::Quadratic::SetInterpolation2der | ( | double | x1,
|  | double | y1,
|  | double | d1,
|  | double | x2,
|  | double | y2,
|  | double | d2
| ) |  | `[inline]`

Initializes the quadratic interpolation function with specified two function values and two approximate derivative. The interpolation becomes average between bunctio nobtained by taking into account the first derivative and the second derivative.

Parameters:

  x1 | Abscissa of the first point.
  y1 | Value at the first point.
  d1 | Derivative (approximate) in the first point.
  x2 | Abscissa of the second point.
  y2 | Value at the second point.
  d2 | Derivative (approximate) in the second point.

int IG::Num::Func::Quadratic::Zeros | ( | out double | x1,
|  | out double | x2
| ) |  | `[inline]`

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

Parameters:

  x1 | The first zero (output parameter).
  x2 | The second zero (output parameter).

Returns:
  Number of distinct real zeros.

override double IG::Num::Func::Quadratic::RefValue | ( | double | x | ) | `[inline, protected, virtual]`

Returns the value of reference (untransformed) function.

Reimplemented from IG::Num::RealFunction.

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

Returns the first derivative of reference (untransformed) function.

Reimplemented from IG::Num::RealFunction.

override double IG::Num::Func::Quadratic::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::Quadratic::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::Quadratic::HigherDerivativeDefined | ( | int | order | ) | `[inline]`

Tells whether the derivative of the given order is defined for this function (by implementation, not mathematically). Returns true if either the internal variable indicates true or the appropriate delegate is non-null.

Reimplemented from IG::Num::RealFunction.

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

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

Parameters:

  order | Highest order for which derivative is defined. -1 means that all derivatives are defined.

Reimplemented from IG::Num::RealFunction.

override double IG::Num::Func::Quadratic::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::Quadratic::RefInverse | ( | double | y | ) | `[inline, protected, virtual]`

Returns inverse of the reference (untransformed) function.

Reimplemented from IG::Num::RealFunction.

## Member Data Documentation

double IG::Num::Func::Quadratic::_a0`[protected]`

double IG::Num::Func::Quadratic::_a1`[private]`

double IG::Num::Func::Quadratic::_a2`[private]`

## Property Documentation

double IG::Num::Func::Quadratic::a0`[get, set]`

Returns the constant term coefficient of the quadratic function.

double IG::Num::Func::Quadratic::a2`[get, set]`

Returns the quadratic term coefficitne of the quadratic function.

double IG::Num::Func::Quadratic::a1`[get, set]`

Returns the linear term coefficitne of the quadratic function.

double IG::Num::Func::Quadratic::Zero`[get]`

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

double IG::Num::Func::Quadratic::Zero1`[get]`

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

double IG::Num::Func::Quadratic::Zero2`[get]`

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

bool IG::Num::Func::Quadratic::HasZero`[get]`

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

int IG::Num::Func::Quadratic::NumZeros`[get]`

Returns number of zeros of the current quadratic function.

bool IG::Num::Func::Quadratic::HasMaximum`[get]`

Returns true if this quadratic function has a strict maximum.

double IG::Num::Func::Quadratic::Maximum`[get]`

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

bool IG::Num::Func::Quadratic::HasMinimum`[get]`

Returns true if this quadratic function has a strict minimum.

double IG::Num::Func::Quadratic::Minimum`[get]`

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

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

Tells whether value of the function is defined by implementation. Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Reimplemented from IG::Num::RealFunction.

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

Tells whether the first derivative is defined for this function (by implementation, not mathematically). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Reimplemented from IG::Num::RealFunction.

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

Tells whether the second derivative is defined for this function (by implementation, not mathematically). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Reimplemented from IG::Num::RealFunction.

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

Indicates whether integral is defined for this function (w.r. implementation). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Reimplemented from IG::Num::RealFunction.

override bool IG::Num::Func::Quadratic::InverseDefined`[get, set]`

Indicates whether inverse is defined for this function (w.r. implementation). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Reimplemented from IG::Num::RealFunction.

The documentation for this class was generated from the following file:

- FunctionRealInterpolation.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events