@@ -1864,7 +1864,7 @@ void reportLpColVectors(const HighsLogOptions& log_options, const HighsLp& lp) {
18641864 std::string type;
18651865 HighsInt count;
18661866 bool have_integer_columns = (getNumInt (lp) != 0 );
1867- bool have_col_names = ( lp.col_names_ .size () != 0 );
1867+ bool have_col_names = lp.col_names_ .size () == static_cast < size_t >(lp. num_col_ );
18681868
18691869 highsLogUser (log_options, HighsLogType::kInfo ,
18701870 " Column Lower Upper Cost "
@@ -2515,7 +2515,7 @@ HighsStatus assessLpPrimalSolution(const std::string message,
25152515 row_value.assign (lp.num_row_ , 0 );
25162516 const bool have_integrality = (lp.integrality_ .size () != 0 );
25172517 if (!solution.value_valid ) return HighsStatus::kError ;
2518- const bool have_col_names = lp.col_names_ .size () >= lp.num_col_ ;
2518+ const bool have_col_names = lp.col_names_ .size () == static_cast < size_t >( lp.num_col_ ) ;
25192519 for (HighsInt iCol = 0 ; iCol < lp.num_col_ ; iCol++) {
25202520 const std::string name_string =
25212521 have_col_names ? (" (" + lp.col_names_ [iCol] + " )" ) : " " ;
@@ -2628,20 +2628,6 @@ HighsStatus assessLpPrimalSolution(const std::string message,
26282628
26292629void writeBasisFile (FILE*& file, const HighsOptions& options, const HighsLp& lp,
26302630 const HighsBasis& basis) {
2631- /*
2632- fprintf(file, "HiGHS_basis_file %s\n", kHighsBasisFileV2.c_str());
2633- if (basis.valid == false) {
2634- fprintf(file, "None\n");
2635- return;
2636- }
2637- fprintf(file, "Valid\n");
2638- fprintf(file, "# Columns %d\n", (int)basis.col_status.size());
2639- for (const auto& status : basis.col_status) fprintf(file, "%d ", (int)status);
2640- fprintf(file, "\n");
2641- fprintf(file, "# Rows %d\n", (int)basis.row_status.size());
2642- for (const auto& status : basis.row_status) fprintf(file, "%d ", (int)status);
2643- fprintf(file, "\n");
2644- */
26452631 const HighsLogOptions& log_options = options.log_options ;
26462632 std::stringstream ss;
26472633 // Basis version line
@@ -2734,6 +2720,7 @@ HighsStatus readBasisStream(const HighsLogOptions& log_options, HighsLp& lp,
27342720 // Reads a basis as an ifstream, returning an error if what's read is
27352721 // inconsistent with the sizes of the HighsBasis passed in
27362722 HighsStatus return_status = HighsStatus::kOk ;
2723+ HighsStatus call_status = HighsStatus::kOk ;
27372724 std::string from_method = " readBasisStream" ;
27382725 std::string string_highs, string_version;
27392726 in_file >> string_highs >> string_version;
@@ -2757,12 +2744,13 @@ HighsStatus readBasisStream(const HighsLogOptions& log_options, HighsLp& lp,
27572744 highsLogUser (log_options, HighsLogType::kWarning ,
27582745 " readBasisFile: Basis file format %s is deprecated\n " ,
27592746 kHighsBasisFileV1 .c_str ());
2747+ return_status = HighsStatus::kWarning ;
27602748 }
27612749 std::string keyword;
27622750 in_file >> keyword;
27632751 if (keyword == " None" ) {
27642752 basis.valid = false ;
2765- return HighsStatus:: kOk ;
2753+ return return_status ;
27662754 }
27672755 const HighsInt basis_num_col = (HighsInt)basis.col_status .size ();
27682756 const HighsInt basis_num_row = (HighsInt)basis.row_status .size ();
@@ -2793,10 +2781,10 @@ HighsStatus readBasisStream(const HighsLogOptions& log_options, HighsLp& lp,
27932781 in_file >> name >> int_status;
27942782 if (have_col_names) {
27952783 // Use the column name if possible
2796- return_status =
2784+ call_status =
27972785 getIndexFromName (log_options, from_method, is_column, name,
27982786 lp.col_hash_ .name2index , iCol, lp.col_names_ );
2799- if (return_status != HighsStatus::kOk ) return return_status ;
2787+ if (call_status != HighsStatus::kOk ) return call_status ;
28002788 } else {
28012789 // Have to assume column basis status are in the right order
28022790 iCol = iX;
@@ -2827,10 +2815,10 @@ HighsStatus readBasisStream(const HighsLogOptions& log_options, HighsLp& lp,
28272815 in_file >> name >> int_status;
28282816 if (have_row_names) {
28292817 // Use the row name if possible
2830- return_status =
2818+ call_status =
28312819 getIndexFromName (log_options, from_method, is_column, name,
28322820 lp.row_hash_ .name2index , iRow, lp.row_names_ );
2833- if (return_status != HighsStatus::kOk ) return return_status ;
2821+ if (call_status != HighsStatus::kOk ) return call_status ;
28342822 } else {
28352823 // Have to assume row solution values are in the right order
28362824 iRow = iX;
@@ -3120,8 +3108,8 @@ HighsLp withoutSemiVariables(const HighsLp& lp_, HighsSolution& solution,
31203108 HighsInt semi_row_num = 0 ;
31213109 // Insert the new variables and their coefficients
31223110 std::stringstream ss;
3123- const bool have_col_names = ( lp.col_names_ .size () != 0 );
3124- const bool have_row_names = ( lp.row_names_ .size () != 0 );
3111+ const bool have_col_names = lp.col_names_ .size () == static_cast < size_t >(lp. num_col_ );
3112+ const bool have_row_names = lp.row_names_ .size () == static_cast < size_t >(lp. num_row_ );
31253113 const bool have_solution = solution.value_valid ;
31263114 if (have_solution) {
31273115 // Create zeroed row values for the new rows
0 commit comments