|
ConstrainedOptPack: C++ Tools for Constrained (and Unconstrained) Optimization Version of the Day
|
00001 // @HEADER 00002 // *********************************************************************** 00003 // 00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization 00005 // Copyright (2003) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 // @HEADER 00028 00029 #ifndef QP_SOLVER_RELAXED_H 00030 #define QP_SOLVER_RELAXED_H 00031 00032 #include "ConstrainedOptPack_QPSolverStats.hpp" 00033 #include "Teuchos_StandardMemberCompositionMacros.hpp" 00034 00035 namespace ConstrainedOptPack { 00036 00119 class QPSolverRelaxed { 00120 public: 00121 00124 00126 class Unbounded : public std::logic_error 00127 {public: Unbounded(const std::string& what_arg) : std::logic_error(what_arg) {}}; 00128 00130 class Infeasible : public std::logic_error 00131 {public: Infeasible(const std::string& what_arg) : std::logic_error(what_arg) {}}; 00132 00134 class InvalidInput : public std::logic_error 00135 {public: InvalidInput(const std::string& what_arg) : std::logic_error(what_arg) {}}; 00136 00138 class TestFailed : public std::logic_error 00139 {public: TestFailed(const std::string& what_arg) : std::logic_error(what_arg) {}}; 00140 00142 enum EOutputLevel { 00143 PRINT_NONE = 0, 00144 PRINT_BASIC_INFO = 1, 00145 PRINT_ITER_SUMMARY = 2, 00146 PRINT_ITER_STEPS = 3, 00147 PRINT_ITER_ACT_SET = 4, 00148 PRINT_ITER_VECTORS = 5, 00149 PRINT_EVERY_THING = 6 00150 }; 00151 00153 enum ERunTests { RUN_TESTS, NO_TESTS }; 00154 00156 00159 00161 STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, infinite_bound ); 00162 00164 QPSolverRelaxed(); 00165 00167 virtual ~QPSolverRelaxed() {} 00168 00170 00173 00298 virtual QPSolverStats::ESolutionType solve_qp( 00299 std::ostream* out, EOutputLevel olevel, ERunTests test_what 00300 ,const Vector& g, const MatrixSymOp& G 00301 ,value_type etaL 00302 ,const Vector& dL, const Vector& dU 00303 ,const MatrixOp& E, BLAS_Cpp::Transp trans_E, const Vector& b 00304 ,const Vector& eL, const Vector& eU 00305 ,const MatrixOp& F, BLAS_Cpp::Transp trans_F, const Vector& f 00306 ,value_type* obj_d 00307 ,value_type* eta, VectorMutable* d 00308 ,VectorMutable* nu 00309 ,VectorMutable* mu, VectorMutable* Ed 00310 ,VectorMutable* lambda, VectorMutable* Fd 00311 ); 00312 00318 virtual QPSolverStats::ESolutionType solve_qp( 00319 std::ostream* out, EOutputLevel olevel, ERunTests test_what 00320 ,const Vector& g, const MatrixSymOp& G 00321 ,value_type etaL 00322 ,const Vector& dL, const Vector& dU 00323 ,const MatrixOp& E, BLAS_Cpp::Transp trans_E, const Vector& b 00324 ,const Vector& eL, const Vector& eU 00325 ,value_type* obj_d 00326 ,value_type* eta, VectorMutable* d 00327 ,VectorMutable* nu 00328 ,VectorMutable* mu, VectorMutable* Ed 00329 ); 00330 00336 virtual QPSolverStats::ESolutionType solve_qp( 00337 std::ostream* out, EOutputLevel olevel, ERunTests test_what 00338 ,const Vector& g, const MatrixSymOp& G 00339 ,value_type etaL 00340 ,const Vector& dL, const Vector& dU 00341 ,const MatrixOp& F, BLAS_Cpp::Transp trans_F, const Vector& f 00342 ,value_type* obj_d 00343 ,value_type* eta, VectorMutable* d 00344 ,VectorMutable* nu 00345 ,VectorMutable* lambda, VectorMutable* Fd 00346 ); 00347 00348 00355 virtual QPSolverStats::ESolutionType solve_qp( 00356 std::ostream* out, EOutputLevel olevel, ERunTests test_what 00357 ,const Vector& g, const MatrixSymOp& G 00358 ,const Vector& dL, const Vector& dU 00359 ,value_type* obj_d 00360 ,VectorMutable* d 00361 ,VectorMutable* nu 00362 ); 00363 00375 virtual QPSolverStats::ESolutionType solve_qp( 00376 std::ostream* out, EOutputLevel olevel, ERunTests test_what 00377 ,const Vector& g, const MatrixSymOp& G 00378 ,value_type etaL 00379 ,const Vector* dL, const Vector* dU 00380 ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b 00381 ,const Vector* eL, const Vector* eU 00382 ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f 00383 ,value_type* obj_d 00384 ,value_type* eta, VectorMutable* d 00385 ,VectorMutable* nu 00386 ,VectorMutable* mu, VectorMutable* Ed 00387 ,VectorMutable* lambda, VectorMutable* Fd 00388 ); 00389 00403 virtual QPSolverStats get_qp_stats() const = 0; 00404 00407 virtual void release_memory() = 0; 00408 00410 00413 00436 static void validate_input( 00437 const value_type infinite_bound 00438 ,const Vector& g, const MatrixSymOp& G 00439 ,value_type etaL 00440 ,const Vector* dL, const Vector* dU 00441 ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b 00442 ,const Vector* eL, const Vector* eU 00443 ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f 00444 ,const value_type* obj_d 00445 ,const value_type* eta, const Vector* d 00446 ,const Vector* nu 00447 ,const Vector* mu, const Vector* Ed 00448 ,const Vector* lambda, const Vector* Fd 00449 ); 00450 00466 static void print_qp_input( 00467 const value_type infinite_bound 00468 ,std::ostream* out, EOutputLevel olevel 00469 ,const Vector& g, const MatrixSymOp& G 00470 ,value_type etaL 00471 ,const Vector* dL, const Vector* dU 00472 ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b 00473 ,const Vector* eL, const Vector* eU 00474 ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f 00475 ,value_type* eta, VectorMutable* d 00476 ,VectorMutable* nu 00477 ,VectorMutable* mu 00478 ,VectorMutable* lambda 00479 ); 00480 00496 static void print_qp_output( 00497 const value_type infinite_bound 00498 ,std::ostream* out, EOutputLevel olevel 00499 ,const value_type* obj_d 00500 ,const value_type* eta, const Vector* d 00501 ,const Vector* nu 00502 ,const Vector* mu, const Vector* Ed 00503 ,const Vector* lambda, const Vector* Fd 00504 ); 00505 00507 00508 protected: 00509 00512 00517 virtual QPSolverStats::ESolutionType imp_solve_qp( 00518 std::ostream* out, EOutputLevel olevel, ERunTests test_what 00519 ,const Vector& g, const MatrixSymOp& G 00520 ,value_type etaL 00521 ,const Vector* dL, const Vector* dU 00522 ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b 00523 ,const Vector* eL, const Vector* eU 00524 ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f 00525 ,value_type* obj_d 00526 ,value_type* eta, VectorMutable* d 00527 ,VectorMutable* nu 00528 ,VectorMutable* mu, VectorMutable* Ed 00529 ,VectorMutable* lambda, VectorMutable* Fd 00530 ) = 0; 00531 00533 00534 }; // end class QPSovlerRelaxed 00535 00536 } // end namespace ConstrainedOptPack 00537 00538 #endif // QP_SOLVER_RELAXED_H
1.7.4