ROL
ROL_Bundle_U_AS.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Rapid Optimization Library (ROL) Package
4//
5// Copyright 2014 NTESS and the ROL contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef ROL_BUNDLE_U_AS_H
11#define ROL_BUNDLE_U_AS_H
12
13#include "ROL_Bundle_U.hpp"
14
19namespace ROL {
20
21template<typename Real>
22class Bundle_U_AS : public Bundle_U<Real> {
23/***********************************************************************************************/
24/***************** BUNDLE STORAGE **************************************************************/
25/***********************************************************************************************/
26private:
27
28 Ptr<Vector<Real>> tG_;
29 Ptr<Vector<Real>> eG_;
30 Ptr<Vector<Real>> yG_;
31 Ptr<Vector<Real>> gx_;
32 Ptr<Vector<Real>> ge_;
33
34 std::set<unsigned> workingSet_;
35 std::set<unsigned> nworkingSet_;
36
38
39/***********************************************************************************************/
40/***************** BUNDLE MODIFICATION AND ACCESS ROUTINES *************************************/
41/***********************************************************************************************/
42public:
43 Bundle_U_AS(const unsigned maxSize = 10,
44 const Real coeff = 0.0,
45 const Real omega = 2.0,
46 const unsigned remSize = 2);
47
48 void initialize(const Vector<Real> &g);
49
50 unsigned solveDual(const Real t, const unsigned maxit = 1000, const Real tol = 1.e-8);
51
52/***********************************************************************************************/
53/***************** DUAL CUTTING PLANE PROBLEM ROUTINES *****************************************/
54/***********************************************************************************************/
55private:
56 void initializeDualSolver(void);
57
58 void computeLagMult(std::vector<Real> &lam, const Real mu, const std::vector<Real> &g) const;
59
60 bool isNonnegative(unsigned &ind, const std::vector<Real> &x) const;
61
62 Real computeStepSize(unsigned &ind, const std::vector<Real> &x, const std::vector<Real> &p) const;
63
64 unsigned solveEQPsubproblem(std::vector<Real> &s, Real &mu,
65 const std::vector<Real> &g, const Real tol) const;
66
67 void applyPreconditioner(std::vector<Real> &Px, const std::vector<Real> &x) const;
68
69 void applyG(std::vector<Real> &Gx, const std::vector<Real> &x) const;
70
71 void applyPreconditioner_Identity(std::vector<Real> &Px, const std::vector<Real> &x) const;
72
73 void applyG_Identity(std::vector<Real> &Gx, const std::vector<Real> &x) const;
74
75 void applyPreconditioner_Jacobi(std::vector<Real> &Px, const std::vector<Real> &x) const;
76
77 void applyG_Jacobi(std::vector<Real> &Gx, const std::vector<Real> &x) const;
78
79 void applyPreconditioner_SymGS(std::vector<Real> &Px, const std::vector<Real> &x) const;
80
81 void applyG_SymGS(std::vector<Real> &Gx, const std::vector<Real> &x) const;
82
83 void computeResidualUpdate(std::vector<Real> &r, std::vector<Real> &g) const;
84
85 void applyFullMatrix(std::vector<Real> &Hx, const std::vector<Real> &x) const;
86
87 void applyMatrix(std::vector<Real> &Hx, const std::vector<Real> &x) const;
88
89 unsigned projectedCG(std::vector<Real> &x, Real &mu, const std::vector<Real> &b, const Real tol) const;
90
91 Real dot(const std::vector<Real> &x, const std::vector<Real> &y) const;
92
93 Real norm(const std::vector<Real> &x) const;
94
95 void axpy(const Real a, const std::vector<Real> &x, std::vector<Real> &y) const;
96
97 void scale(std::vector<Real> &x, const Real a) const;
98
99 void scale(std::vector<Real> &x, const Real a, const std::vector<Real> &y) const;
100
101 unsigned solveDual_arbitrary(const Real t, const unsigned maxit = 1000, const Real tol = 1.e-8);
102
103 /************************************************************************/
104 /********************** PROJECTION ONTO FEASIBLE SET ********************/
105 /************************************************************************/
106 void project(std::vector<Real> &x, const std::vector<Real> &v) const;
107
108 Real computeCriticality(const std::vector<Real> &g, const std::vector<Real> &sol) const;
109}; // class Bundle_AS
110
111} // namespace ROL
112
114
115#endif
Provides the interface for and implements an active set bundle.
void applyG_Identity(std::vector< Real > &Gx, const std::vector< Real > &x) const
std::set< unsigned > workingSet_
unsigned projectedCG(std::vector< Real > &x, Real &mu, const std::vector< Real > &b, const Real tol) const
void applyMatrix(std::vector< Real > &Hx, const std::vector< Real > &x) const
Real norm(const std::vector< Real > &x) const
void applyPreconditioner(std::vector< Real > &Px, const std::vector< Real > &x) const
void applyPreconditioner_SymGS(std::vector< Real > &Px, const std::vector< Real > &x) const
void applyPreconditioner_Jacobi(std::vector< Real > &Px, const std::vector< Real > &x) const
void applyG_Jacobi(std::vector< Real > &Gx, const std::vector< Real > &x) const
Ptr< Vector< Real > > gx_
unsigned solveEQPsubproblem(std::vector< Real > &s, Real &mu, const std::vector< Real > &g, const Real tol) const
void computeResidualUpdate(std::vector< Real > &r, std::vector< Real > &g) const
void applyFullMatrix(std::vector< Real > &Hx, const std::vector< Real > &x) const
void computeLagMult(std::vector< Real > &lam, const Real mu, const std::vector< Real > &g) const
Real dot(const std::vector< Real > &x, const std::vector< Real > &y) const
unsigned solveDual(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
std::set< unsigned > nworkingSet_
void applyG_SymGS(std::vector< Real > &Gx, const std::vector< Real > &x) const
unsigned solveDual_arbitrary(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
Ptr< Vector< Real > > ge_
void applyG(std::vector< Real > &Gx, const std::vector< Real > &x) const
Ptr< Vector< Real > > yG_
bool isNonnegative(unsigned &ind, const std::vector< Real > &x) const
void initialize(const Vector< Real > &g)
void applyPreconditioner_Identity(std::vector< Real > &Px, const std::vector< Real > &x) const
Real computeCriticality(const std::vector< Real > &g, const std::vector< Real > &sol) const
Real computeStepSize(unsigned &ind, const std::vector< Real > &x, const std::vector< Real > &p) const
Ptr< Vector< Real > > eG_
void scale(std::vector< Real > &x, const Real a) const
void axpy(const Real a, const std::vector< Real > &x, std::vector< Real > &y) const
Ptr< Vector< Real > > tG_
void project(std::vector< Real > &x, const std::vector< Real > &v) const
Provides the interface for and implements a bundle.
Defines the linear algebra or vector space interface.