ConstrainedOptPack_QPSolverRelaxedQPSchur.hpp

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_QP_SCHUR_H
00030 #define QP_SOLVER_RELAXED_QP_SCHUR_H
00031 
00032 #include "ConstrainedOptPack_QPSolverRelaxed.hpp"
00033 #include "ConstrainedOptPack_QPSchur.hpp"
00034 #include "ConstrainedOptPack_QPInitFixedFreeStd.hpp"
00035 #include "ConstrainedOptPack_MatrixSymHessianRelaxNonSing.hpp"
00036 #include "ConstrainedOptPack_ConstraintsRelaxedStd.hpp"
00037 #include "ConstrainedOptPack_MatrixSymAddDelBunchKaufman.hpp"
00038 #include "AbstractLinAlgPack_VectorMutableDense.hpp"
00039 #include "Teuchos_StandardCompositionMacros.hpp"
00040 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00041 
00042 namespace ConstrainedOptPack {
00043 
00050 class QPSolverRelaxedQPSchur : public QPSolverRelaxed {
00051 public:
00052 
00058   class InitKKTSystem {
00059   public:
00061     typedef std::vector<size_type> i_x_free_t;
00063     typedef std::vector<size_type> i_x_fixed_t;
00065     typedef std::vector<EBounds>   bnd_fixed_t;
00067     typedef std::vector<size_type> j_f_decomp_t;
00069     typedef Teuchos::RefCountPtr<const MatrixSymOpNonsing>
00070       Ko_ptr_t;
00072     virtual ~InitKKTSystem() {}
00146     virtual void initialize_kkt_system(
00147       const Vector    &g
00148       ,const MatrixOp   &G
00149       ,value_type           etaL
00150       ,const Vector   *dL
00151       ,const Vector   *dU
00152       ,const MatrixOp   *F
00153       ,BLAS_Cpp::Transp     trans_F
00154       ,const Vector   *f
00155       ,const Vector   *d
00156       ,const Vector   *nu
00157       ,size_type            *n_R
00158       ,i_x_free_t           *i_x_free
00159       ,i_x_fixed_t          *i_x_fixed
00160       ,bnd_fixed_t          *bnd_fixed
00161       ,j_f_decomp_t         *j_f_decomp
00162       ,DVector               *b_X
00163       ,Ko_ptr_t             *Ko
00164       ,DVector               *fo
00165       ) const = 0;
00166 
00167   }; // end class InitKKTSystem
00168 
00178   class ReinitKKTSystem : public InitKKTSystem {
00179   public:
00180     // ToDo: Create method reinitailze_kkt_system(...)
00181   }; // end class ReinitKKTSystem
00182 
00185   STANDARD_COMPOSITION_MEMBERS( InitKKTSystem, init_kkt_sys )
00186 
00187   
00189   STANDARD_COMPOSITION_MEMBERS( QPSchurPack::ConstraintsRelaxedStd, constraints )
00190 
00193   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, max_qp_iter_frac )
00194 
00197   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, max_real_runtime )
00198 
00201   STANDARD_MEMBER_COMPOSITION_MEMBERS( QPSchurPack::ConstraintsRelaxedStd::EInequalityPickPolicy
00202                           , inequality_pick_policy )
00203 
00205   enum ELocalOutputLevel {
00206      USE_INPUT_ARG        = -1  // Use the value input to solve_qp(...)
00207     ,NO_OUTPUT          = 0   //
00208     ,OUTPUT_BASIC_INFO      = 1   // values sent to QPSchur::solve_qp(...)
00209     ,OUTPUT_ITER_SUMMARY    = 2   // ...
00210     ,OUTPUT_ITER_STEPS      = 3
00211     ,OUTPUT_ACT_SET       = 4
00212     ,OUTPUT_ITER_QUANTITIES   = 5
00213   };
00214 
00217   STANDARD_MEMBER_COMPOSITION_MEMBERS( ELocalOutputLevel, print_level )
00218 
00219   
00221   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, bounds_tol )
00222 
00225   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, inequality_tol )
00226 
00229   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, equality_tol )
00230 
00233   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, loose_feas_tol )
00234 
00238   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, dual_infeas_tol )
00239 
00244   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, huge_primal_step )
00245 
00250   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, huge_dual_step )
00251 
00254   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, bigM )
00255 
00258   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, warning_tol )
00259 
00262   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, error_tol )
00263 
00267   STANDARD_MEMBER_COMPOSITION_MEMBERS( size_type, iter_refine_min_iter )
00268     
00272   STANDARD_MEMBER_COMPOSITION_MEMBERS( size_type, iter_refine_max_iter )
00273 
00277   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, iter_refine_opt_tol )
00278 
00282   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, iter_refine_feas_tol )
00283 
00287   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, iter_refine_at_solution )
00288 
00293   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, pivot_warning_tol )
00294 
00299   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, pivot_singular_tol )
00300 
00305   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, pivot_wrong_inertia_tol )
00306 
00310   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, add_equalities_initially )
00311 
00313   QPSolverRelaxedQPSchur(
00314     const init_kkt_sys_ptr_t&    init_kkt_sys       = Teuchos::null
00315     ,const constraints_ptr_t&    constraints        = Teuchos::rcp(new QPSchurPack::ConstraintsRelaxedStd)
00316     ,value_type                  max_qp_iter_frac   = 10.0
00317     ,value_type                  max_real_runtime   = 1e+20
00318     ,QPSchurPack::ConstraintsRelaxedStd::EInequalityPickPolicy
00319                                  inequality_pick_policy
00320                                      = QPSchurPack::ConstraintsRelaxedStd::ADD_BOUNDS_THEN_MOST_VIOLATED_INEQUALITY
00321     ,ELocalOutputLevel           print_level             = USE_INPUT_ARG  // Deduce from input arguments
00322     ,value_type                  bounds_tol              = -1.0           // use default
00323     ,value_type                  inequality_tol          = -1.0           // use default
00324     ,value_type                  equality_tol            = -1.0           // use default
00325     ,value_type                  loose_feas_tol          = -1.0           // use default
00326     ,value_type                  dual_infeas_tol         = -1.0           // use default
00327     ,value_type                  huge_primal_step        = -1.0           // use defalut
00328     ,value_type                  huge_dual_step          = -1.0           // use default
00329     ,value_type                  bigM                    = 1e+10
00330     ,value_type                  warning_tol             = 1e-10
00331     ,value_type                  error_tol               = 1e-5
00332     ,size_type                   iter_refine_min_iter    = 1
00333     ,size_type                   iter_refine_max_iter    = 3
00334     ,value_type                  iter_refine_opt_tol     = 1e-12
00335     ,value_type                  iter_refine_feas_tol    = 1e-12
00336     ,bool                        iter_refine_at_solution = true
00337     ,value_type                  pivot_warning_tol       = 1e-8
00338     ,value_type                  pivot_singular_tol      = 1e-11
00339     ,value_type                  pivot_wrong_inertia_tol = 1e-11
00340     ,bool                        add_equalities_initially= true
00341     );
00342 
00344   ~QPSolverRelaxedQPSchur();
00345 
00348 
00350   QPSolverStats get_qp_stats() const;
00352   void release_memory();
00353 
00355 
00356 protected:
00357 
00360 
00362   QPSolverStats::ESolutionType imp_solve_qp(
00363     std::ostream* out, EOutputLevel olevel, ERunTests test_what
00364     ,const Vector& g, const MatrixSymOp& G
00365     ,value_type etaL
00366     ,const Vector* dL, const Vector* dU
00367     ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b
00368     ,const Vector* eL, const Vector* eU
00369     ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f
00370     ,value_type* obj_d
00371     ,value_type* eta, VectorMutable* d
00372     ,VectorMutable* nu
00373     ,VectorMutable* mu, VectorMutable* Ed
00374     ,VectorMutable* lambda, VectorMutable* Fd
00375     );
00376 
00378 
00379 private:
00380 
00381   // ////////////////////////////
00382   // Private data members
00383 
00384   QPSolverStats                    qp_stats_;
00385   QPSchur                          qp_solver_;
00386   QPSchurPack::QPInitFixedFreeStd  qp_;
00387   MatrixSymHessianRelaxNonSing     G_relaxed_;
00388   VectorMutableDense         bigM_vec_;
00389   MatrixSymAddDelBunchKaufman      schur_comp_;
00390   DVector                           g_relaxed_;
00391   DVector                           b_X_;
00392   InitKKTSystem::Ko_ptr_t          Ko_;
00393   DVector                           fo_;
00394 
00395 }; // end class QPSolverRelaxedQPSchur
00396 
00397 } // end namespace ConstrainedOptPack
00398 
00399 #endif // QP_SOLVER_RELAXED_QP_SCHUR_H

Generated on Thu Sep 18 12:34:16 2008 for ConstrainedOptPack: C++ Tools for Constrained (and Unconstrained) Optimization by doxygen 1.3.9.1