MOOCHO (Single Doxygen Collection) Version of the Day
ConstrainedOptPack_QPSolverRelaxed.hpp
Go to the documentation of this file.
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 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00038 // 
00039 // ***********************************************************************
00040 // @HEADER
00041 
00042 #ifndef QP_SOLVER_RELAXED_H
00043 #define QP_SOLVER_RELAXED_H
00044 
00045 #include "ConstrainedOptPack_QPSolverStats.hpp"
00046 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00047 
00048 namespace ConstrainedOptPack {
00049 
00132 class QPSolverRelaxed {
00133 public:
00134 
00137 
00139   class Unbounded : public std::logic_error
00140   {public: Unbounded(const std::string& what_arg) : std::logic_error(what_arg) {}};
00141 
00143   class Infeasible : public std::logic_error
00144   {public: Infeasible(const std::string& what_arg) : std::logic_error(what_arg) {}};
00145 
00147   class InvalidInput : public std::logic_error
00148   {public: InvalidInput(const std::string& what_arg) : std::logic_error(what_arg) {}};
00149 
00151   class TestFailed : public std::logic_error
00152   {public: TestFailed(const std::string& what_arg) : std::logic_error(what_arg) {}};
00153 
00155   enum EOutputLevel {
00156     PRINT_NONE      = 0,
00157     PRINT_BASIC_INFO  = 1,
00158     PRINT_ITER_SUMMARY  = 2,
00159     PRINT_ITER_STEPS  = 3,
00160     PRINT_ITER_ACT_SET  = 4,
00161     PRINT_ITER_VECTORS  = 5,
00162     PRINT_EVERY_THING = 6
00163     };
00164 
00166   enum ERunTests { RUN_TESTS, NO_TESTS };
00167 
00169 
00172 
00174   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, infinite_bound );
00175 
00177   QPSolverRelaxed();
00178 
00180   virtual ~QPSolverRelaxed() {}
00181 
00183 
00186 
00311   virtual QPSolverStats::ESolutionType solve_qp(
00312     std::ostream* out, EOutputLevel olevel, ERunTests test_what
00313     ,const Vector& g, const MatrixSymOp& G
00314     ,value_type etaL
00315     ,const Vector& dL, const Vector& dU
00316     ,const MatrixOp& E, BLAS_Cpp::Transp trans_E, const Vector& b
00317     ,const Vector& eL, const Vector& eU
00318     ,const MatrixOp& F, BLAS_Cpp::Transp trans_F, const Vector& f
00319     ,value_type* obj_d
00320     ,value_type* eta, VectorMutable* d
00321     ,VectorMutable* nu
00322     ,VectorMutable* mu, VectorMutable* Ed
00323     ,VectorMutable* lambda, VectorMutable* Fd
00324     );
00325 
00331   virtual QPSolverStats::ESolutionType solve_qp(
00332     std::ostream* out, EOutputLevel olevel, ERunTests test_what
00333     ,const Vector& g, const MatrixSymOp& G
00334     ,value_type etaL
00335     ,const Vector& dL, const Vector& dU
00336     ,const MatrixOp& E, BLAS_Cpp::Transp trans_E, const Vector& b
00337     ,const Vector& eL, const Vector& eU
00338     ,value_type* obj_d
00339     ,value_type* eta, VectorMutable* d
00340     ,VectorMutable* nu
00341     ,VectorMutable* mu, VectorMutable* Ed
00342     );
00343 
00349   virtual QPSolverStats::ESolutionType solve_qp(
00350     std::ostream* out, EOutputLevel olevel, ERunTests test_what
00351     ,const Vector& g, const MatrixSymOp& G
00352     ,value_type etaL
00353     ,const Vector& dL, const Vector& dU
00354     ,const MatrixOp& F, BLAS_Cpp::Transp trans_F, const Vector& f
00355     ,value_type* obj_d
00356     ,value_type* eta, VectorMutable* d
00357     ,VectorMutable* nu
00358     ,VectorMutable* lambda, VectorMutable* Fd
00359     );
00360 
00361 
00368   virtual QPSolverStats::ESolutionType solve_qp(
00369     std::ostream* out, EOutputLevel olevel, ERunTests test_what
00370     ,const Vector& g, const MatrixSymOp& G
00371     ,const Vector& dL, const Vector& dU
00372     ,value_type* obj_d
00373     ,VectorMutable* d
00374     ,VectorMutable* nu
00375     );
00376 
00388   virtual QPSolverStats::ESolutionType solve_qp(
00389     std::ostream* out, EOutputLevel olevel, ERunTests test_what
00390     ,const Vector& g, const MatrixSymOp& G
00391     ,value_type etaL
00392     ,const Vector* dL, const Vector* dU
00393     ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b
00394     ,const Vector* eL, const Vector* eU
00395     ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f
00396     ,value_type* obj_d
00397     ,value_type* eta, VectorMutable* d
00398     ,VectorMutable* nu
00399     ,VectorMutable* mu, VectorMutable* Ed
00400     ,VectorMutable* lambda, VectorMutable* Fd
00401     );
00402 
00416   virtual QPSolverStats get_qp_stats() const = 0;
00417 
00420   virtual void release_memory() = 0;
00421 
00423 
00426 
00449   static void validate_input(
00450     const value_type infinite_bound
00451     ,const Vector& g, const MatrixSymOp& G
00452     ,value_type etaL
00453     ,const Vector* dL, const Vector* dU
00454     ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b
00455     ,const Vector* eL, const Vector* eU
00456     ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f
00457     ,const value_type* obj_d
00458     ,const value_type* eta, const Vector* d
00459     ,const Vector* nu
00460     ,const Vector* mu, const Vector* Ed
00461     ,const Vector* lambda, const Vector* Fd
00462     );
00463 
00479   static void print_qp_input( 
00480     const value_type infinite_bound
00481     ,std::ostream* out, EOutputLevel olevel
00482     ,const Vector& g, const MatrixSymOp& G
00483     ,value_type etaL
00484     ,const Vector* dL, const Vector* dU
00485     ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b
00486     ,const Vector* eL, const Vector* eU
00487     ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f
00488     ,value_type* eta, VectorMutable* d
00489     ,VectorMutable* nu
00490     ,VectorMutable* mu
00491     ,VectorMutable* lambda
00492     );
00493 
00509   static void print_qp_output(
00510     const value_type infinite_bound
00511     ,std::ostream* out, EOutputLevel olevel
00512     ,const value_type* obj_d
00513     ,const value_type* eta, const Vector* d
00514     ,const Vector* nu
00515     ,const Vector* mu, const Vector* Ed
00516     ,const Vector* lambda, const Vector* Fd
00517     );
00518 
00520 
00521 protected:
00522 
00525 
00530   virtual QPSolverStats::ESolutionType imp_solve_qp(
00531     std::ostream* out, EOutputLevel olevel, ERunTests test_what
00532     ,const Vector& g, const MatrixSymOp& G
00533     ,value_type etaL
00534     ,const Vector* dL, const Vector* dU
00535     ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b
00536     ,const Vector* eL, const Vector* eU
00537     ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f
00538     ,value_type* obj_d
00539     ,value_type* eta, VectorMutable* d
00540     ,VectorMutable* nu
00541     ,VectorMutable* mu, VectorMutable* Ed
00542     ,VectorMutable* lambda, VectorMutable* Fd
00543     ) = 0;
00544 
00546 
00547 };  // end class QPSovlerRelaxed
00548 
00549 } // end namespace ConstrainedOptPack
00550 
00551 #endif  // QP_SOLVER_RELAXED_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines