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 
19 namespace ROL {
20 
21 template<typename Real>
22 class Bundle_U_AS : public Bundle_U<Real> {
23 /***********************************************************************************************/
24 /***************** BUNDLE STORAGE **************************************************************/
25 /***********************************************************************************************/
26 private:
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 /***********************************************************************************************/
42 public:
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 /***********************************************************************************************/
55 private:
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 
113 #include "ROL_Bundle_U_AS_Def.hpp"
114 
115 #endif
bool isNonnegative(unsigned &ind, const std::vector< Real > &x) const
Real norm(const std::vector< Real > &x) const
void scale(std::vector< Real > &x, const Real a) const
Ptr< Vector< Real > > yG_
void applyPreconditioner(std::vector< Real > &Px, const std::vector< Real > &x) const
Ptr< Vector< Real > > eG_
unsigned solveEQPsubproblem(std::vector< Real > &s, Real &mu, const std::vector< Real > &g, const Real tol) const
void applyPreconditioner_Jacobi(std::vector< Real > &Px, const std::vector< Real > &x) const
Real dot(const std::vector< Real > &x, const std::vector< Real > &y) const
void applyG_Identity(std::vector< Real > &Gx, const std::vector< Real > &x) const
Provides the interface for and implements a bundle.
Ptr< Vector< Real > > ge_
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
void applyPreconditioner_SymGS(std::vector< Real > &Px, const std::vector< Real > &x) const
Ptr< Vector< Real > > tG_
void applyMatrix(std::vector< Real > &Hx, const std::vector< Real > &x) const
Ptr< Vector< Real > > gx_
Real computeCriticality(const std::vector< Real > &g, const std::vector< Real > &sol) const
std::set< unsigned > workingSet_
std::set< unsigned > nworkingSet_
unsigned projectedCG(std::vector< Real > &x, Real &mu, const std::vector< Real > &b, const Real tol) const
unsigned solveDual_arbitrary(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
unsigned solveDual(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
Provides the interface for and implements an active set bundle.
void computeResidualUpdate(std::vector< Real > &r, std::vector< Real > &g) const
void applyG(std::vector< Real > &Gx, const std::vector< Real > &x) const
void initialize(const Vector< Real > &g)
Real computeStepSize(unsigned &ind, const std::vector< Real > &x, const std::vector< Real > &p) const
void applyG_Jacobi(std::vector< Real > &Gx, const std::vector< Real > &x) const
void axpy(const Real a, const std::vector< Real > &x, std::vector< Real > &y) const
void applyPreconditioner_Identity(std::vector< Real > &Px, const std::vector< Real > &x) const
void initializeDualSolver(void)
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
void project(std::vector< Real > &x, const std::vector< Real > &v) const
Bundle_U_AS(const unsigned maxSize=10, const Real coeff=0.0, const Real omega=2.0, const unsigned remSize=2)
void applyG_SymGS(std::vector< Real > &Gx, const std::vector< Real > &x) const