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

IG::Num::ScalarFunctionLinear Class Reference

Quadratic scalar function of vector variable. Function is evaluated according to q(x) = (1/2)*x^T*G*x + b^T*x + c where x is vector of parameters, G is constant Hessian matrix, b is vector of linear coefficients (gradient at x=0) and c is the scalar term (function value at x=0). More...

Inheritance diagram for IG::Num::ScalarFunctionLinear:
Collaboration diagram for IG::Num::ScalarFunctionLinear:

List of all members.

Public Member Functions

 ScalarFunctionLinear (IVector gradient0, double scalarTerm)
 Creation of a quadratic scalar function. WARNING: Matrix argument is interpreted as Hessian, i.e. twice the matrix of quadratic coefficients.
override double Value (IVector parameters)
 Returns the value of this function at the specified parameter.
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 int GetNumConstants (int dim)
 Returns the number of constants that specify the linear function of the specified dimension.
static ScalarFunctionLinear ExampleFunction2d ()
 Creates and returns quadratic scalar function in 2D.

Properties

int NumActualConstants [get]
 Gets the number of constants that define the current function. If e.g. the matrix coefficient or the vector coefficient is not defined then the corresponding constants are not counted.
IVector Gradient0 [get, set]
 Vector of linear coefficients (equal to gradient of the function).
double ScalarTerm [get, set]
 Scalar additive constant.
override bool ValueDefined [get, set]
 Tells whether value of the function is defined by implementation. Always true for this case.
override bool GradientDefined [get, set]
 Tells whether the first derivative is defined for this function (by implementation, not mathematically)
override bool HessianDefined [get, set]
 Tells whether the second derivative is defined for this function (by implementation, not mathematically)

Private Member Functions

 ScalarFunctionLinear ()

Private Attributes

IVector _b
double _c

Detailed Description

Quadratic scalar function of vector variable. Function is evaluated according to q(x) = (1/2)*x^T*G*x + b^T*x + c where x is vector of parameters, G is constant Hessian matrix, b is vector of linear coefficients (gradient at x=0) and c is the scalar term (function value at x=0).

When quadratic function is created or its parameters set, the Matrix parameter of the function is interpreted as Hessian, i.e. twice the matrix of quadratic coefficients. $A Igor xx Dec10;


Constructor & Destructor Documentation

IG::Num::ScalarFunctionLinear::ScalarFunctionLinear ( ) [inline, private]
IG::Num::ScalarFunctionLinear::ScalarFunctionLinear ( IVector  gradient0,
double  scalarTerm 
) [inline]

Creation of a quadratic scalar function. WARNING: Matrix argument is interpreted as Hessian, i.e. twice the matrix of quadratic coefficients.

Parameters:
hessianMatrix of second derivatives (Hessian). Can be null (in this case function degrades to linear function).
gradient0Vector of linear coefficients - gradient of quadratic function at x = 0. Can be null.
scalarTermConstant term.

Member Function Documentation

static int IG::Num::ScalarFunctionLinear::GetNumConstants ( int  dim) [inline, static]

Returns the number of constants that specify the linear function of the specified dimension.

Parameters:
dimDimension of the space in which quadratic function is defined.
override double IG::Num::ScalarFunctionLinear::Value ( IVector  parameters) [inline]

Returns the value of this function at the specified parameter.

Implements IG::Num::IScalarFunctionUntransformed.

override void IG::Num::ScalarFunctionLinear::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::ScalarFunctionLinear::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 ScalarFunctionLinear IG::Num::ScalarFunctionLinear::ExampleFunction2d ( ) [inline, static]

Creates and returns quadratic scalar function in 2D.


Member Data Documentation


Property Documentation

int IG::Num::ScalarFunctionLinear::NumActualConstants [get]

Gets the number of constants that define the current function. If e.g. the matrix coefficient or the vector coefficient is not defined then the corresponding constants are not counted.

IVector IG::Num::ScalarFunctionLinear::Gradient0 [get, set]

Vector of linear coefficients (equal to gradient of the function).

double IG::Num::ScalarFunctionLinear::ScalarTerm [get, set]

Scalar additive constant.

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

Tells whether value of the function is defined by implementation. Always true for this case.

Parameters:
parametersVector of parameters at which derivatives are evaluated.

Implements IG::Num::IScalarFunctionUntransformed.

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

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

Implements IG::Num::IScalarFunctionUntransformed.

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

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

Implements IG::Num::IScalarFunctionUntransformed.


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