ConstrainedOptPack: C++ Tools for Constrained (and Unconstrained) Optimization Version of the Day
ConstrainedOptPack_QPSchur.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 // 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 QPSCHUR_H
00043 #define QPSCHUR_H
00044 
00045 #include <ostream>
00046 #include <map>
00047 #include <vector>
00048 
00049 #include "ConstrainedOptPack_Types.hpp"
00050 #include "ConstrainedOptPack_MatrixSymAddDelUpdateableWithOpNonsingular.hpp"
00051 #include "AbstractLinAlgPack_GenPermMatrixSlice.hpp"
00052 #include "AbstractLinAlgPack_SpVectorClass.hpp"
00053 #include "AbstractLinAlgPack_MatrixSymOpNonsing.hpp"
00054 #include "AbstractLinAlgPack_MatrixSymOp.hpp"
00055 #include "AbstractLinAlgPack_MatrixOp.hpp"
00056 #include "AbstractLinAlgPack_MatrixSymAddDelUpdateable.hpp"
00057 #include "AbstractLinAlgPack_MatrixOpSerial.hpp"
00058 #include "DenseLinAlgPack_DMatrixClass.hpp"
00059 #include "Teuchos_StandardCompositionMacros.hpp"
00060 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00061 #include "StopWatchPack_stopwatch.hpp"
00062 
00063 namespace ConstrainedOptPack {
00064 
00065 namespace QPSchurPack {
00066 
00068 template < class T >
00069 class vector_one_based_checked : public std::vector<T>
00070 {
00071   typedef vector_one_based_checked this_t;
00072 public:
00074   T& operator()( typename this_t::size_type i )
00075   {
00076 #ifdef LINALGPACK_CHECK_RANGE
00077       return this->at(i-1);
00078 #else
00079       return this->operator[](i-1);
00080 #endif
00081   }
00083   T operator()( typename this_t::size_type i ) const
00084   {
00085 #ifdef LINALGPACK_CHECK_RANGE
00086       return this->at(i-1);
00087 #else
00088       return this->operator[](i-1);
00089 #endif
00090   }
00091 }; // end class vector_one_based
00092 
00093 class Constraints;
00094 class QP;
00095 
00166 class QP {
00167 public:
00168 
00169   // /////////////////
00170   // Public Types
00171 
00173   typedef vector_one_based_checked<EBounds>   x_init_t;
00175   typedef vector_one_based_checked<size_type>   l_x_X_map_t;
00177   typedef vector_one_based_checked<size_type>   i_x_X_map_t;
00178 
00180   typedef QPSchurPack::Constraints        Constraints;
00181 
00182   // /////////////////
00183   // Public Interface
00184 
00186   virtual ~QP()
00187   {}
00188 
00189   // ///////////////////////////////////////
00190   // Initial active set independent members 
00191 
00193   virtual size_type n() const = 0;
00195   virtual size_type m() const = 0;
00197   virtual const DVectorSlice g() const = 0;
00199   virtual const MatrixSymOp& G() const = 0;
00201   virtual const MatrixOp& A() const = 0;
00202 
00203   // /////////////////////////////////////
00204   // Initial active set specific members
00205 
00207   virtual size_type n_R() const = 0;
00208 
00219   virtual const x_init_t& x_init() const = 0;
00220 
00232   virtual const l_x_X_map_t& l_x_X_map() const = 0;
00233 
00243   virtual const i_x_X_map_t& i_x_X_map() const = 0;
00244 
00246   /* The bounds of the initially fixed variables.
00247    *
00248    * For 1 <= l <= n_X:
00249    *
00250    \verbatim
00251              / xl(i_x_X_map(l))                     : if x_init(i_x_X_map(l)) == LOWER
00252    b_X(l) =  | xu(i_x_X_map(l))                     : if x_init(i_x_X_map(l)) == UPPER
00253              \ xl(i_x_X_map(l)) = xu(i_x_X_map(l))  : if x_init(i_x_X_map(l)) == EQUALITY
00254    \endverbatim
00255    *
00256    */
00257   virtual const DVectorSlice b_X() const = 0;
00258 
00260   virtual const GenPermMatrixSlice& Q_R() const = 0;
00261 
00263   virtual const GenPermMatrixSlice& Q_X() const = 0;
00264 
00266   virtual const MatrixSymOpNonsing& Ko() const = 0;
00267 
00269   virtual const DVectorSlice fo() const = 0;
00270 
00271   // //////////////////////////////////////////////////////////
00272   // Additional constaints for cl_bar <= A_bar'*x <= cu_bar
00273 
00275   virtual Constraints& constraints() = 0;
00276 
00278   virtual const Constraints& constraints() const = 0;
00279 
00284   virtual void dump_qp( std::ostream& out );
00285 
00286 };  // end class QP
00287 
00328 class Constraints {
00329 public:
00330 
00332   enum EPickPolicy { ANY_VIOLATED, MOST_VIOLATED };
00333 
00335   virtual ~Constraints() {}
00336 
00338   virtual size_type n() const = 0;
00339   
00341   virtual size_type m_breve() const = 0;
00342 
00344   virtual const MatrixOp& A_bar() const = 0;
00345   
00347   virtual void pick_violated_policy( EPickPolicy pick_policy ) = 0;
00349   virtual EPickPolicy pick_violated_policy() const = 0;
00350 
00363   virtual void pick_violated(
00364      const DVectorSlice& x, size_type* j_viol, value_type* constr_val
00365     ,value_type* viol_bnd_val, value_type* norm_2_constr, EBounds* bnd, bool* can_ignore
00366     ) const = 0;
00367 
00370   virtual void ignore( size_type j ) = 0;
00371 
00382   virtual value_type get_bnd( size_type j, EBounds bnd ) const = 0;
00383 
00384 };  // end class Constraints
00385 
00386 } // end namespace QPSchurPack 
00387 
00395 class QPSchur {
00396 public:
00397 
00400 
00402   typedef QPSchurPack::QP               QP;
00404   typedef MatrixSymAddDelUpdateable     MSADU;
00406   class TestFailed : public std::logic_error
00407   {public: TestFailed(const std::string& what_arg) : std::logic_error(what_arg) {}};
00409   class InconsistantConstraintsException : public std::logic_error
00410   {public: InconsistantConstraintsException(const std::string& what_arg) : std::logic_error(what_arg) {}};
00412   class NumericalInstabilityException : public std::runtime_error
00413   {public: NumericalInstabilityException(const std::string& what_arg) : std::runtime_error(what_arg) {}};
00415   class DualInfeasibleException : public NumericalInstabilityException
00416   {public: DualInfeasibleException(const std::string& what_arg)
00417     : NumericalInstabilityException(what_arg) {}};
00419   enum ERunTests { RUN_TESTS, NO_TESTS };
00421   enum ESolveReturn {
00422     OPTIMAL_SOLUTION
00423     ,MAX_ITER_EXCEEDED
00424     ,MAX_RUNTIME_EXEEDED_FAIL
00425     ,MAX_RUNTIME_EXEEDED_DUAL_FEAS
00426     ,MAX_ALLOWED_STORAGE_EXCEEDED
00427     ,INFEASIBLE_CONSTRAINTS
00428     ,NONCONVEX_QP
00429     ,DUAL_INFEASIBILITY
00430     ,SUBOPTIMAL_POINT
00431   };
00433   enum EOutputLevel {
00434      NO_OUTPUT          = 0
00435     ,OUTPUT_BASIC_INFO      = 1
00436     ,OUTPUT_ITER_SUMMARY    = 2
00437     ,OUTPUT_ITER_STEPS      = 3
00438     ,OUTPUT_ACT_SET       = 4
00439     ,OUTPUT_ITER_QUANTITIES   = 5
00440   };
00442   static value_type DEGENERATE_MULT;
00443 
00445 
00448 
00450   STANDARD_COMPOSITION_MEMBERS( MatrixSymAddDelUpdateableWithOpNonsingular, schur_comp );
00451 
00454   STANDARD_MEMBER_COMPOSITION_MEMBERS( size_type, max_iter );
00455 
00458   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, max_real_runtime );
00459 
00462   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, feas_tol );
00463 
00466   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, loose_feas_tol );
00467 
00471   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, dual_infeas_tol );
00472 
00477   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, huge_primal_step );
00478 
00483   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, huge_dual_step );
00484 
00487   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, warning_tol );
00488 
00491   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, error_tol );
00492 
00496   STANDARD_MEMBER_COMPOSITION_MEMBERS( size_type, iter_refine_min_iter );
00497     
00501   STANDARD_MEMBER_COMPOSITION_MEMBERS( size_type, iter_refine_max_iter );
00502 
00506   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, iter_refine_opt_tol );
00507 
00511   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, iter_refine_feas_tol );
00512 
00516   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, iter_refine_at_solution );
00517     
00521   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, salvage_init_schur_comp );
00522 
00525   void pivot_tols( MSADU::PivotTolerances pivot_tols );
00527   MSADU::PivotTolerances pivot_tols() const;
00528 
00530   virtual ~QPSchur() {}
00531 
00533   QPSchur(
00534     const schur_comp_ptr_t&   schur_comp           = Teuchos::null
00535     ,size_type                max_iter             = 100
00536     ,value_type               max_real_runtime     = 1e+20
00537     ,value_type               feas_tol             = 1e-8
00538     ,value_type               loose_feas_tol       = 1e-6
00539     ,value_type               dual_infeas_tol      = 1e-12
00540     ,value_type               huge_primal_step     = 1e+20
00541     ,value_type               huge_dual_step       = 1e+20
00542     ,value_type               warning_tol          = 1e-10
00543     ,value_type               error_tol            = 1e-5
00544     ,size_type                iter_refine_min_iter = 1
00545     ,size_type                iter_refine_max_iter = 3
00546     ,value_type               iter_refine_opt_tol  = 1e-12
00547     ,value_type               iter_refine_feas_tol = 1e-12
00548     ,bool                     iter_refine_at_solution = true
00549     ,bool                     salvage_init_schur_comp = true
00550     ,MSADU::PivotTolerances   pivot_tols = MSADU::PivotTolerances( 1e-8,1e-11,1e-11 )
00551     );
00552 
00611   virtual ESolveReturn solve_qp(
00612     QP& qp
00613     ,size_type num_act_change, const int ij_act_change[], const EBounds bnds[]
00614     ,std::ostream *out, EOutputLevel output_level, ERunTests test_what
00615     ,DVectorSlice* x, SpVector* mu, DVectorSlice* lambda, SpVector* lambda_breve
00616     ,size_type* iter, size_type* num_adds, size_type* num_drops
00617     );
00618 
00620 
00628   class U_hat_t : public MatrixOpSerial {
00629   public:
00631     U_hat_t();
00633     void initialize( 
00634        const MatrixSymOp    *G
00635       ,const MatrixOp     *A
00636       ,const MatrixOp     *A_bar
00637       ,const GenPermMatrixSlice *Q_R
00638       ,const GenPermMatrixSlice *P_XF_hat
00639       ,const GenPermMatrixSlice *P_plus_hat
00640       );
00642     const MatrixSymOp& G() const
00643     { return *G_; }
00645     const MatrixOp* A() const
00646     { return A_;  }
00648     const MatrixOp& A_bar() const
00649     { return *A_bar_; }
00651     const GenPermMatrixSlice& Q_R() const
00652     { return *Q_R_; }
00654     const GenPermMatrixSlice& P_XF_hat() const
00655     { return *P_XF_hat_;  }
00657     const GenPermMatrixSlice& P_plus_hat() const
00658     { return *P_plus_hat_;  }
00659     
00661 
00662 
00664     size_type rows() const;
00666     size_type cols() const;
00667 
00669 
00672 
00674     void Vp_StMtV(
00675       DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00676       ,const DVectorSlice& vs_rhs2, value_type beta
00677       ) const;
00679     void Vp_StMtV(
00680       DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00681       ,const SpVectorSlice& sv_rhs2, value_type beta
00682       ) const;
00683 
00685     
00686   private:
00687     const MatrixSymOp     *G_;
00688     const MatrixOp          *A_;
00689     const MatrixOp          *A_bar_;
00690     const GenPermMatrixSlice  *Q_R_;
00691     const GenPermMatrixSlice  *P_XF_hat_;
00692     const GenPermMatrixSlice  *P_plus_hat_;
00693 
00694   };  // end class U_hat_t
00695 
00727   class ActiveSet {
00728   public:
00729 
00730     // /////////////////////
00731     // Public types
00732 
00734     typedef QPSchurPack::QP            QP;
00736     typedef MatrixSymAddDelUpdateable  MSADU;
00737 
00738     // /////////////////////
00739     // Public interface
00740 
00746     STANDARD_COMPOSITION_MEMBERS( MatrixSymAddDelUpdateableWithOpNonsingular, schur_comp );
00747 
00750     STANDARD_MEMBER_COMPOSITION_MEMBERS( MSADU::PivotTolerances, pivot_tols );
00751 
00753     ActiveSet(
00754       const schur_comp_ptr_t   &schur_comp
00755       ,MSADU::PivotTolerances  pivot_tols = MSADU::PivotTolerances( 1e-6,1e-8,1e-8 )
00756       );
00757 
00760 
00768     void initialize( 
00769       QP& qp, size_type num_act_change, const int ij_act_change[]
00770       ,const EBounds bnds[], bool test, bool salvage_init_schur_comp
00771       ,std::ostream *out, EOutputLevel output_level );
00772 
00777     void refactorize_schur_comp();
00778 
00795     bool add_constraint(
00796       size_type ja, EBounds bnd_ja, bool update_steps
00797       ,std::ostream *out, EOutputLevel output_level
00798       ,bool force_refactorization = true
00799       ,bool allow_any_cond = false );
00800 
00808     bool drop_constraint(
00809       int jd, std::ostream *out, EOutputLevel output_level
00810       ,bool force_refactorization = true, bool allow_any_cond = false );
00811 
00819     bool drop_add_constraints(
00820       int jd, size_type ja, EBounds bnd_ja, bool update_steps
00821       ,std::ostream *out, EOutputLevel output_level );
00822 
00824 
00827 
00829     QP& qp();
00831     const QP& qp() const;
00832 
00834 
00837 
00842     size_type q_hat() const;
00843 
00847     size_type q_plus_hat() const;
00848 
00853     size_type q_F_hat() const;
00854 
00859     size_type q_C_hat() const;
00860 
00865     size_type q_D_hat() const;
00866 
00874     int ij_map( size_type s ) const;
00875 
00891     size_type s_map( int ij ) const;
00892 
00899     value_type constr_norm( size_type s ) const;
00900 
00903     EBounds bnd( size_type s ) const;
00904 
00910     size_type l_fxfx( size_type k ) const;
00911 
00913     const U_hat_t& U_hat() const;
00915     const MatrixSymOpNonsing& S_hat() const;
00917     const GenPermMatrixSlice& P_XF_hat() const;
00919     const GenPermMatrixSlice& P_FC_hat() const;
00921     const GenPermMatrixSlice& P_plus_hat() const;
00923     const GenPermMatrixSlice& Q_XD_hat() const;
00925     const DVectorSlice d_hat() const;
00927     DVectorSlice z_hat();
00929     const DVectorSlice z_hat() const;
00931     DVectorSlice p_z_hat();
00933     const DVectorSlice p_z_hat() const;
00935     DVectorSlice mu_D_hat();
00937     const DVectorSlice mu_D_hat() const;
00939     DVectorSlice p_mu_D_hat();
00941     const DVectorSlice p_mu_D_hat() const;
00942 
00952     bool is_init_fixed( size_type j ) const;
00953 
00955     bool all_dof_used_up() const;
00956 
00958 
00959   private:
00960 
00961     // ///////////////////////////
00962     // Private types
00963 
00965     typedef std::vector<int>      ij_map_t;
00967     typedef std::map<int,size_type>   s_map_t;
00969     typedef std::vector<EBounds>    bnds_t;
00971     typedef std::vector<int>      l_fxfx_t;
00973     typedef std::vector<size_type>    P_row_t;
00975     typedef std::vector<size_type>    P_col_t;
00976 
00977     // ///////////////////////////
00978     // Private data members
00979 
00980     bool        initialized_;
00981     bool        test_;
00982     QP*         qp_;  // QP being solved.
00983     const QP::x_init_t  *x_init_;
00984     size_type     n_;
00985     size_type     n_R_;
00986     size_type     m_;
00987     size_type     m_breve_;
00988     size_type     q_plus_hat_;
00989     size_type     q_F_hat_;
00990     size_type     q_C_hat_;
00991     ij_map_t      ij_map_;
00992 //    s_map_t       s_map_;
00993     DVector       constr_norm_;
00994     bnds_t        bnds_;
00995     l_fxfx_t            l_fxfx_;
00996     U_hat_t       U_hat_;
00997     //
00998     // for s = 1...q_hat
00999     //
01000     //                     /  e(i)    if i > 0 (where: i = -ij_map(s))
01001     // [P_XF_hat](:,s)   = |
01002     //                     \  0       otherwise
01003     //                     
01004     GenPermMatrixSlice  P_XF_hat_;    // \hat{P}^{XF} \in \Re^{n \times \hat{q}}
01005     P_row_t       P_XF_hat_row_;  // i
01006     P_row_t       P_XF_hat_col_;  // s
01007     //
01008     // for s = 1...q_hat
01009     //
01010     //                   /  e(sd)   if 0 < j <= n && is_init_fixed(j)
01011     //                   |          (where: j = ij_map(s), sd = s_map(-j))
01012     // [P_FC_hat](:,s) = |
01013     //                   \  0       otherwise
01014     //
01015     GenPermMatrixSlice  P_FC_hat_;    // {\tilde{P}^{F}}^{T} \hat{P}^{C} \in \Re^{\hat{q} \times \hat{q}}
01016     P_row_t       P_FC_hat_row_;  // sd
01017     P_row_t       P_FC_hat_col_;  // s
01018     //
01019     // for s = 1...q_hat
01020     //
01021     //                     /  e(j)    if j > 0 && !is_init_fixed(j) (where: j = ij_map(s))
01022     // [P_plus_hat](:,s) = |
01023     //                     \  0       otherwise
01024     //
01025     GenPermMatrixSlice  P_plus_hat_;  // \hat{P}^{(+)} \in \Re^{n+\breve{m} \times \hat{q}^{D}}
01026     P_row_t       P_plus_hat_row_;  // j
01027     P_row_t       P_plus_hat_col_;  // s
01028     //
01029     // for k = 1...q_D_hat
01030     //
01031     // [Q_XD_hat](:,k) = e(i)  (where is_init_fixed(i) && s_map(-i) == 0)
01032     //
01033     GenPermMatrixSlice  Q_XD_hat_;    // \hat{Q}^{XD} \in \Re^{n_X \times \hat{q}^{D}}
01034     P_row_t       Q_XD_hat_row_;  // i
01035     P_row_t       Q_XD_hat_col_;  // k
01036     //
01037     DVector       d_hat_;     // \hat{d}
01038     DVector       z_hat_;     // \hat{z}
01039     DVector       p_z_hat_;
01040     DVector       mu_D_hat_;    // \hat{\mu}^{D}
01041     DVector       p_mu_D_hat_;  // p^{\hat{\mu}^{D}}
01042 
01043     // ///////////////////////////
01044     // Private member functions
01045 
01046     //
01047     void assert_initialized() const;
01048 
01049     // Assert in range.
01050     void assert_s( size_type s) const;
01051 
01052     // Reinitialize P_XF_hat, P_plus_hat, Q_XD_hat, and U_hat
01053     void reinitialize_matrices(bool test);
01054     
01055     // Remove an element from the augmented KKT system.
01056     // This does not update P_plus_hat, P_XF_hat or any
01057     // of the dimensions.  Returns true if *out was
01058     // written to.
01059     bool remove_augmented_element(
01060       size_type sd, bool force_refactorization
01061       ,MatrixSymAddDelUpdateable::EEigenValType eigen_val_drop
01062       ,std::ostream *out, EOutputLevel output_level
01063       ,bool allow_any_cond );
01064 
01065     // not defined and not to be called.
01066     ActiveSet();
01067 
01068   };  // end class ActiveSet
01069 
01071   const ActiveSet& act_set() const;
01072 
01074   static void dump_act_set_quantities( const ActiveSet& act_set, std::ostream& out
01075     , bool print_S_hat = true );
01076 
01077 protected:
01078 
01079   // /////////////////////////
01080   // Protected types
01081 
01083   enum EPDSteps { PICK_VIOLATED_CONSTRAINT, UPDATE_ACTIVE_SET, COMPUTE_SEARCH_DIRECTION
01084     , COMPUTE_STEP_LENGTHS, TAKE_STEP };
01085 
01086   // ///////////////////////////
01087   // Protected Member functions
01088 
01095   virtual
01096   ESolveReturn qp_algo(
01097     EPDSteps first_step
01098     ,std::ostream *out, EOutputLevel output_level, ERunTests test_what
01099     ,const DVectorSlice& vo, ActiveSet* act_set, DVectorSlice* v
01100     ,DVectorSlice* x, size_type* iter, size_type* num_adds, size_type* num_drops
01101     ,size_type* iter_refine_num_resid, size_type* iter_refine_num_solves
01102     ,StopWatchPack::stopwatch* timer
01103     );
01104 
01107   virtual void set_x( const ActiveSet& act_set, const DVectorSlice& v, DVectorSlice* x );
01108 
01110   virtual void set_multipliers(
01111     const ActiveSet& act_set, const DVectorSlice& v
01112     ,SpVector* mu, DVectorSlice* lambda, SpVector* lambda_breve );
01113 
01115   bool timeout_return( StopWatchPack::stopwatch*timer, std::ostream *out, EOutputLevel output_level ) const;
01116 
01118   enum EIterRefineReturn {
01119     ITER_REFINE_NOT_PERFORMED    // Did not even perform it (iter_refine_max_iter == 0)
01120     ,ITER_REFINE_ONE_STEP        // Only performed one step and the status is not known.
01121     ,ITER_REFINE_NOT_NEEDED      // Convergence tolerance was already satisfied
01122     ,ITER_REFINE_IMPROVED        // Did not converge but it was improved
01123     ,ITER_REFINE_NOT_IMPROVED    // Tried iterative refinement but no improvement
01124     ,ITER_REFINE_CONVERGED       // Performed iterative refinement and converged!
01125   };
01134     EIterRefineReturn iter_refine(
01135     const ActiveSet      &act_set
01136     ,std::ostream        *out
01137     ,EOutputLevel        output_level
01138     ,const value_type    ao  // Only used if bo != NULL
01139     ,const DVectorSlice   *bo // If NULL then assumed to be zero!
01140     ,const value_type    aa  // Only used if q_hat > 0
01141     ,const DVectorSlice   *ba // If NULL then assumed to be zero!  Not accessed if q_hat > 0
01142     ,DVectorSlice         *v
01143     ,DVectorSlice         *z  // Can be NULL if q_hat > 0
01144     ,size_type           *iter_refine_num_resid
01145     ,size_type           *iter_refine_num_solves
01146     );
01147 
01148 private:
01149 
01150   // /////////////////////////
01151   // Private data members
01152 
01153   ActiveSet  act_set_;  // The active set.
01154 
01155 };  // end class QPSchur
01156 
01157 } // end namespace ConstrainedOptPack 
01158 
01159 #endif  // QPSCHUR_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends