46 #include "MoochoPack_ActSetStats_AddedStep.hpp"
47 #include "MoochoPack_active_set_change.hpp"
48 #include "MoochoPack_moocho_algo_conversion.hpp"
49 #include "IterationPack_print_algorithm_step.hpp"
50 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_SpVectorClass.hpp"
53 , poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss)
55 NLPAlgo &algo = rsqp_algo(_algo);
56 NLPAlgoState &s = algo.rsqp_state();
58 EJournalOutputLevel olevel = algo.algo_cntr().journal_output_level();
59 EJournalOutputLevel ns_olevel = algo.algo_cntr().null_space_journal_output_level();
60 std::ostream& out = algo.track().journal_out();
63 if( static_cast<int>(ns_olevel) >= static_cast<int>(PRINT_ALGORITHM_STEPS) ) {
64 using IterationPack::print_algorithm_step;
65 print_algorithm_step( algo, step_poss, type, assoc_step_poss, out );
68 if( s.nu().updated_k(0) ) {
70 num_active = 0, num_adds = 0, num_drops = 0,
71 num_active_indep = 0, num_adds_indep = 0, num_drops_indep = 0;
72 const SpVector &nu_k = s.nu().get_k(0);
73 num_active = nu_k.nz();
74 if( s.nu().updated_k(-1) ) {
75 const SpVector &nu_km1 = s.nu().get_k(-1);
77 nu_k(), nu_km1(), s.var_indep(), olevel, &out
78 ,&num_adds, &num_drops, &num_active_indep, &num_adds_indep, &num_drops_indep );
79 act_set_stats_(s).set_k(0).set_stats(num_active,num_adds,num_drops
80 ,num_active_indep,num_adds_indep,num_drops_indep);
83 act_set_stats_(s).set_k(0).set_stats(
84 num_active, ActSetStats::NOT_KNOWN, ActSetStats::NOT_KNOWN
85 , nu_k(s.var_indep()).nz(), ActSetStats::NOT_KNOWN, ActSetStats::NOT_KNOWN );
89 if( static_cast<int>(ns_olevel) >=
static_cast<int>(PRINT_ALGORITHM_STEPS) ) {
90 out <<
"\nnu not calculated for the kth iteration\n";
98 , poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss
99 , std::ostream& out,
const std::string& L )
const
102 << L <<
"*** Updates active set statistics for changes from the last iteration\n"
103 << L <<
"Given nu_km1 and nu_k update:\n"
104 << L <<
" act_set_stats_k(num_active,num_adds,num_drops,num_active_indep,num_adds_indep,num_drops_indep)\n";
bool do_step(Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss)
void print_step(const Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss, std::ostream &out, const std::string &leading_str) const