ROL
ROL::PrimalDualActiveSetStep< Real > Class Template Reference

Implements the computation of optimization steps with the Newton primal-dual active set method. More...

#include <ROL_PrimalDualActiveSetStep.hpp>

Inheritance diagram for ROL::PrimalDualActiveSetStep< Real >:

Classes

class  HessianPD
class  PrecondPD

Public Member Functions

 PrimalDualActiveSetStep (ROL::ParameterList &parlist)
 Constructor.
void initialize (Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
 Initialize step with bound constraint.
void compute (Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
 Compute step.
void update (Vector< Real > &x, const Vector< Real > &s, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
 Update step, if successful.
std::string printHeader (void) const
 Print iterate header.
std::string printName (void) const
 Print step name.
virtual std::string print (AlgorithmState< Real > &algo_state, bool print_header=false) const
 Print iterate status.
Public Member Functions inherited from ROL::Step< Real >
virtual ~Step ()
 Step (void)
virtual void initialize (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
 Initialize step with bound constraint.
virtual void initialize (Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, Constraint< Real > &con, AlgorithmState< Real > &algo_state)
 Initialize step with equality constraint.
virtual void initialize (Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, Constraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
 Initialize step with equality constraint.
virtual void compute (Vector< Real > &s, const Vector< Real > &x, const Vector< Real > &l, Objective< Real > &obj, Constraint< Real > &con, AlgorithmState< Real > &algo_state)
 Compute step (equality constraints).
virtual void update (Vector< Real > &x, Vector< Real > &l, const Vector< Real > &s, Objective< Real > &obj, Constraint< Real > &con, AlgorithmState< Real > &algo_state)
 Update step, if successful (equality constraints).
virtual void compute (Vector< Real > &s, const Vector< Real > &x, const Vector< Real > &l, Objective< Real > &obj, Constraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
 Compute step (equality constraints).
virtual void update (Vector< Real > &x, Vector< Real > &l, const Vector< Real > &s, Objective< Real > &obj, Constraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
 Update step, if successful (equality constraints).
const ROL::Ptr< const StepState< Real > > getStepState (void) const
 Get state for step object.
void reset (const Real searchSize=1.0)
 Get state for step object.

Private Member Functions

Real computeCriticalityMeasure (Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &con, Real tol)
 Compute the gradient-based criticality measure.

Private Attributes

ROL::Ptr< Krylov< Real > > krylov_
int iterCR_
 CR iteration counter.
int flagCR_
 CR termination flag.
Real itol_
 Inexact CR tolerance.
int maxit_
 Maximum number of PDAS iterations.
int iter_
 PDAS iteration counter.
int flag_
 PDAS termination flag.
Real stol_
 PDAS minimum step size stopping tolerance.
Real gtol_
 PDAS gradient stopping tolerance.
Real scale_
 Scale for dual variables in the active set, \(c\).
Real neps_
 \(\epsilon\)-active set parameter
bool feasible_
 Flag whether the current iterate is feasible or not.
ROL::Ptr< Vector< Real > > lambda_
 Container for dual variables.
ROL::Ptr< Vector< Real > > xlam_
 Container for primal plus dual variables.
ROL::Ptr< Vector< Real > > x0_
 Container for initial priaml variables.
ROL::Ptr< Vector< Real > > xbnd_
 Container for primal variable bounds.
ROL::Ptr< Vector< Real > > As_
 Container for step projected onto active set.
ROL::Ptr< Vector< Real > > xtmp_
 Container for temporary primal storage.
ROL::Ptr< Vector< Real > > res_
 Container for optimality system residual for quadratic model.
ROL::Ptr< Vector< Real > > Ag_
 Container for gradient projected onto active set.
ROL::Ptr< Vector< Real > > rtmp_
 Container for temporary right hand side storage.
ROL::Ptr< Vector< Real > > gtmp_
 Container for temporary gradient storage.
ESecant esec_
 Enum for secant type.
ROL::Ptr< Secant< Real > > secant_
 Secant object.
bool useSecantPrecond_
bool useSecantHessVec_

Additional Inherited Members

Protected Member Functions inherited from ROL::Step< Real >
ROL::Ptr< StepState< Real > > getState (void)

Detailed Description

template<class Real>
class ROL::PrimalDualActiveSetStep< Real >

Implements the computation of optimization steps with the Newton primal-dual active set method.

To describe primal-dual active set (PDAS), we consider the following abstract setting. Suppose \(\mathcal{X}\) is a Hilbert space of functions mapping \(\Xi\) to \(\mathbb{R}\). For example, \(\Xi\subset\mathbb{R}^n\) and \(\mathcal{X}=L^2(\Xi)\) or \(\Xi = \{1,\ldots,n\}\) and \(\mathcal{X}=\mathbb{R}^n\). We assume \( f:\mathcal{X}\to\mathbb{R}\) is twice-continuously Fréchet differentiable and \(a,\,b\in\mathcal{X}\) with \(a\le b\) almost everywhere in \(\Xi\). Note that the PDAS algorithm will also work with secant approximations of the Hessian.

Traditionally, PDAS is an algorithm for the minimizing quadratic objective functions subject to bound constraints. ROL implements a Newton PDAS which extends PDAS to general bound-constrained nonlinear programs, i.e.,

\[ \min_x \quad f(x) \quad \text{s.t.} \quad a \le x \le b. \]

Given the \(k\)-th iterate \(x_k\), the Newton PDAS algorithm computes steps by applying PDAS to the quadratic subproblem

\[ \min_s \quad \langle \nabla^2 f(x_k)s + \nabla f(x_k),s \rangle_{\mathcal{X}} \quad \text{s.t.} \quad a \le x_k + s \le b. \]

For the \(k\)-th quadratic subproblem, PDAS builds an approximation of the active set \(\mathcal{A}_k\) using the dual variable \(\lambda_k\) as

\[ \mathcal{A}^+_k = \{\,\xi\in\Xi\,:\,(\lambda_k + c(x_k-b))(\xi) > 0\,\}, \quad \mathcal{A}^-_k = \{\,\xi\in\Xi\,:\,(\lambda_k + c(x_k-a))(\xi) < 0\,\}, \quad\text{and}\quad \mathcal{A}_k = \mathcal{A}^-_k\cup\mathcal{A}^+_k. \]

We define the inactive set \(\mathcal{I}_k=\Xi\setminus\mathcal{A}_k\). The solution to the quadratic subproblem is then computed iteratively by solving

\[ \nabla^2 f(x_k) s_k + \lambda_{k+1} = -\nabla f(x_k), \quad x_k+s_k = a \;\text{on}\;\mathcal{A}^-_k,\quad x_k+s_k = b\;\text{on}\;\mathcal{A}^+_k, \quad\text{and}\quad \lambda_{k+1} = 0\;\text{on}\;\mathcal{I}_k \]

and updating the active and inactive sets.

One can rewrite this system by consolidating active and inactive parts, i.e.,

\[ \begin{pmatrix} \nabla^2 f(x_k)_{\mathcal{A}_k,\mathcal{A}_k} & \nabla^2 f(x_k)_{\mathcal{A}_k,\mathcal{I}_k} \\ \nabla^2 f(x_k)_{\mathcal{I}_k,\mathcal{A}_k} & \nabla^2 f(x_k)_{\mathcal{I}_k,\mathcal{I}_k} \end{pmatrix} \begin{pmatrix} (s_k)_{\mathcal{A}_k} \\ (s_k)_{\mathcal{I}_k} \end{pmatrix} + \begin{pmatrix} (\lambda_{k+1})_{\mathcal{A}_k} \\ 0 \end{pmatrix} = - \begin{pmatrix} \nabla f(x_k)_{\mathcal{A}_k}\\ \nabla f(x_k)_{\mathcal{I}_k} \end{pmatrix}. \]

Here the subscripts \(\mathcal{A}_k\) and \(\mathcal{I}_k\) denote the active and inactive components, respectively. Moreover, the active components of \(s_k\) are \(s_k(\xi) = a(\xi)-x_k(\xi)\) if \(\xi\in\mathcal{A}^-_k\) and \(s_k(\xi) = b(\xi)-x_k(\xi)\) if \(\xi\in\mathcal{A}^+_k\). Since \((s_k)_{\mathcal{A}_k}\) is fixed, we only need to solve for the inactive components of \(s_k\) which we can do this using conjugate residuals (CR) (i.e., the Hessian operator corresponding to the inactive indices may not be positive definite). Once \((s_k)_{\mathcal{I}_k}\) is computed, it is straight forward to update the dual variables.

Definition at line 98 of file ROL_PrimalDualActiveSetStep.hpp.

Constructor & Destructor Documentation

◆ PrimalDualActiveSetStep()

template<class Real>
ROL::PrimalDualActiveSetStep< Real >::PrimalDualActiveSetStep ( ROL::ParameterList & parlist)
inline

Constructor.

  @param[in]     parlist   is a parameter list containing relevent algorithmic information
  @param[in]     useSecant is a bool which determines whether or not the algorithm uses 
                           a secant approximation of the Hessian

Definition at line 245 of file ROL_PrimalDualActiveSetStep.hpp.

References Ag_, As_, esec_, feasible_, flag_, flagCR_, gtmp_, gtol_, iter_, iterCR_, itol_, krylov_, ROL::KrylovFactory(), lambda_, maxit_, neps_, res_, ROL::ROL_EPSILON(), rtmp_, scale_, secant_, ROL::SECANT_LBFGS, ROL::SecantFactory(), ROL::Step< Real >::Step(), stol_, ROL::StringToESecant(), useSecantHessVec_, useSecantPrecond_, x0_, xbnd_, xlam_, and xtmp_.

Member Function Documentation

◆ computeCriticalityMeasure()

template<class Real>
Real ROL::PrimalDualActiveSetStep< Real >::computeCriticalityMeasure ( Vector< Real > & x,
Objective< Real > & obj,
BoundConstraint< Real > & con,
Real tol )
inlineprivate

Compute the gradient-based criticality measure.

  The criticality measure is 
  \f$\|x_k - P_{[a,b]}(x_k-\nabla f(x_k))\|_{\mathcal{X}}\f$.
  Here, \f$P_{[a,b]}\f$ denotes the projection onto the
  bound constraints.

  @param[in]    x     is the current iteration
  @param[in]    obj   is the objective function
  @param[in]    con   are the bound constraints
  @param[in]    tol   is a tolerance for inexact evaluations of the objective function

Definition at line 227 of file ROL_PrimalDualActiveSetStep.hpp.

References ROL::Step< Real >::getState(), ROL::Objective< Real >::gradient(), ROL::BoundConstraint< Real >::project(), and xtmp_.

Referenced by initialize(), and update().

◆ initialize()

◆ compute()

◆ update()

◆ printHeader()

template<class Real>
std::string ROL::PrimalDualActiveSetStep< Real >::printHeader ( void ) const
inlinevirtual

Print iterate header.

  This function produces a string containing 
  header information.  

Reimplemented from ROL::Step< Real >.

Definition at line 511 of file ROL_PrimalDualActiveSetStep.hpp.

References maxit_.

Referenced by print().

◆ printName()

template<class Real>
std::string ROL::PrimalDualActiveSetStep< Real >::printName ( void ) const
inlinevirtual

Print step name.

  This function produces a string containing 
  the algorithmic step information.  

Reimplemented from ROL::Step< Real >.

Definition at line 538 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by print().

◆ print()

template<class Real>
virtual std::string ROL::PrimalDualActiveSetStep< Real >::print ( AlgorithmState< Real > & algo_state,
bool print_header = false ) const
inlinevirtual

Print iterate status.

  This function prints the iteration status.

  @param[in]        algo_state  is the current state of the algorithm
  @param[in]        printHeader if set to true will print the header at each iteration

Reimplemented from ROL::Step< Real >.

Definition at line 551 of file ROL_PrimalDualActiveSetStep.hpp.

References feasible_, flag_, flagCR_, ROL::AlgorithmState< Real >::gnorm, ROL::AlgorithmState< Real >::iter, iter_, iterCR_, maxit_, ROL::AlgorithmState< Real >::nfval, ROL::AlgorithmState< Real >::ngrad, printHeader(), printName(), ROL::AlgorithmState< Real >::snorm, and ROL::AlgorithmState< Real >::value.

Member Data Documentation

◆ krylov_

template<class Real>
ROL::Ptr<Krylov<Real> > ROL::PrimalDualActiveSetStep< Real >::krylov_
private

Definition at line 101 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), and PrimalDualActiveSetStep().

◆ iterCR_

template<class Real>
int ROL::PrimalDualActiveSetStep< Real >::iterCR_
private

CR iteration counter.

Definition at line 104 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), PrimalDualActiveSetStep(), print(), and update().

◆ flagCR_

template<class Real>
int ROL::PrimalDualActiveSetStep< Real >::flagCR_
private

CR termination flag.

Definition at line 105 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), PrimalDualActiveSetStep(), print(), and update().

◆ itol_

template<class Real>
Real ROL::PrimalDualActiveSetStep< Real >::itol_
private

Inexact CR tolerance.

Definition at line 106 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), and PrimalDualActiveSetStep().

◆ maxit_

template<class Real>
int ROL::PrimalDualActiveSetStep< Real >::maxit_
private

Maximum number of PDAS iterations.

Definition at line 109 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), PrimalDualActiveSetStep(), print(), printHeader(), and update().

◆ iter_

template<class Real>
int ROL::PrimalDualActiveSetStep< Real >::iter_
private

PDAS iteration counter.

Definition at line 110 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), PrimalDualActiveSetStep(), print(), and update().

◆ flag_

template<class Real>
int ROL::PrimalDualActiveSetStep< Real >::flag_
private

PDAS termination flag.

Definition at line 111 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), PrimalDualActiveSetStep(), print(), and update().

◆ stol_

template<class Real>
Real ROL::PrimalDualActiveSetStep< Real >::stol_
private

PDAS minimum step size stopping tolerance.

Definition at line 112 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), and PrimalDualActiveSetStep().

◆ gtol_

template<class Real>
Real ROL::PrimalDualActiveSetStep< Real >::gtol_
private

PDAS gradient stopping tolerance.

Definition at line 113 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), and PrimalDualActiveSetStep().

◆ scale_

template<class Real>
Real ROL::PrimalDualActiveSetStep< Real >::scale_
private

Scale for dual variables in the active set, \(c\).

Definition at line 114 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), and PrimalDualActiveSetStep().

◆ neps_

template<class Real>
Real ROL::PrimalDualActiveSetStep< Real >::neps_
private

\(\epsilon\)-active set parameter

Definition at line 115 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), and PrimalDualActiveSetStep().

◆ feasible_

template<class Real>
bool ROL::PrimalDualActiveSetStep< Real >::feasible_
private

Flag whether the current iterate is feasible or not.

Definition at line 116 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by PrimalDualActiveSetStep(), print(), and update().

◆ lambda_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::lambda_
private

Container for dual variables.

Definition at line 119 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), and PrimalDualActiveSetStep().

◆ xlam_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::xlam_
private

