50 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_SpVectorClass.hpp"
56 NLPAlgoState &s = algo.rsqp_state();
60 std::ostream&
out = algo.track().journal_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 );
80 ,num_active_indep,num_adds_indep,num_drops_indep);
90 out <<
"\nnu not calculated for the kth iteration\n";
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)
AbstractLinAlgPack::size_type size_type
SparseVector< SparseElement< index_type, value_type >, std::allocator< SparseElement< index_type, value_type > > > SpVector
act_set_stats_iq_member act_set_stats_
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
EJournalOutputLevel
enum for journal output.
size_type nz() const
Return the number of non-zero elements.
void print_algorithm_step(const Algorithm &algo, Algorithm::poss_type step_poss, EDoStepType type, Algorithm::poss_type assoc_step_poss, std::ostream &out)
Prints to 'out' the algorithm step.
void active_set_change(const SpVectorSlice &nu_k, const SpVectorSlice &nu_km1, Range1D indep, EJournalOutputLevel olevel, std::ostream *out, size_type *num_adds, size_type *num_drops, size_type *num_active_indep, size_type *num_adds_indep, size_type *num_drops_indep)
Calculate the change in the active set and output change if asked to.
NLPAlgo & rsqp_algo(Algorithm &algo)
Convert from a Algorithm to a NLPAlgo.