1717
1818#include " linalg.hpp"
1919
20+ #include " io/HighsIO.h" // For pdlpLogging
21+
2022void Scaling::Initialize (const HighsLp& lp) {
2123 col_scale_.assign (lp.num_col_ , 1.0 );
2224 row_scale_.assign (lp.num_row_ , 1.0 );
@@ -27,11 +29,12 @@ void Scaling::Initialize(const HighsLp& lp) {
2729 norm_rhs_ = linalg::compute_rhs_norm (lp, 2.0 );
2830}
2931
30- void LogMatrixNorms (const HighsLp& lp, const std::string& stage) {
31- std::cout << " \n --- Matrix Norms " << stage << " ---" << std::endl;
32+ void Scaling::LogMatrixNorms (const std::string& stage) {
33+ const HighsLp& lp = *lp_;
34+ highsLogUser (params_->log_options_ , HighsLogType::kInfo , " \n --- Matrix Norms %d ---\n " , stage.c_str ());
3235
3336 if (lp.num_col_ == 0 || lp.num_row_ == 0 ) {
34- std::cout << " Matrix is empty. " << std::endl ;
37+ highsLogUser (params_-> log_options_ , HighsLogType:: kInfo , " Matrix is empty\n " ) ;
3538 return ;
3639 }
3740
@@ -43,7 +46,7 @@ void LogMatrixNorms(const HighsLp& lp, const std::string& stage) {
4346 iEl < lp.a_matrix_ .start_ [iCol + 1 ]; ++iEl) {
4447 max_abs_val = std::max (max_abs_val, std::abs (lp.a_matrix_ .value_ [iEl]));
4548 }
46- std::cout << " Col " << iCol << " : " << max_abs_val << std::endl ;
49+ highsLogUser (params_-> log_options_ , HighsLogType:: kInfo , " Col %d: %g \n " , iCol, max_abs_val) ;
4750 }
4851
4952 // --- Calculate and Log Row Norms (Infinity Norm) ---
@@ -59,10 +62,9 @@ void LogMatrixNorms(const HighsLp& lp, const std::string& stage) {
5962 }
6063
6164 for (HighsInt iRow = 0 ; iRow < lp.num_row_ ; ++iRow) {
62- std::cout << " Row " << iRow << " : " << row_max_abs_vals[iRow]
63- << std::endl;
65+ highsLogUser (params_->log_options_ , HighsLogType::kInfo , " Row %d: %g\n " , iRow, row_max_abs_vals[iRow]);
6466 }
65- std::cout << " -------------------------\n " << std::endl ;
67+ highsLogUser (params_-> log_options_ , HighsLogType:: kInfo , " -------------------------\n " ) ;
6668}
6769
6870void Scaling::scaleProblem () {
0 commit comments