MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstrainedOptPack_QPSolverRelaxedQPOPTSOL.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) 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 Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef QP_SOLVER_RELAXED_QPOPTSOL_H
43 #define QP_SOLVER_RELAXED_QPOPTSOL_H
44 
45 #include <vector>
46 
51 
52 namespace ConstrainedOptPack {
53 
61 {
62 public:
63 
64  // /////////////////////////////////////
67 
74 
76 
79 
82 
84  virtual const MatrixOp* G() const;
85 
87  virtual value_type use_as_bigM() const;
88 
89  // /////////////////////////////////
90  // Overridden from QPSolverRelaxed
91 
94 
96  void release_memory();
97 
98 protected:
99 
100  // /////////////////////////////////
101  // Overridden from QPSolverRelaxed
102 
105  std::ostream* out, EOutputLevel olevel, ERunTests test_what
106  ,const Vector& g, const MatrixSymOp& G
107  ,value_type etaL
108  ,const Vector* dL, const Vector* dU
109  ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b
110  ,const Vector* eL, const Vector* eU
111  ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f
112  ,value_type* obj_d
113  ,value_type* eta, VectorMutable* d
114  ,VectorMutable* nu
115  ,VectorMutable* mu, VectorMutable* Ed
116  ,VectorMutable* lambda, VectorMutable* Fd
117  );
118 
119  // //////////////////////////////////////////////////////////////
120  // Protected types
121 
123  typedef std::vector<f_int> ISTATE_t;
125  typedef std::vector<f_int> IWORK_t;
127  typedef std::vector<f_dbl_prec> WORK_t;
128 public: // RAB: 2001/05/03: MS VC++ 6.0 must have this public ???
130  enum EInform {
135  };
136 
137 protected:
138 
139  // //////////////////////////////////////////////////////////////
140  // Protected Data Members.
141 
143 
150 
183 
185 
186  // /////////////////////////////////////////////////////////////
187  // Template method primatives to be overridden.
188 
190  virtual f_int liwork(f_int N, f_int NCLIN) const = 0;
191 
193  virtual f_int lrwork(f_int N, f_int NCLIN) const = 0;
194 
198  virtual EInform call_qp_solver(bool warm_start) = 0;
199 
200 private:
201 
202  // /////////////////////////
203  // Private types
204 
205  typedef std::vector<f_int> ibnds_t;
206 
207  // ///////////////////////////
208  // Private data members
209 
210  size_type n_inequ_bnds_; // Used to record the number of bounds with at least
211  // one bound existing in eL and eU.
212  ibnds_t i_inequ_bnds_; // size(nbounds_). Remembers which bounds in
213  // eL, eU had at least one bound present. This is
214  // needed to map from CLAMDA_ to mu.
215  value_type bigM_; // Big M value used to construct relaxation.
216  value_type use_as_bigM_; // Big M value used in QPHESS.
217  const MatrixOp* G_; // used to compute HESS * x = [ G, 0; 0, bigM ] * x products.
218 
219  // ///////////////////////////
220  // Private member functions
221 
222  // not defined and not to be called.
225 
226 }; // end class QPSolverRelaxedQPOPTSOL
227 
228 } // end namespace ConstrainedOptimizationPackTypes
229 
230 #endif // QP_SOLVER_RELAXED_QPOPTSOL_H
AbstractLinAlgPack::size_type size_type
virtual f_int lrwork(f_int N, f_int NCLIN) const =0
Length of real workspace.
ERunTests
Enumeration for if to run internal tests or not.
virtual const MatrixOp * G() const
Return a pointer to the matrix G to be used in the calculation of H*x by QPOPT and QPSOL...
FortranTypes::f_int f_int
FortranTypes::f_logical f_logical
virtual f_int liwork(f_int N, f_int NCLIN) const =0
Length of integer workspace.
Solves Quadratic Programs (QPs) of several different forms while allowing a relaxation of the constra...
QPSolverRelaxedQPOPTSOL & operator=(const QPSolverRelaxedQPOPTSOL &)
virtual EInform call_qp_solver(bool warm_start)=0
Solve the QP defined in the protected input data members and set the solution in the protected output...
Node base clase for the primal QP solvers QPOPT and QPSOL.
std::ostream * out
Class for storing statistics about a run of a (active set?) QP solver.
EOutputLevel
Enumeration for the amount of output to create from solve_qp().
QPSolverStats::ESolutionType imp_solve_qp(std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Vector &g, const MatrixSymOp &G, value_type etaL, const Vector *dL, const Vector *dU, const MatrixOp *E, BLAS_Cpp::Transp trans_E, const Vector *b, const Vector *eL, const Vector *eU, const MatrixOp *F, BLAS_Cpp::Transp trans_F, const Vector *f, value_type *obj_d, value_type *eta, VectorMutable *d, VectorMutable *nu, VectorMutable *mu, VectorMutable *Ed, VectorMutable *lambda, VectorMutable *Fd)
AbstractLinAlgPack::value_type value_type
virtual value_type use_as_bigM() const
Return the value of the "big M" used in the relaxation (called by QPHESS functions).
const f_int const f_int & N
Transp
TRANS.
FortranTypes::f_dbl_prec f_dbl_prec
ESolutionType
Enumeration for the type of point returned from solve_qp(...).