|
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_QPKWIK_H 00030 #define QP_SOLVER_RELAXED_QPKWIK_H 00031 00032 #include <vector> 00033 00034 #include "ConstrainedOptPack_QPSolverRelaxed.hpp" 00035 #include "DenseLinAlgPack_DVectorClass.hpp" 00036 #include "DenseLinAlgPack_DMatrixClass.hpp" 00037 #include "Teuchos_StandardMemberCompositionMacros.hpp" 00038 #include "Teuchos_F77_wrappers.h" 00039 00040 namespace ConstrainedOptPack { 00041 00048 class QPSolverRelaxedQPKWIK : public QPSolverRelaxed 00049 { 00050 public: 00051 00054 00056 STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, max_qp_iter_frac ); 00057 00059 STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, infinite_bound ); 00060 00062 QPSolverRelaxedQPKWIK( 00063 value_type max_qp_iter_frac = 10.0 00064 ,value_type infinite_bound = 1e+20 00065 ); 00066 00068 ~QPSolverRelaxedQPKWIK(); 00069 00071 00074 00076 QPSolverStats get_qp_stats() const; 00078 void release_memory(); 00079 00081 00082 protected: 00083 00086 00088 QPSolverStats::ESolutionType imp_solve_qp( 00089 std::ostream* out, EOutputLevel olevel, ERunTests test_what 00090 ,const Vector& g, const MatrixSymOp& G 00091 ,value_type etaL 00092 ,const Vector* dL, const Vector* dU 00093 ,const MatrixOp* E, BLAS_Cpp::Transp trans_E, const Vector* b 00094 ,const Vector* eL, const Vector* eU 00095 ,const MatrixOp* F, BLAS_Cpp::Transp trans_F, const Vector* f 00096 ,value_type* obj_d 00097 ,value_type* eta, VectorMutable* d 00098 ,VectorMutable* nu 00099 ,VectorMutable* mu, VectorMutable* Ed 00100 ,VectorMutable* lambda, VectorMutable* Fd 00101 ); 00102 00104 00105 private: 00106 00107 // ////////////////////////////////////////////////////////////// 00108 // Private types 00109 00111 typedef FortranTypes::f_int f_int; 00113 typedef std::vector<f_int> IBND_t; 00115 typedef std::vector<f_int> IACTSTORE_t; 00117 typedef std::vector<f_int> IACT_t; 00119 typedef std::vector<f_int> ISTATE_t; 00120 00121 // ////////////////////////////////////////////////////////////// 00122 // Private Data Members. 00123 00124 QPSolverStats qp_stats_; 00125 00126 // Inverse mapping for IBND_INV(j) == k <-> IBND(k) == j 00127 IBND_t IBND_INV_; 00128 00129 // Parameters to QPKWIK 00130 00132 f_int N_; 00134 f_int M1_; 00136 f_int M2_; 00138 f_int M3_; 00140 DVector GRAD_; 00142 DMatrix UINV_AUG_; 00144 f_int LDUINV_AUG_; 00146 IBND_t IBND_; 00148 DVector BL_; 00150 DVector BU_; 00152 DMatrix A_; 00154 f_int LDA_; 00156 DVector YPY_; 00158 f_int IYPY_; 00160 f_int WARM_; 00162 value_type NUMPARAM_[3]; 00164 f_int MAX_ITER_; 00165 00166 // Input / Output 00167 00169 DVector X_; 00171 f_int NACTSTORE_; 00173 IACTSTORE_t IACTSTORE_; 00175 f_int INF_; 00176 00177 // Output 00178 00180 f_int NACT_; 00182 IACT_t IACT_; 00184 DVector UR_; 00186 value_type EXTRA_; 00188 f_int ITER_; 00190 f_int NUM_ADDS_; 00192 f_int NUM_DROPS_; 00193 00194 // Internal state 00195 00197 ISTATE_t ISTATE_; 00198 00199 // Workspace 00200 00202 f_int LRW_; 00204 DVector RW_; 00205 00206 }; // end class QPSolverRelaxedQPKWIK 00207 00208 } // end namespace ConstrainedOptimizationPackTypes 00209 00210 #endif // QP_SOLVER_RELAXED_QPKWIK_H
1.7.4