Skip to content

Commit ff08e00

Browse files
committed
Standardised factorization logging for IPX, and added time stamp
1 parent bb6f493 commit ff08e00

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

highs/ipm/IpxWrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ HighsStatus solveLpIpx(const HighsOptions& options, HighsTimer& timer,
8686
}
8787
parameters.highs_logging = true;
8888
parameters.timeless_log = options.timeless_log;
89+
// Use this to change print_interval from default value (5s) to
90+
// other value for debugging
91+
//
92+
// parameters.print_interval = 1e-4;
8993
parameters.log_options = &options.log_options;
9094
// Just test feasibility and optimality tolerances for now
9195
// ToDo Set more parameters

highs/ipm/ipx/basis.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ Int Basis::Factorize() {
130130
std::stringstream h_logging_stream;
131131
h_logging_stream.str(std::string());
132132
h_logging_stream <<
133-
" Start factorization " << num_factorizations_+1 <<
134-
": nonzeros in basis = " << basis_num_nz << "\n";
133+
" Start factorization " << Format(num_factorizations_+1, 3) <<
134+
": nonzeros in basis = " << Format(basis_num_nz, 9) <<
135+
Format("", 14) << Fixed(control_.Elapsed(), 6, 0) << "s\n";
135136
control_.hIntervalLog(h_logging_stream);
136137

137138
Int err = 0; // return code
@@ -162,8 +163,9 @@ Int Basis::Factorize() {
162163
factorization_is_fresh_ = true;
163164
h_logging_stream.str(std::string());
164165
h_logging_stream <<
165-
" Finish factorization " << num_factorizations_ <<
166-
": fill factor = " << lu_->fill_factor() << "\n";
166+
" Finish factorization " << Format(num_factorizations_, 3) <<
167+
": fill factor = " << Fixed(lu_->fill_factor(), 6, 2) <<
168+
Format("", 23) << Fixed(control_.Elapsed(), 6, 0) << "s\n";
167169
control_.hIntervalLog(h_logging_stream);
168170
return err;
169171
}
@@ -929,9 +931,10 @@ void Basis::PivotFixedVariablesOutOfBasis(const double* colweights, Info* info){
929931
}
930932
std::stringstream h_logging_stream;
931933
h_logging_stream.str(std::string());
932-
h_logging_stream << " " << remaining.size() << " fixed variables remaining\n";
934+
h_logging_stream << Format(remaining.size(), 9) <<
935+
" fixed variables remaining" << Format("", 38) <<
936+
Fixed(control_.Elapsed(), 6, 0) << "s\n";
933937
control_.hIntervalLog(h_logging_stream);
934-
935938
}
936939
control_.Debug()
937940
<< Textline("Number of fixed variables swapped for stability:")

0 commit comments

Comments
 (0)