MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstrainedOptPack_QPSolverRelaxedTester.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_TESTER_H
43 #define QP_SOLVER_RELAXED_TESTER_H
44 
47 
48 namespace ConstrainedOptPack {
49 
147 public:
148 
151 
154 
156  STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, feas_warning_tol );
157 
160 
162  STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, comp_warning_tol );
163 
166 
169  value_type opt_warning_tol = 1e-10
170  ,value_type opt_error_tol = 1e-5
171  ,value_type feas_warning_tol = 1e-10
172  ,value_type feas_error_tol = 1e-5
173  ,value_type comp_warning_tol = 1e-10
174  ,value_type comp_error_tol = 1e-5
175  );
176 
179 
226  virtual bool check_optimality_conditions(
227  QPSolverStats::ESolutionType solution_type
228  ,const value_type infinite_bound
229  ,std::ostream* out, bool print_all_warnings, bool print_vectors
230  ,const Vector& g, const MatrixSymOp& G
231  ,value_type etaL
232  ,const Vector& dL, const Vector& dU
233  ,const MatrixOp& E, BLAS_Cpp::Transp trans_E, const Vector& b
234  ,const Vector& eL, const Vector& eU
235  ,const MatrixOp& F, BLAS_Cpp::Transp trans_F, const Vector& f
236  ,const value_type* obj_d
237  ,const value_type* eta, const Vector* d
238  ,const Vector* nu
239  ,const Vector* mu, const Vector* Ed
240  ,const Vector* lambda, const Vector* Fd
241  );
242 
245  virtual bool check_optimality_conditions(
246  QPSolverStats::ESolutionType solution_type
247  ,const value_type infinite_bound
248  ,std::ostream* out, bool print_all_warnings, bool print_vectors
249  ,const Vector& g, const MatrixSymOp& G
250  ,value_type etaL
251  ,const Vector& dL, const Vector& dU
252  ,const MatrixOp& E, BLAS_Cpp::Transp trans_E, const Vector& b
253  ,const Vector& eL, const Vector& eU
254  ,const value_type* obj_d
255  ,const value_type* eta, const Vector* d
256  ,const Vector* nu
257  ,const Vector* mu, const Vector* Ed
258  );
259 
262  virtual bool check_optimality_conditions(
263  QPSolverStats::ESolutionType solution_type
264  ,const value_type infinite_bound
265  ,std::ostream* out, bool print_all_warnings, bool print_vectors
266  ,const Vector& g, const MatrixSymOp& G
267  ,value_type etaL
268  ,const Vector& dL, const Vector& dU
269  ,const MatrixOp& F, BLAS_Cpp::Transp trans_F, const Vector& f
270  ,const value_type* obj_d
271  ,const value_type* eta, const Vector* d
272  ,const Vector* nu
273  ,const Vector* lambda, const Vector* Fd
274  );
275 
276 
280  virtual bool check_optimality_conditions(
281  QPSolverStats::ESolutionType solution_type
282  ,const value_type infinite_bound
283  ,std::ostream* out, bool print_all_warnings, bool print_vectors
284  ,const Vector& g, const MatrixSymOp& G
285  ,const Vector& dL, const Vector& dU
286  ,const value_type* obj_d
287  ,const Vector* d
288  ,const Vector* nu
289  );
290 
295  virtual bool check_optimality_conditions(
296  QPSolverStats::ESolutionType solution_type
297  ,const value_type infinite_bound
298  ,std::ostream* out, bool print_all_warnings, bool print_vectors
299  ,const Vector& g, const MatrixSymOp& G
300  ,value_type etaL
301  ,const Vector* dL, const Vector* dU
302  ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b
303  ,const Vector* eL, const Vector* eU
304  ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f
305  ,const value_type* obj_d
306  ,const value_type* eta, const Vector* d
307  ,const Vector* nu
308  ,const Vector* mu, const Vector* Ed
309  ,const Vector* lambda, const Vector* Fd
310  );
311 
312 protected:
313 
319  virtual bool imp_check_optimality_conditions(
320  QPSolverStats::ESolutionType solution_type
321  ,const value_type infinite_bound
322  ,std::ostream* out, bool print_all_warnings, bool print_vectors
323  ,const Vector& g, const MatrixSymOp& G
324  ,value_type etaL
325  ,const Vector* dL, const Vector* dU
326  ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b
327  ,const Vector* eL, const Vector* eU
328  ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f
329  ,const value_type* obj_d
330  ,const value_type* eta, const Vector* d
331  ,const Vector* nu
332  ,const Vector* mu, const Vector* Ed
333  ,const Vector* lambda, const Vector* Fd
334  );
335 
336 }; // end class QPSolverRelaxedTester
337 
338 } // end namespace ConstrainedOptimizationPackTypes
339 
340 #endif // QP_SOLVER_RELAXED_TESTER_H
Tests the optimality conditions of the output from a QPSolverRelaxed object.
virtual bool imp_check_optimality_conditions(QPSolverStats::ESolutionType solution_type, const value_type infinite_bound, std::ostream *out, bool print_all_warnings, bool print_vectors, 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, const value_type *obj_d, const value_type *eta, const Vector *d, const Vector *nu, const Vector *mu, const Vector *Ed, const Vector *lambda, const Vector *Fd)
Subclasses are to override this to implement the testing code.
STANDARD_MEMBER_COMPOSITION_MEMBERS(value_type, opt_warning_tol)
virtual bool check_optimality_conditions(QPSolverStats::ESolutionType solution_type, const value_type infinite_bound, std::ostream *out, bool print_all_warnings, bool print_vectors, 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, const value_type *obj_d, const value_type *eta, const Vector *d, const Vector *nu, const Vector *mu, const Vector *Ed, const Vector *lambda, const Vector *Fd)
Check the optimality conditions for the solved (or partially solved) QP.
std::ostream * out
AbstractLinAlgPack::value_type value_type
QPSolverRelaxedTester(value_type opt_warning_tol=1e-10, value_type opt_error_tol=1e-5, value_type feas_warning_tol=1e-10, value_type feas_error_tol=1e-5, value_type comp_warning_tol=1e-10, value_type comp_error_tol=1e-5)
Transp
TRANS.
ESolutionType
Enumeration for the type of point returned from solve_qp(...).