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

IG::Num::Func3dBase Class Reference

Base class for scalar functions of 3 variables (base for implementation of IFunc3d interface). Beside the IFunc3d interface, this class also implements the IScalarFunction interface. This does not affect efficiency but adds the functionality for using objects as general (untransformed) scalar functions. More...

Inheritance diagram for IG::Num::Func3dBase:
Collaboration diagram for IG::Num::Func3dBase:

List of all members.

Public Member Functions

abstract double Value (double x, double y, double z)
 Calculates and returns value of the current 3D scalar function.
virtual double Value (vec3 parameters)
 Calculates and returns value of the current 3D scalar function.
abstract void Gradient (double x, double y, double z, out double gradx, out double grady, out double gradz)
 Calculates gradient of the current 3D scalar function and returns its components through the specified output variables.
virtual vec3 Gradient (vec3 parameters)
 Calculates and returns gradient of the current 3D scalar function.
abstract void Hessian (double x, double y, double z, out double dxx, out double dyy, out double dzz, out double dxy, out double dxz, out double dyz)
 Calculates Hessian of the current 3D scalar function and returns its component through the specified output variables.
virtual mat3 Hessian (vec3 parameters)
 Calculates and returns Hessian of the current 3D scalar function and returns it (in the form of a mat3 struct).
override double Value (IVector parameters)
 Returns the value of the current function at the specified parameters.
override void GradientPlain (IVector parameters, IVector gradient)
 Calculates first order derivatives (gradient) of this function at the specified parameters. WARNING: Plain function, does not check consistency of arguments.
override void HessianPlain (IVector parameters, IMatrix hessian)
 Calculates the second derivative (Hessian matrix) of this function at the specified parameters. WARNING: Plain function, does not check consistency of arguments.

Static Public Member Functions

static void Example ()
 Example of use of a 3D function.

Protected Member Functions

 Func3dBase ()

Static Protected Member Functions

static void TestFunction (IFunc3d f)
 Demonstrates use of a 3D function by printing to the console 5 values and gradients of the function on the line connecting the two points (0, 0, 0) and (1, 1, 1).
static void TestFunction (IFunc3d f, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int numPoints)
 Demonstrates use of a 3D function by printing to the console some values and gradients of the function on the line connecting the two specified points.

Properties

override bool ValueDefined [get, set]
 Whether calculation of function value is defined. Defaulet is true.
override bool GradientDefined [get, set]
 Whether calculation of functio ngradient is defined. Default is false.
override bool HessianDefined [get, set]
 Whether calculation of function Hessian is defined. Default is false.
int NumParam [get]
 Gets number of parameters.

Private Attributes

bool _valueDefined = true
bool _gradientDefined = false
bool _hessianDefined = false

Detailed Description

Base class for scalar functions of 3 variables (base for implementation of IFunc3d interface).

Beside the IFunc3d interface, this class also implements the IScalarFunction interface. This does not affect efficiency but adds the functionality for using objects as general (untransformed) scalar functions.

$A Igor Apr09;


Constructor & Destructor Documentation

IG::Num::Func3dBase::Func3dBase ( ) [inline, protected]

Member Function Documentation

abstract double IG::Num::Func3dBase::Value ( double  x,
double  y,
double  z 
) [pure virtual]

Calculates and returns value of the current 3D scalar function.

Parameters:
xFirst parameter.
ySecond parameter.
zThird parameter.

Implements IG::Num::IFunc3d.

Implemented in IG::Num::Func3dVectorFormBase, IG::Num::Func3dExamples::Func3dXYZ, IG::Gr3d::ExampleValueFunctionDiff3D, IG::Num::Func3dFromScalarFunction, IG::Gr3d::VtkPlotBase::Func3dZ, IG::Gr3d::VtkPlotBase::Func3dZero, and IG::Gr3d::VtkPlotBase::ExampleValueFunctionDiff21.

virtual double IG::Num::Func3dBase::Value ( vec3  parameters) [inline, virtual]

Calculates and returns value of the current 3D scalar function.

