Package de.labathome.trustconstr
Class BarrierSubproblem
java.lang.Object
de.labathome.trustconstr.BarrierSubproblem
Barrier optimization problem:
minimize fun(x) - barrier_parameter*sum(log(s))
subject to: constr_eq(x) = 0
constr_ineq(x) + s = 0
-
Constructor Summary
ConstructorsConstructorDescriptionBarrierSubproblem(Matrix x0, Matrix s0, ToDoubleBiFunction<Matrix, Object> fun, BiFunction<Matrix, Object, Matrix> grad, LagrangeHessian lagrHess, long nVars, long nIneq, long nEq, Constraint constr, Jacobian jac, double barrierParameter, double tolerance, boolean[] enforceFeasibility, GlobalStoppingCriteria globalStopCriteria, double xtol, double fun0, Matrix grad0, Matrix constrIneq0, Matrix jacIneq0, Matrix constrEq0, Matrix jacEq0) Construct the barrier subproblem at a starting iterate. -
Method Summary
Modifier and TypeMethodDescriptionEvaluate the barrier function and the augmented constraints at a given augmented iteratez = [x; s]:getScaling(Matrix z) Returns the diagonal scaling matrixdiag([1...1, s])that decouples the variable rows from the slack rows in the trust-region step.Slice off thenIneq x 1slack block from an augmented iteratez = [x; s].Slice off thenVars x 1variable block from an augmented iteratez = [x; s].gradAndJac(Matrix z) Returns the scaled gradient and Jacobian for the augmented system:lagrangianHessian(Matrix z, Matrix v) Full augmented Lagrangian Hessian, block-diagonal:Scaled Lagrangian Hessian with respect to the slackss, i.e.Lagrangian Hessian with respect tox(theHxblock).booleanstoppingCriteria(State state, Matrix z, boolean lastIterationFailed, double optimality, double constrViolation, double trustRadius, double penalty, CGInfo cgInfo) Stopping criterion for the barrier subproblem; mirrors formula (2.3) from Byrd-Hribar-Nocedal (1999), p.879.voidupdate(double barrierParameter, double tolerance) Refresh the barrier coefficient and inner-loop tolerance for the next outer iteration.
-
Constructor Details
-
BarrierSubproblem
public BarrierSubproblem(Matrix x0, Matrix s0, ToDoubleBiFunction<Matrix, Object> fun, BiFunction<Matrix, Object, Matrix> grad, LagrangeHessian lagrHess, long nVars, long nIneq, long nEq, Constraint constr, Jacobian jac, double barrierParameter, double tolerance, boolean[] enforceFeasibility, GlobalStoppingCriteria globalStopCriteria, double xtol, double fun0, Matrix grad0, Matrix constrIneq0, Matrix jacIneq0, Matrix constrEq0, Matrix jacEq0) Construct the barrier subproblem at a starting iterate.- Parameters:
x0- starting point in the variable space (nVars x 1)s0- starting slacks (nIneq x 1); must be strictly positivefun- objective(x, args) -> f(x)grad- gradient(x, args) -> gradf(x)lagrHess- Hessian-of-Lagrangian(x, v) -> grad^2L(x, v)nVars- number of decision variablesnIneq- number of canonical inequality rowsnEq- number of canonical equality rowsconstr- combined-constraint evaluatorjac- combined-constraint Jacobian evaluatorbarrierParameter- initial log-barrier coefficienttolerance- initial inner-loop toleranceenforceFeasibility- per-canonical-ineq strict-feasibility flag; may benullglobalStopCriteria- outer-loop termination predicatextol- trust-region radius termination thresholdfun0-fun(x0)grad0-grad(x0)constrIneq0-constr_ineq(x0)(nIneq x 1)jacIneq0- inequality Jacobian atx0(nIneq x n)constrEq0-constr_eq(x0)(nEq x 1)jacEq0- equality Jacobian atx0(nEq x n)
-
-
Method Details
-
update
public void update(double barrierParameter, double tolerance) Refresh the barrier coefficient and inner-loop tolerance for the next outer iteration.- Parameters:
barrierParameter- new log-barrier coefficienttolerance- new inner-loop tolerance
-
getSlack
Slice off thenIneq x 1slack block from an augmented iteratez = [x; s].- Parameters:
z- augmented iterate- Returns:
- slack subvector
s
-
getVariables
Slice off thenVars x 1variable block from an augmented iteratez = [x; s].- Parameters:
z- augmented iterate- Returns:
- variable subvector
x
-
funAndConstr
Evaluate the barrier function and the augmented constraints at a given augmented iteratez = [x; s]:function(z) = fun(x) - barrier_parameter * sum(log(s)) constraints(z) = [ constr_eq(x) ] [ constr_ineq(x) + s ]- Parameters:
z- augmented iterate[x; s]((nVars + nIneq) x 1)- Returns:
- barrier objective value and augmented constraint vector
-
getScaling
Returns the diagonal scaling matrixdiag([1...1, s])that decouples the variable rows from the slack rows in the trust-region step. Identity on the variable rows; the current slack values on the slack rows.- Parameters:
z- augmented iterate[x; s]- Returns:
(nVars + nIneq) x (nVars + nIneq)diagonal scaling
-
gradAndJac
Returns the scaled gradient and Jacobian for the augmented system:gradient = [ grad(x) ] [ -barrier_parameter*ones(n_ineq) ] jacobian = [ jac_eq(x) 0 ] [ jac_ineq(x) S ]Both rescaled by the diagonal returned fromgetScaling(Matrix).- Parameters:
z- augmented iterate[x; s]- Returns:
- barrier-augmented gradient and Jacobian
-
lagrHessX
Lagrangian Hessian with respect tox(theHxblock).- Parameters:
z- augmented iterate[x; s]v- full Lagrange-multiplier vector (equality + inequality)- Returns:
Hxas aLinearOperator
-
lagrHessS
Scaled Lagrangian Hessian with respect to the slackss, i.e. theS Hs Sblock. Uses the primal-dual formulation for entries with positivev_ineqand the primal formulation otherwise.- Parameters:
z- augmented iterate[x; s]v- full Lagrange-multiplier vector (equality then inequality)- Returns:
nIneq x 1diagonal of theS Hs Sblock
-
lagrangianHessian
Full augmented Lagrangian Hessian, block-diagonal:[ Hx 0 ] [ 0 S Hs S ]
- Parameters:
z- augmented iterate[x; s]v- full Lagrange-multiplier vector (equality + inequality)- Returns:
LinearOperatorapplying the augmented Hessian
-
stoppingCriteria
public boolean stoppingCriteria(State state, Matrix z, boolean lastIterationFailed, double optimality, double constrViolation, double trustRadius, double penalty, CGInfo cgInfo) Stopping criterion for the barrier subproblem; mirrors formula (2.3) from Byrd-Hribar-Nocedal (1999), p.879.- Parameters:
state- outer-loop statez- augmented iterate[x; s]lastIterationFailed- whether the previous step was rejectedoptimality- KKT optimality measure atzconstrViolation- infinity-norm of the constraint residualtrustRadius- current trust-region radiuspenalty- current merit-function penaltycgInfo- info from the projected-CG inner solve- Returns:
trueif the inner barrier loop should terminate
-