Skip to content

Commit 9197ab6

Browse files
committed
Added info about matrix structure time
1 parent 4fb4298 commit 9197ab6

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

highs/ipm/hipo/factorhighs/Factorise.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Factorise::Factorise(const Symbolic& S, const std::vector<Int>& rowsA,
2020
const std::vector<double>& valA, const Regul& regul,
2121
const Log* log, DataCollector& data,
2222
std::vector<std::vector<double>>& sn_columns)
23-
: S_{S}, regul_{regul}, log_{log}, data_{data}, sn_columns_{sn_columns} {
23+
: S_{S}, sn_columns_{sn_columns}, regul_{regul}, log_{log}, data_{data} {
2424
// Input the symmetric matrix to be factorised in CSC format and the symbolic
2525
// factorisation coming from Analyse.
2626
// Only the lower triangular part of the matrix is used.

highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Int getASstructure(const HighsSparseMatrix& A, std::vector<Int>& ptr,
3333
Int mA = A.num_row_;
3434
Int nzA = A.numNz();
3535

36+
if (nA + nzA + mA > kHighsIInf) return kStatusOoM;
37+
3638
ptr.resize(nA + mA + 1);
3739
rows.resize(nA + nzA + mA);
3840

@@ -408,8 +410,11 @@ Int FactorHiGHSSolver::analyseAS(Symbolic& S) {
408410
// Perform analyse phase of augmented system and return symbolic factorisation
409411
// in object S and the status.
410412

413+
Clock clock;
411414
std::vector<Int> ptrLower, rowsLower;
412-
getASstructure(model_.A(), ptrLower, rowsLower);
415+
if (Int status = getASstructure(model_.A(), ptrLower, rowsLower))
416+
return status;
417+
if (info_) info_->matrix_structure_time = clock.stop();
413418

414419
// create vector of signs of pivots
415420
std::vector<Int> pivot_signs(model_.A().num_col_ + model_.A().num_row_, -1);
@@ -418,7 +423,7 @@ Int FactorHiGHSSolver::analyseAS(Symbolic& S) {
418423

419424
log_.printDevInfo("Performing AS analyse phase\n");
420425

421-
Clock clock;
426+
clock.start();
422427
Int status = FH_.analyse(S, rowsLower, ptrLower, pivot_signs);
423428
if (info_) info_->analyse_AS_time = clock.stop();
424429

@@ -437,14 +442,16 @@ Int FactorHiGHSSolver::analyseNE(Symbolic& S, int64_t nz_limit) {
437442

438443
log_.printDevInfo("Building NE structure\n");
439444

440-
if (buildNEstructureDense(model_.A(), nz_limit)) return kStatusOoM;
445+
Clock clock;
446+
if (Int status = buildNEstructureDense(model_.A(), nz_limit)) return status;
447+
if (info_) info_->matrix_structure_time = clock.stop();
441448

442449
// create vector of signs of pivots
443450
std::vector<Int> pivot_signs(model_.A().num_row_, 1);
444451

445452
log_.printDevInfo("Performing NE analyse phase\n");
446453

447-
Clock clock;
454+
clock.start();
448455
Int status = FH_.analyse(S, rowsNE_, ptrNE_, pivot_signs);
449456
if (info_) info_->analyse_NE_time = clock.stop();
450457

highs/ipm/hipo/ipm/Info.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct Info {
4343
double analyse_NE_time{};
4444
double analyse_AS_time{};
4545
double matrix_time{};
46+
double matrix_structure_time{};
4647
double factor_time{};
4748
double solve_time{};
4849

highs/ipm/hipo/ipm/Solver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,8 @@ void Solver::printSummary() const {
14711471
<< fix(info_.analyse_NE_time, 0, 2) << '\n';
14721472
log_stream << textline("Matrix time:") << fix(info_.matrix_time, 0, 2)
14731473
<< '\n';
1474+
log_stream << textline("Matrix structure time:")
1475+
<< fix(info_.matrix_structure_time, 0, 2) << '\n';
14741476
log_stream << textline("Factorisation time:")
14751477
<< fix(info_.factor_time, 0, 2) << '\n';
14761478
log_stream << textline("Solve time:") << fix(info_.solve_time, 0, 2)

0 commit comments

Comments
 (0)