Parameters:
parametersVector of function parameters (in form of the vec3 struct.
Returns:
Function value.

Implements IG::Num::IFunc3d.

Reimplemented in IG::Num::Func3dVectorFormBase, IG::Num::Func3dLinear, and IG::Num::Func3dQuadratic.

abstract void IG::Num::Func3dBase::Gradient ( double  x,
double  y,
double  z,
out double  gradx,
out double  grady,
out double  gradz 
) [pure virtual]

Calculates gradient of the current 3D scalar function and returns its components through the specified output variables.

Parameters:
xFirst parameter.
ySecond parameter.
zThird parameter.
gradxFirst component of the returned gradient.
gradySecond component of the returned gradient.
gradzThird component of the returned gradient.

Implements IG::Num::IFunc3d.

Implemented in IG::Num::Func3dBaseNoGradient, IG::Num::Func3dVectorFormBase, IG::Num::Func3dExamples::Func3dXYZ, IG::Num::Func3dFromScalarFunction, IG::Gr3d::VtkPlotBase::Func3dZ, and IG::Gr3d::VtkPlotBase::Func3dZero.

virtual vec3 IG::Num::Func3dBase::Gradient ( vec3  parameters) [inline, virtual]

Calculates and returns gradient of the current 3D scalar function.

Parameters:
parametersVector of parameters (in form of the vec3 struct)

<returnreturns>Gradient of the current 3D scalar function (in form of the vec3 struct)</returnreturns>

Implements IG::Num::IFunc3d.

Reimplemented in IG::Num::Func3dVectorFormBase, IG::Num::Func3dLinear, and IG::Num::Func3dQuadratic.

abstract void IG::Num::Func3dBase::Hessian ( double  x,
double  y,
double  z,
out double  dxx,
out double  dyy,
out double  dzz,
out double  dxy,
out double  dxz,
out double  dyz 
) [pure virtual]

Calculates Hessian of the current 3D scalar function and returns its component through the specified output variables.

Parameters:
xFirst parameter.
ySecond parameter.
zThird parameter.
dxxComponent 1-1 of the calculated Hessian.
dyyComponent 2-2 of the calculated Hessian.
dzzComponent 3-3 of the calculated Hessian.
dxyComponent 1-2 of the calculated Hessian.
dxzComponent 1-3 of the calculated Hessian.
dyzComponent 2-3 of the calculated Hessian.

Implements IG::Num::IFunc3d.

Implemented in IG::Num::Func3dBaseNoHessian, IG::Num::Func3dBaseNoGradient, IG::Num::Func3dVectorFormBase, and IG::Num::Func3dFromScalarFunction.

virtual mat3 IG::Num::Func3dBase::Hessian ( vec3  parameters) [inline, virtual]

Calculates and returns Hessian of the current 3D scalar function and returns it (in the form of a mat3 struct).

Implements IG::Num::IFunc3d.

Reimplemented in IG::Num::Func3dVectorFormBase, IG::Num::Func3dLinear, and IG::Num::Func3dQuadratic.

override double IG::Num::Func3dBase::Value ( IVector  parameters) [inline]

Returns the value of the current function at the specified parameters.

Parameters:
parametersVector of parameters for which value is evaluated. Its dimension must be equal to 3.

Implements IG::Num::IScalarFunctionUntransformed.

override void IG::Num::Func3dBase::GradientPlain ( IVector  parameters,
IVector  gradient 
) [inline]

Calculates first order derivatives (gradient) of this function at the specified parameters. WARNING: Plain function, does not check consistency of arguments.

Parameters:
parametersVector of parameters where derivatives are evaluated.
gradientVector where first order derivatives (the gradient) are stored.

Implements IG::Num::IScalarFunctionUntransformed.

override void IG::Num::Func3dBase::HessianPlain ( IVector  parameters,
IMatrix  hessian 
) [inline]

Calculates the second derivative (Hessian matrix) of this function at the specified parameters. WARNING: Plain function, does not check consistency of arguments.

Parameters:
parametersVector of parameters where derivatives are evaluated.
hessianMatrix where second derivatives (Hessian matrix) are stored.

Implements IG::Num::IScalarFunctionUntransformed.

static void IG::Num::Func3dBase::TestFunction ( IFunc3d  f) [inline, static, protected]

Demonstrates use of a 3D function by printing to the console 5 values and gradients of the function on the line connecting the two points (0, 0, 0) and (1, 1, 1).

Parameters:
fFunction whose values and gradients are evaluated and printed.
static void IG::Num::Func3dBase::TestFunction ( IFunc3d  f,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax,
int  numPoints 
) [inline, static, protected]

Demonstrates use of a 3D function by printing to the console some values and gradients of the function on the line connecting the two specified points.

Parameters:
fFunction whose values and gradients are evaluated and printed.
xminMin. x.
xmaxMax. x.
yminMin. y.
ymaxMax. y.
zminMin. z.
zmaxMax. z.
numPointsNumber of points in which function values and gradients are printed.
static void IG::Num::Func3dBase::Example ( ) [inline, static]

Example of use of a 3D function.


Member Data Documentation

bool IG::Num::Func3dBase::_valueDefined = true [private]
bool IG::Num::Func3dBase::_gradientDefined = false [private]
bool IG::Num::Func3dBase::_hessianDefined = false [private]

Property Documentation

override bool IG::Num::Func3dBase::ValueDefined [get, set]

Whether calculation of function value is defined. Defaulet is true.

Implements IG::Num::IScalarFunctionUntransformed.

override bool IG::Num::Func3dBase::GradientDefined [get, set]

Whether calculation of functio ngradient is defined. Default is false.

Implements IG::Num::IScalarFunctionUntransformed.

override bool IG::Num::Func3dBase::HessianDefined [get, set]

Whether calculation of function Hessian is defined. Default is false.

Implements IG::Num::IScalarFunctionUntransformed.

int IG::Num::Func3dBase::NumParam [get]

Gets number of parameters.


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