@@ -377,17 +377,20 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
377377 // Use member variables for iterates for cleaner state management
378378 x_current_ = x;
379379 y_current_ = y;
380+ linalg::project_bounds (lp_, x_current_);
381+ x_sum_ = x_current_;
382+ x_avg_ = x_current_;
383+ linalg::Ax (lp, x_current_, Ax_cache_);
384+ std::vector<double > Ax_avg = Ax_cache_;
385+ std::vector<double > ATy_avg (lp.num_col_ , 0.0 );
386+
380387 num_rejected_steps_ = 0 ;
381388 bool first_malitsky_iteration = true ;
382389 ratio_last_two_step_sizes_ = 1.0 ;
383390 bool using_malitsky_averaging =
384391 (params_.step_size_strategy == StepSizeStrategy::MALITSKY_POCK);
385392 bool primal_average_initialized = false ;
386393
387- // Initialize vectors for matrix-vector products
388- std::vector<double > Ax_avg (lp.num_row_ , 0.0 );
389- std::vector<double > ATy_avg (lp.num_col_ , 0.0 );
390-
391394 // Store iterates at last restart for primal weight update
392395 x_at_last_restart_ = x_current_;
393396 y_at_last_restart_ = y_current_;
@@ -400,7 +403,7 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
400403 debug_pdlp_data_.ax_average_norm = 0.0 ;
401404 debug_pdlp_data_.aty_average_norm = 0.0 ;
402405 debug_pdlp_data_.x_average_norm = 0.0 ;
403- debug_pdlp_data_.ax_norm = 0.0 ;
406+ debug_pdlp_data_.ax_norm = linalg::vector_norm (Ax_cache_) ;
404407
405408 for (int iter = 0 ; iter < params_.max_iterations ; ++iter) {
406409 debugPdlpIterLog (debug_pdlp_log_file_, iter, &debug_pdlp_data_,
0 commit comments