45 #include "MoochoPack_DecompositionSystemHandlerStd_Strategy.hpp"
46 #include "MoochoPack_Exceptions.hpp"
47 #include "MoochoPack_moocho_algo_conversion.hpp"
48 #include "IterationPack_print_algorithm_step.hpp"
49 #include "ConstrainedOptPack_DecompositionSystem.hpp"
50 #include "NLPInterfacePack_NLPFirstOrder.hpp"
51 #include "AbstractLinAlgPack_BasisSystem.hpp"
52 #include "AbstractLinAlgPack_MatrixOpNonsing.hpp"
53 #include "AbstractLinAlgPack_MatrixOpOut.hpp"
54 #include "AbstractLinAlgPack_VectorMutable.hpp"
55 #include "AbstractLinAlgPack_VectorStdOps.hpp"
56 #include "AbstractLinAlgPack_VectorOut.hpp"
57 #include "AbstractLinAlgPack_LinAlgOpPack.hpp"
58 #include "AbstractLinAlgPack_MatrixSymIdent.hpp"
59 #include "AbstractLinAlgPack_assert_print_nan_inf.hpp"
60 #include "Teuchos_dyn_cast.hpp"
61 #include "Teuchos_Assert.hpp"
63 namespace MoochoPack {
78 ,
bool *new_decomp_selected
83 EJournalOutputLevel olevel = algo.algo_cntr().journal_output_level();
89 r = s.decomp_sys().equ_decomp().size();
92 IterQuantityAccess<MatrixOp>
93 *Gc_iq = ( m > 0 ) ? &s.Gc() : NULL,
94 *Z_iq = ( n > m && r > 0 ) ? &s.Z() : NULL,
95 *Y_iq = ( r > 0 ) ? &s.Y() : NULL,
96 *Uz_iq = ( m > 0 && m > r ) ? &s.Uz() : NULL,
97 *Uy_iq = ( m > 0 && m > r ) ? &s.Uy() : NULL;
98 IterQuantityAccess<MatrixOpNonsing>
99 *R_iq = ( m > 0 ) ? &s.R() : NULL;
108 const DecompositionSystem::ERunTests
109 ds_test_what = ( ( decomp_sys_testing == DST_TEST
110 || ( decomp_sys_testing == DST_DEFAULT
111 && algo.algo_cntr().check_results() ) )
112 ? DecompositionSystem::RUN_TESTS
113 : DecompositionSystem::NO_TESTS );
116 DecompositionSystem::EOutputLevel ds_olevel;
119 case PRINT_BASIC_ALGORITHM_INFO:
120 ds_olevel = DecompositionSystem::PRINT_NONE;
122 case PRINT_ALGORITHM_STEPS:
123 case PRINT_ACTIVE_SET:
124 ds_olevel = DecompositionSystem::PRINT_BASIC_INFO;
127 ds_olevel = DecompositionSystem::PRINT_VECTORS;
129 case PRINT_ITERATION_QUANTITIES:
130 ds_olevel = DecompositionSystem::PRINT_EVERY_THING;
137 if( olevel >= PRINT_ALGORITHM_STEPS ) {
138 out <<
"\nUpdating the range/null decompostion matrices ...\n";
140 s.decomp_sys().update_decomp(
148 ,Uz_iq ? &Uz_iq->set_k(0) : NULL
149 ,Uy_iq ? &Uy_iq->set_k(0) : NULL
150 ,DecompositionSystem::MATRICES_ALLOW_DEP_IMPS
152 s.equ_decomp( s.decomp_sys().equ_decomp() );
153 s.equ_undecomp( s.decomp_sys().equ_undecomp() );
155 *new_decomp_selected =
false;
165 const BasisSystem &basis_sys = *nlp.basis_sys();
166 basis_sys.update_basis(
171 ,BasisSystem::MATRICES_ALLOW_DEP_IMPS
172 ,
static_cast<int>(olevel) >= static_cast<int>(PRINT_BASIC_ALGORITHM_INFO) ? &out : NULL
174 dyn_cast<MatrixSymIdent>(Y_iq->set_k(0)).initialize( nlp.space_x() );
175 s.equ_decomp( basis_sys.equ_decomp() );
176 s.equ_undecomp( basis_sys.equ_undecomp() );
186 ,
const std::string &L
191 const NLPFirstOrder &nlp =
dyn_cast<
const NLPFirstOrder>(algo.nlp());
192 const size_type n = nlp.n(), m = nlp.m(), r = nlp.basis_sys()->equ_decomp().size();
194 << L <<
"*** Updating the range/null decomposition.\n";
195 if( n == m && m == r ) {
202 << L <<
"begin update decomposition\n"
203 << L <<
"(class = \'" <<
typeName(s.decomp_sys()) <<
"\')\n"
205 s.decomp_sys().print_update_decomp( out, L +
" " );
207 << L <<
"end update decomposition\n"
DecompositionSystemHandlerStd_Strategy()
Constructor.
T_To & dyn_cast(T_From &from)
rSQP Algorithm control class.
virtual std::ostream & journal_out() const
Reduced space SQP state encapsulation interface.
void print_update_decomposition(const NLPAlgo &algo, const NLPAlgoState &s, std::ostream &out, const std::string &leading_spaces) const
AlgorithmTracker & track()
bool update_decomposition(NLPAlgo &algo, NLPAlgoState &s, NLPFirstOrder &nlp, EDecompSysTesting decomp_sys_testing, EDecompSysPrintLevel decomp_sys_testing_print_level, bool *new_decomp_selected)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
std::string typeName(const T &t)