99namespace hipo {
1010
1111FactorHiGHSSolver::FactorHiGHSSolver (Options& options, const Model& model,
12- const Regularisation& regul, Info* info,
13- IpmData* record, const LogHighs& log)
12+ const Regularisation& regul, Info& info,
13+ IpmData& record, const LogHighs& log)
1414 : FH_(&log, options.block_size),
1515 S_{},
1616 regul_{regul},
@@ -256,7 +256,7 @@ Int FactorHiGHSSolver::factorAS(const HighsSparseMatrix& A,
256256 valLower[next++] = 0.0 ;
257257 ptrLower[nA + i + 1 ] = ptrLower[nA + i] + 1 ;
258258 }
259- if ( info_) info_-> matrix_time += clock.stop ();
259+ info_. matrix_time += clock.stop ();
260260
261261 // set static regularisation, since it may have changed
262262 FH_.setRegularisation (regul_.primal , regul_.dual );
@@ -265,10 +265,8 @@ Int FactorHiGHSSolver::factorAS(const HighsSparseMatrix& A,
265265 clock.start ();
266266 if (FH_.factorise (S_, rowsLower, ptrLower, valLower))
267267 return kStatusErrorFactorise ;
268- if (info_) {
269- info_->factor_time += clock.stop ();
270- info_->factor_number ++;
271- }
268+ info_.factor_time += clock.stop ();
269+ info_.factor_number ++;
272270
273271 this ->valid_ = true ;
274272 return kStatusOk ;
@@ -287,7 +285,7 @@ Int FactorHiGHSSolver::factorNE(const HighsSparseMatrix& A,
287285
288286 // build matrix
289287 Int status = buildNEvalues (A, scaling);
290- if ( info_) info_-> matrix_time += clock.stop ();
288+ info_. matrix_time += clock.stop ();
291289
292290 // set static regularisation, since it may have changed
293291 FH_.setRegularisation (regul_.primal , regul_.dual );
@@ -299,10 +297,9 @@ Int FactorHiGHSSolver::factorNE(const HighsSparseMatrix& A,
299297 std::vector<Int> ptrNE (ptrNE_);
300298 std::vector<Int> rowsNE (rowsNE_);
301299 if (FH_.factorise (S_, rowsNE, ptrNE, valNE_)) return kStatusErrorFactorise ;
302- if (info_) {
303- info_->factor_time += clock.stop ();
304- info_->factor_number ++;
305- }
300+
301+ info_.factor_time += clock.stop ();
302+ info_.factor_number ++;
306303
307304 this ->valid_ = true ;
308305 return kStatusOk ;
@@ -318,13 +315,11 @@ Int FactorHiGHSSolver::solveNE(const std::vector<double>& rhs,
318315
319316 Clock clock;
320317 if (FH_.solve (lhs)) return kStatusErrorSolve ;
321- if (info_) {
322- info_->solve_time += clock.stop ();
323- info_->solve_number ++;
324- }
325- if (data_) {
326- data_->back ().num_solves ++;
327- }
318+
319+ info_.solve_time += clock.stop ();
320+ info_.solve_number ++;
321+
322+ data_.back ().num_solves ++;
328323
329324 return kStatusOk ;
330325}
@@ -345,13 +340,11 @@ Int FactorHiGHSSolver::solveAS(const std::vector<double>& rhs_x,
345340
346341 Clock clock;
347342 if (FH_.solve (rhs)) return kStatusErrorSolve ;
348- if (info_) {
349- info_->solve_time += clock.stop ();
350- info_->solve_number ++;
351- }
352- if (data_) {
353- data_->back ().num_solves ++;
354- }
343+
344+ info_.solve_time += clock.stop ();
345+ info_.solve_number ++;
346+
347+ data_.back ().num_solves ++;
355348
356349 // split lhs
357350 lhs_x = std::vector<double >(rhs.begin (), rhs.begin () + n);
@@ -377,7 +370,7 @@ Int FactorHiGHSSolver::analyseAS(Symbolic& S) {
377370 std::vector<Int> ptrLower, rowsLower;
378371 if (Int status = getASstructure (model_.A (), ptrLower, rowsLower))
379372 return status;
380- if ( info_) info_-> matrix_structure_time = clock.stop ();
373+ info_. matrix_structure_time = clock.stop ();
381374
382375 // create vector of signs of pivots
383376 std::vector<Int> pivot_signs (model_.A ().num_col_ + model_.A ().num_row_ , -1 );
@@ -388,7 +381,7 @@ Int FactorHiGHSSolver::analyseAS(Symbolic& S) {
388381
389382 clock.start ();
390383 Int status = FH_.analyse (S, rowsLower, ptrLower, pivot_signs);
391- if ( info_) info_-> analyse_AS_time = clock.stop ();
384+ info_. analyse_AS_time = clock.stop ();
392385
393386 if (status && log_.debug (2 )) {
394387 log_.print (" Failed augmented system:" );
@@ -418,7 +411,7 @@ Int FactorHiGHSSolver::analyseNE(Symbolic& S, int64_t nz_limit) {
418411
419412 Clock clock;
420413 if (Int status = buildNEstructure (model_.A (), nz_limit)) return status;
421- if ( info_) info_-> matrix_structure_time = clock.stop ();
414+ info_. matrix_structure_time = clock.stop ();
422415
423416 // create vector of signs of pivots
424417 std::vector<Int> pivot_signs (model_.A ().num_row_ , 1 );
@@ -427,7 +420,7 @@ Int FactorHiGHSSolver::analyseNE(Symbolic& S, int64_t nz_limit) {
427420
428421 clock.start ();
429422 Int status = FH_.analyse (S, rowsNE_, ptrNE_, pivot_signs);
430- if ( info_) info_-> analyse_NE_time = clock.stop ();
423+ info_. analyse_NE_time = clock.stop ();
431424
432425 if (status && log_.debug (2 )) {
433426 log_.print (" Failed normal equations:" );
0 commit comments