ROL
ROL_Bundle_U_TT.hpp
Go to the documentation of this file.
1// @HEADER
2// ************************************************************************
3//
4// Rapid Optimization Library (ROL) Package
5// Copyright (2014) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact lead developers:
38// Drew Kouri (dpkouri@sandia.gov) and
39// Denis Ridzal (dridzal@sandia.gov)
40//
41// ************************************************************************
42// @HEADER
43
44#ifndef ROL_BUNDLE_U_TT_H
45#define ROL_BUNDLE_U_TT_H
46
47#include "ROL_Bundle_U.hpp"
48#include "ROL_LAPACK.hpp"
49#include "ROL_LinearAlgebra.hpp"
50#include <vector>
51
58namespace ROL {
59
60template<typename Real>
61class Bundle_U_TT : public Bundle_U<Real> {
62private:
63 LAPACK<int, Real> lapack_; // TT
64
65 int QPStatus_; // QP solver status
66 int maxind_; // maximum integer value
67 int entering_; // index of entering item
68 int LiMax_; // index of max element of diag(L)
69 int LiMin_; // index of min element of diag(L)
70
71 unsigned maxSize_; // maximum bundle size
72 unsigned dependent_; // number of lin. dependent items in base
73 unsigned currSize_; // current size of base
74
76 bool optimal_; // flag for optimality of restricted solution
77
78 Real rho_;
79 Real lhNorm;
80 Real ljNorm;
81 Real lhz1_;
82 Real lhz2_;
83 Real ljz1_;
84 Real kappa_; // condition number of matrix L ( >= max|L_ii|/min|L_ii| )
85 Real objval_; // value of objective
86 Real minobjval_; // min value of objective (ever reached)
87 Real deltaLh_; // needed in case dependent row becomes independent
88 Real deltaLj_; // needed in case dependent row becomes independent
89
90 std::vector<int> taboo_; // list of "taboo" items
91 std::vector<int> base_; // base
92
93 LA::Matrix<Real> L_;
94 LA::Matrix<Real> Id_;
95 LA::Vector<Real> tempv_;
96 LA::Vector<Real> tempw1_;
97 LA::Vector<Real> tempw2_;
98 LA::Vector<Real> lh_;
99 LA::Vector<Real> lj_;
100 LA::Vector<Real> z1_;
101 LA::Vector<Real> z2_;
102
103 using Bundle_U<Real>::GiGj;
104
105public:
106 Bundle_U_TT(const unsigned maxSize = 10,
107 const Real coeff = 0.0,
108 const Real omega = 2.0,
109 const unsigned remSize = 2);
110
111 unsigned solveDual(const Real t, const unsigned maxit = 1000, const Real tol = 1.e-8);
112
113/***********************************************************************************************/
114/****************** DUAL CUTTING PLANE SUBPROBLEM ROUTINES *************************************/
115/***********************************************************************************************/
116private:
117 Real sgn(const Real x) const;
118
119 void swapRowsL(unsigned ind1, unsigned ind2, bool trans=false);
120
121 void updateK(void);
122
123 void addSubgradToBase(unsigned ind, Real delta);
124
125 void deleteSubgradFromBase(unsigned ind, Real tol);
126
127 // TT: solving triangular system for TT algorithm
128 void solveSystem(int size, char tran, LA::Matrix<Real> &L, LA::Vector<Real> &v);
129
130 // TT: check that inequality constraints are satisfied for dual variables
131 bool isFeasible(LA::Vector<Real> &v, const Real &tol);
132
133 unsigned solveDual_TT(const Real t, const unsigned maxit = 1000, const Real tol = 1.e-8);
134
135 unsigned solveDual_arbitrary(const Real t, const unsigned maxit = 1000, const Real tol = 1.e-8);
136
137}; // class Bundle_TT
138
139} // namespace ROL
140
142
143#endif
144
Provides the interface for and implements a bundle. The semidefinite quadratic subproblem is solved u...
LA::Vector< Real > tempv_
LAPACK< int, Real > lapack_
Real sgn(const Real x) const
LA::Vector< Real > tempw1_
void addSubgradToBase(unsigned ind, Real delta)
void deleteSubgradFromBase(unsigned ind, Real tol)
unsigned solveDual_arbitrary(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
bool isFeasible(LA::Vector< Real > &v, const Real &tol)
void solveSystem(int size, char tran, LA::Matrix< Real > &L, LA::Vector< Real > &v)
LA::Matrix< Real > Id_
LA::Vector< Real > tempw2_
LA::Vector< Real > z2_
LA::Matrix< Real > L_
void swapRowsL(unsigned ind1, unsigned ind2, bool trans=false)
std::vector< int > taboo_
LA::Vector< Real > z1_
LA::Vector< Real > lj_
LA::Vector< Real > lh_
unsigned solveDual(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
std::vector< int > base_
unsigned solveDual_TT(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
Provides the interface for and implements a bundle.
unsigned size(void) const
const Real GiGj(const unsigned i, const unsigned j) const