@@ -1811,28 +1811,59 @@ void HighsSolution::clear() {
18111811 this ->row_dual .clear ();
18121812}
18131813
1814+ void HighsSolution::print (const std::string& prefix,
1815+ const std::string& message) const {
1816+ HighsInt num_col = this ->col_value .size ();
1817+ HighsInt num_row = this ->row_value .size ();
1818+ printf (" %s HighsSolution(num_col = %d, num_row = %d): %s\n " , prefix.c_str (),
1819+ int (num_col), int (num_row), message.c_str ());
1820+ for (HighsInt iCol = 0 ; iCol < num_col; iCol++)
1821+ printf (" %s col_value[%3d] = %11.4g\n " , prefix.c_str (), int (iCol),
1822+ this ->col_value [iCol]);
1823+ for (HighsInt iRow = 0 ; iRow < num_row; iRow++)
1824+ printf (" %s row_value[%3d] = %11.4g\n " , prefix.c_str (), int (iRow),
1825+ this ->row_value [iRow]);
1826+
1827+ num_col = this ->col_dual .size ();
1828+ num_row = this ->row_dual .size ();
1829+ printf (" %s HighsSolution(num_col = %d, num_row = %d): %s\n " , prefix.c_str (),
1830+ int (num_col), int (num_row), message.c_str ());
1831+ for (HighsInt iCol = 0 ; iCol < num_col; iCol++)
1832+ printf (" %s col_dual[%3d] = %11.4g\n " , prefix.c_str (), int (iCol),
1833+ this ->col_dual [iCol]);
1834+ for (HighsInt iRow = 0 ; iRow < num_row; iRow++)
1835+ printf (" %s row_dual[%3d] = %11.4g\n " , prefix.c_str (), int (iRow),
1836+ this ->row_dual [iRow]);
1837+ }
1838+
18141839void HighsObjectiveSolution::clear () { this ->col_value .clear (); }
18151840
1816- void HighsBasis::print (std::string message) const {
1841+ void HighsBasis::print (const std::string& prefix,
1842+ const std::string& message) const {
18171843 if (!this ->useful ) return ;
1818- this ->printScalars (message);
1844+ this ->printScalars (prefix, message);
18191845 for (HighsInt iCol = 0 ; iCol < HighsInt (this ->col_status .size ()); iCol++)
1820- printf (" Basis : col_status[%2d] = %d\n " , int (iCol),
1846+ printf (" %s HighsBasis : col_status[%2d] = %d\n " , prefix. c_str () , int (iCol),
18211847 int (this ->col_status [iCol]));
18221848 for (HighsInt iRow = 0 ; iRow < HighsInt (this ->row_status .size ()); iRow++)
1823- printf (" Basis : row_status[%2d] = %d\n " , int (iRow),
1849+ printf (" %s HighsBasis : row_status[%2d] = %d\n " , prefix. c_str () , int (iRow),
18241850 int (this ->row_status [iRow]));
18251851}
18261852
1827- void HighsBasis::printScalars (std::string message) const {
1828- printf (" \n Basis: %s\n " , message.c_str ());
1829- printf (" valid = %d\n " , this ->valid );
1830- printf (" alien = %d\n " , this ->alien );
1831- printf (" useful = %d\n " , this ->useful );
1832- printf (" was_alien = %d\n " , this ->was_alien );
1833- printf (" debug_id = %d\n " , int (this ->debug_id ));
1834- printf (" debug_update_count = %d\n " , int (this ->debug_update_count ));
1835- printf (" debug_origin_name = %s\n " , this ->debug_origin_name .c_str ());
1853+ void HighsBasis::printScalars (const std::string& prefix,
1854+ const std::string& message) const {
1855+ HighsInt num_col = this ->col_status .size ();
1856+ HighsInt num_row = this ->row_status .size ();
1857+ printf (" \n %s HighsBasis(num_col = %d, num_row = %d): %s\n " , prefix.c_str (), int (num_col), int (num_row), message.c_str ());
1858+ printf (" %s valid = %d\n " , prefix.c_str (), this ->valid );
1859+ printf (" %s alien = %d\n " , prefix.c_str (), this ->alien );
1860+ printf (" %s useful = %d\n " , prefix.c_str (), this ->useful );
1861+ printf (" %s was_alien = %d\n " , prefix.c_str (), this ->was_alien );
1862+ printf (" %s debug_id = %d\n " , prefix.c_str (), int (this ->debug_id ));
1863+ printf (" %s debug_update_count = %d\n " , prefix.c_str (),
1864+ int (this ->debug_update_count ));
1865+ printf (" %s debug_origin_name = %s\n " , prefix.c_str (),
1866+ this ->debug_origin_name .c_str ());
18361867}
18371868
18381869void HighsBasis::invalidate () {
0 commit comments