Package de.labathome.trustconstr
Class VectorFunction
java.lang.Object
de.labathome.trustconstr.VectorFunction
- All Implemented Interfaces:
VectorFunctionLike
Vector function and its derivatives.
This class defines a vector function F: R^n->R^m and methods for
computing or approximating its first and second derivatives.
Notes
-----
This class implements a memoization logic. There are methods `fun`,
`jac`, hess` and corresponding attributes `f`, `J` and `H`. The following
things should be considered:
1. Use only public methods `fun`, `jac` and `hess`.
2. After one of the methods is called, the corresponding attribute
will be set. However, a subsequent call with a different argument
of *any* of the methods may overwrite the attribute.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VectorFunction.VectorFunctionFactoryDefaultVectorFunction.VectorFunctionFactory. -
Method Summary
Modifier and TypeMethodDescriptionf()Evaluate the function atx, updating any internal cache.H()Evaluate the constraint Hessian-of-LagrangianSum_i v[i] * H_{f_i}(x)atxfor the given multiplier vectorv.J()Evaluate the Jacobian atx, updating any internal cache.longm()longn()intintintbooleanv()
-
Field Details
-
FACTORY
DefaultVectorFunction.VectorFunctionFactory.
-
-
Method Details
-
fun
Description copied from interface:VectorFunctionLikeEvaluate the function atx, updating any internal cache.- Specified by:
funin interfaceVectorFunctionLike- Parameters:
x- current iterate (n x 1)- Returns:
- cached function value
f(x)(m x 1)
-
jac
Description copied from interface:VectorFunctionLikeEvaluate the Jacobian atx, updating any internal cache.- Specified by:
jacin interfaceVectorFunctionLike- Parameters:
x- current iterate (n x 1)- Returns:
- cached Jacobian
J(x)(m x n)
-
hess
Description copied from interface:VectorFunctionLikeEvaluate the constraint Hessian-of-LagrangianSum_i v[i] * H_{f_i}(x)atxfor the given multiplier vectorv.- Specified by:
hessin interfaceVectorFunctionLike- Parameters:
x- current iterate (n x 1)v- Lagrange multipliers (m x 1)- Returns:
- cached Hessian-of-Lagrangian
H(x, v)(n x n)
-
numFunctionEvals
public int numFunctionEvals()- Specified by:
numFunctionEvalsin interfaceVectorFunctionLike- Returns:
- total number of
funevaluations performed so far
-
numJacobianEvals
public int numJacobianEvals()- Specified by:
numJacobianEvalsin interfaceVectorFunctionLike- Returns:
- total number of Jacobian evaluations performed so far
-
numHessianEvals
public int numHessianEvals()- Specified by:
numHessianEvalsin interfaceVectorFunctionLike- Returns:
- total number of Hessian evaluations performed so far
-
sparseJacobian
public boolean sparseJacobian()- Returns:
trueif the Jacobian return type is sparse
-
f
- Specified by:
fin interfaceVectorFunctionLike- Returns:
- the most recently computed
f(x)(m x 1), ornullif uncached
-
J
- Specified by:
Jin interfaceVectorFunctionLike- Returns:
- the most recently computed Jacobian (
m x n), ornullif uncached
-
H
- Returns:
- the most recently computed Hessian (
n x n), ornullif uncached
-
v
- Specified by:
vin interfaceVectorFunctionLike- Returns:
- the most recently set Lagrange multipliers (
m x 1), ornull
-
m
public long m()- Specified by:
min interfaceVectorFunctionLike- Returns:
- number of function dimensions (
minf : R^n -> R^m)
-
n
public long n()- Specified by:
nin interfaceVectorFunctionLike- Returns:
- number of input dimensions (
ninf : R^n -> R^m)
-