IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
Quadratic function of 2 variables. 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 the vector of linear coefficients (gradient at x=0) and c is the scalar term (function value at x=0). More...
Public Member Functions | |
Func2dQuadratic (mat2 hessian, vec2 gradient0, double scalarTerm) | |
Creation of a quadratic 2D scalar function. WARNING:Matrix argument is interpreted as Hessian, i.e. twice the matrix of quadratic coefficients. | |
override double | Value (vec2 parameters) |
Calculates and returns value of the current 2D quadratic function. | |
override vec2 | Gradient (vec2 parameters) |
Calculates and returns gradient of the current 2D quadratic function. | |
override mat2 | Hessian (vec2 parameters) |
Calculates and returns Hessian of the current 2D quadratic function and returns it (in the form of a mat2 struct). | |
Static Public Member Functions | |
static int | GetNumConstants () |
Returns the number of scalar constants that specify the current function. | |
Properties | |
mat2 | HessianMatrix [get, set] |
Twice the matrix of quadratic coefficients (Hessian matrix of second derivatives). | |
vec2 | Gradient0 [get, set] |
Vector of linear coefficients (equal to gradient of the function at x=0). | |
double | ScalarTerm [get, set] |
Scalar additive constant. | |
Private Member Functions | |
Func2dQuadratic () | |
Private Attributes | |
mat2 | _G |
vec2 | _b |
double | _c |
Quadratic function of 2 variables.
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 the vector of linear coefficients (gradient at x=0) and c is the scalar term (function value at x=0).
$A Igor Aug09;
IG::Num::Func2dQuadratic::Func2dQuadratic | ( | ) | [inline, private] |
IG::Num::Func2dQuadratic::Func2dQuadratic | ( | mat2 | hessian, |
vec2 | gradient0, | ||
double | scalarTerm | ||
) | [inline] |
Creation of a quadratic 2D scalar function. WARNING:Matrix argument is interpreted as Hessian, i.e. twice the matrix of quadratic coefficients.
static int IG::Num::Func2dQuadratic::GetNumConstants | ( | ) | [inline, static] |
Returns the number of scalar constants that specify the current function.
override double IG::Num::Func2dQuadratic::Value | ( | vec2 | parameters | ) | [inline] |
Calculates and returns value of the current 2D quadratic function.
Implements IG::Num::IFunc2d.
Calculates and returns gradient of the current 2D quadratic function.
<returnreturns>Gradient of the current 2D scalar function (in form of the vec2 struct)</returnreturns>
Implements IG::Num::IFunc2d.
Calculates and returns Hessian of the current 2D quadratic function and returns it (in the form of a mat2 struct).
Implements IG::Num::IFunc2d.
mat2 IG::Num::Func2dQuadratic::_G [private] |
vec2 IG::Num::Func2dQuadratic::_b [private] |
double IG::Num::Func2dQuadratic::_c [private] |
mat2 IG::Num::Func2dQuadratic::HessianMatrix [get, set] |
Twice the matrix of quadratic coefficients (Hessian matrix of second derivatives).
vec2 IG::Num::Func2dQuadratic::Gradient0 [get, set] |
Vector of linear coefficients (equal to gradient of the function at x=0).
double IG::Num::Func2dQuadratic::ScalarTerm [get, set] |
Scalar additive constant.