@@ -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
0 commit comments