|
MoochoPack : Framework for Large-Scale Optimization Algorithms 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 DECOMPOSITION_SYSTEM_STATE_STEP_BUILDER_STD_H 00030 #define DECOMPOSITION_SYSTEM_STATE_STEP_BUILDER_STD_H 00031 00032 #include "MoochoPack_Types.hpp" 00033 #ifndef MOOCHO_NO_BASIS_PERM_DIRECT_SOLVERS 00034 #include "AbstractLinAlgPack_BasisSystemPerm.hpp" 00035 #endif 00036 #include "MoochoPack_NewDecompositionSelection_Strategy.hpp" 00037 00038 namespace OptionsFromStreamPack { 00039 class OptionsFromStream; 00040 } 00041 00042 namespace MoochoPack { 00043 00052 class DecompositionSystemStateStepBuilderStd 00053 { 00054 public: 00055 00058 00060 enum ENullSpaceMatrixType { 00061 NULL_SPACE_MATRIX_AUTO, NULL_SPACE_MATRIX_EXPLICIT 00062 , NULL_SPACE_MATRIX_IMPLICIT }; 00064 enum ERangeSpaceMatrixType { 00065 RANGE_SPACE_MATRIX_AUTO, RANGE_SPACE_MATRIX_COORDINATE 00066 , RANGE_SPACE_MATRIX_ORTHOGONAL }; 00067 00069 00072 00074 struct SOptionValues { 00075 // Constructor (sets default values) 00076 SOptionValues(); 00077 ENullSpaceMatrixType null_space_matrix_type_; 00078 ERangeSpaceMatrixType range_space_matrix_type_; 00079 int max_dof_quasi_newton_dense_; // If < 0, don't change default 00080 }; 00081 00083 00085 typedef Teuchos::RCP< 00086 const OptionsFromStreamPack::OptionsFromStream> options_ptr_t; 00087 00089 DecompositionSystemStateStepBuilderStd(); 00090 00099 void set_options( const options_ptr_t& options ); 00101 const options_ptr_t& get_options() const; 00110 void process_nlp_and_options( 00111 std::ostream *trase_out 00112 ,NLP &nlp 00113 ,NLPFirstOrder **nlp_foi 00114 ,NLPSecondOrder **nlp_soi 00115 ,NLPDirect **nlp_fod 00116 ,bool *tailored_approach 00117 ); 00122 void create_decomp_sys( 00123 std::ostream *trase_out 00124 ,NLP &nlp 00125 ,NLPFirstOrder *nlp_foi 00126 ,NLPSecondOrder *nlp_soi 00127 ,NLPDirect *nlp_fod 00128 ,bool tailored_approach 00129 ,Teuchos::RCP<DecompositionSystem> *decomp_sys 00130 ); 00135 void add_iter_quantities( 00136 std::ostream *trase_out 00137 ,NLP &nlp 00138 ,NLPFirstOrder *nlp_foi 00139 ,NLPSecondOrder *nlp_soi 00140 ,NLPDirect *nlp_fod 00141 ,bool tailored_approach 00142 ,const Teuchos::RCP<DecompositionSystem> &decomp_sys 00143 ,const Teuchos::RCP<NLPAlgoState> &state 00144 ); 00145 00150 void create_eval_new_point( 00151 std::ostream *trase_out 00152 ,NLP &nlp 00153 ,NLPFirstOrder *nlp_foi 00154 ,NLPSecondOrder *nlp_soi 00155 ,NLPDirect *nlp_fod 00156 ,bool tailored_approach 00157 ,const Teuchos::RCP<DecompositionSystem> &decomp_sys 00158 ,Teuchos::RCP<IterationPack::AlgorithmStep> *eval_new_point_step 00159 ,Teuchos::RCP<CalcFiniteDiffProd> *calc_fd_prod 00160 ,Teuchos::RCP<VariableBoundsTester> *bounds_tester 00161 ,Teuchos::RCP<NewDecompositionSelection_Strategy> *new_decomp_selection_strategy 00162 ); 00163 00166 SOptionValues& current_option_values(); 00167 00168 private: 00169 00170 // /////////////////////////// 00171 // Private data members 00172 00174 options_ptr_t options_; 00175 00177 SOptionValues uov_; // options set by user 00178 SOptionValues cov_; // current option values actually used 00179 00180 #ifndef MOOCHO_NO_BASIS_PERM_DIRECT_SOLVERS 00181 Teuchos::RCP<BasisSystemPerm> basis_sys_perm_; 00182 #endif 00183 00184 // ///////////////////////// 00185 // Private member functions 00186 00188 static void readin_options( 00189 const OptionsFromStreamPack::OptionsFromStream& options 00190 ,SOptionValues *option_values, std::ostream* trase_out 00191 ); 00192 00194 static void set_default_options( 00195 const SOptionValues& user_option_values 00196 ,SOptionValues *current_option_values 00197 ,std::ostream* trase_out 00198 ); 00199 00200 }; // end class DecompositionSystemStateStepBuilderStd 00201 00202 // /////////////////////////////// 00203 // Inline members 00204 00205 inline 00206 DecompositionSystemStateStepBuilderStd::SOptionValues& 00207 DecompositionSystemStateStepBuilderStd::current_option_values() 00208 { 00209 return cov_; 00210 } 00211 00212 } // end namespace MoochoPack 00213 00214 #endif // DECOMPOSITION_SYSTEM_STATE_STEP_BUILDER_STD_H
1.7.4