48 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_SpVectorClass.hpp"
75 out <<
"\nDetermining which fixed variables to remove from rHL to form rHL_RR (can remove all but one)...\n";
80 all_fixed = n_pz == nu_indep.nz();
82 out <<
"\nmax{|nu_k(indep)|,i=r+1...n} = " << max_nu_indep << std::endl;
84 if( super_basic_mult_drop_tol > 1.0 ) {
86 out <<
"super_basic_mult_drop_tol = " << super_basic_mult_drop_tol <<
" > 1"
87 <<
"\nNo variables will be removed from the super basis! (You might consider decreasing super_basic_mult_drop_tol < 1)\n";
91 const int prec = out.precision();
94 <<
right << setw(10) <<
"i"
95 <<
right << setw(prec+12) <<
"nu(i)"
96 <<
right << setw(8) <<
"status"
98 <<
right << setw(10) <<
"--------"
99 <<
right << setw(prec+12) <<
"--------"
100 <<
right << setw(8) <<
"------"
103 SpVector::const_iterator
104 nu_itr = nu_indep.begin(),
105 nu_end = nu_indep.end();
106 SpVector::difference_type
107 nu_o = nu_indep.offset();
109 *i_x_free_itr = i_x_free,
110 *i_x_fixed_itr = i_x_fixed;
112 *bnd_fixed_itr = bnd_fixed;
115 bool kept_one =
false;
116 {
for(
size_type i_indep = 1; i_indep <= n_pz; ++i_indep ) {
117 if( nu_itr != nu_end && (nu_itr->indice() + nu_o) == i_indep ) {
119 abs_val = ::fabs(nu_itr->value()),
120 rel_val = abs_val / max_nu_indep;
122 keep = ( (all_fixed && abs_val == max_nu_indep && !kept_one)
123 || rel_val < super_basic_mult_drop_tol );
125 out <<
right << setw(10) << i_indep + r
126 <<
right << setw(prec+12) << nu_itr->value()
127 <<
right << setw(8) << (keep ?
"keep" :
"drop")
131 *i_x_fixed_itr++ = i_indep;
132 namespace COP = ConstrainedOptPack;
134 = ( nu_itr->value() > 0.0 ? COP::UPPER : COP::LOWER );
144 *i_x_free_itr++ = i_indep;
151 out <<
"\nRemoving n_pz_X = " << (*n_pz_X) <<
" from the superbasic set and keeping n_pz_R = " << (*n_pz_R) << std::endl;
AbstractLinAlgPack::size_type size_type
void get_init_fixed_free_indep(const size_type n, const size_type r, const SpVectorSlice &nu_indep, const value_type super_basic_mult_drop_tol, EJournalOutputLevel olevel, std::ostream &out, size_type *n_pz_X, size_type *n_pz_R, size_type i_x_free[], size_type i_x_fixed[], ConstrainedOptPack::EBounds bnd_fixed[])
Determine the set of initially fixed and free independent variables.
EJournalOutputLevel
enum for journal output.
value_type norm_inf(const SparseVectorSlice< T_Ele > &sv_rhs)
result = ||sv_rhs||inf (BLAS IxAMAX)
SparseVectorSlice< SparseElement< index_type, value_type > > SpVectorSlice
AbstractLinAlgPack::value_type value_type
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)