Container for primal plus dual variables.

Definition at line 120 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), and PrimalDualActiveSetStep().

◆ x0_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::x0_
private

Container for initial priaml variables.

Definition at line 121 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), and PrimalDualActiveSetStep().

◆ xbnd_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::xbnd_
private

Container for primal variable bounds.

Definition at line 122 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), and PrimalDualActiveSetStep().

◆ As_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::As_
private

Container for step projected onto active set.

Definition at line 123 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), and PrimalDualActiveSetStep().

◆ xtmp_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::xtmp_
private

Container for temporary primal storage.

Definition at line 124 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), computeCriticalityMeasure(), initialize(), and PrimalDualActiveSetStep().

◆ res_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::res_
private

Container for optimality system residual for quadratic model.

Definition at line 125 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), and PrimalDualActiveSetStep().

◆ Ag_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::Ag_
private

Container for gradient projected onto active set.

Definition at line 126 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), and PrimalDualActiveSetStep().

◆ rtmp_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::rtmp_
private

Container for temporary right hand side storage.

Definition at line 127 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), and PrimalDualActiveSetStep().

◆ gtmp_

template<class Real>
ROL::Ptr<Vector<Real> > ROL::PrimalDualActiveSetStep< Real >::gtmp_
private

Container for temporary gradient storage.

Definition at line 128 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), initialize(), PrimalDualActiveSetStep(), and update().

◆ esec_

template<class Real>
ESecant ROL::PrimalDualActiveSetStep< Real >::esec_
private

Enum for secant type.

Definition at line 131 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by PrimalDualActiveSetStep().

◆ secant_

template<class Real>
ROL::Ptr<Secant<Real> > ROL::PrimalDualActiveSetStep< Real >::secant_
private

Secant object.

Definition at line 132 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), PrimalDualActiveSetStep(), and update().

◆ useSecantPrecond_

template<class Real>
bool ROL::PrimalDualActiveSetStep< Real >::useSecantPrecond_
private

Definition at line 133 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), and PrimalDualActiveSetStep().

◆ useSecantHessVec_

template<class Real>
bool ROL::PrimalDualActiveSetStep< Real >::useSecantHessVec_
private

Definition at line 134 of file ROL_PrimalDualActiveSetStep.hpp.

Referenced by compute(), and PrimalDualActiveSetStep().


The documentation for this class was generated from the following file: