@@ -715,8 +715,8 @@ HighsStatus Highs::readBasis(const std::string& filename) {
715715 HighsBasis read_basis = basis_;
716716 return_status = interpretCallStatus (
717717 options_.log_options ,
718- readBasisFile (options_.log_options , model_.lp_ , read_basis, filename), return_status,
719- " readBasis" );
718+ readBasisFile (options_.log_options , model_.lp_ , read_basis, filename),
719+ return_status, " readBasis" );
720720 if (return_status != HighsStatus::kOk ) return return_status;
721721 // Basis read OK: check whether it's consistent with the LP
722722 if (!isBasisConsistent (model_.lp_ , read_basis)) {
@@ -3081,20 +3081,10 @@ HighsStatus Highs::getColByName(const std::string& name, HighsInt& col) {
30813081 HighsLp& lp = model_.lp_ ;
30823082 if (!lp.col_names_ .size ()) return HighsStatus::kError ;
30833083 if (!lp.col_hash_ .name2index .size ()) lp.col_hash_ .form (lp.col_names_ );
3084- auto search = lp.col_hash_ .name2index .find (name);
3085- if (search == lp.col_hash_ .name2index .end ()) {
3086- highsLogUser (options_.log_options , HighsLogType::kError ,
3087- " Highs::getColByName: name %s is not found\n " , name.c_str ());
3088- return HighsStatus::kError ;
3089- }
3090- if (search->second == kHashIsDuplicate ) {
3091- highsLogUser (options_.log_options , HighsLogType::kError ,
3092- " Highs::getColByName: name %s is duplicated\n " , name.c_str ());
3093- return HighsStatus::kError ;
3094- }
3095- col = search->second ;
3096- assert (lp.col_names_ [col] == name);
3097- return HighsStatus::kOk ;
3084+ std::string from_method = " Highs::getColByName" ;
3085+ const bool is_column = true ;
3086+ return getIndexFromName (options_.log_options , from_method, is_column, name,
3087+ lp.col_hash_ .name2index , col, lp.col_names_ );
30983088}
30993089
31003090HighsStatus Highs::getColIntegrality (const HighsInt col,
@@ -3196,20 +3186,10 @@ HighsStatus Highs::getRowByName(const std::string& name, HighsInt& row) {
31963186 HighsLp& lp = model_.lp_ ;
31973187 if (!lp.row_names_ .size ()) return HighsStatus::kError ;
31983188 if (!lp.row_hash_ .name2index .size ()) lp.row_hash_ .form (lp.row_names_ );
3199- auto search = lp.row_hash_ .name2index .find (name);
3200- if (search == lp.row_hash_ .name2index .end ()) {
3201- highsLogUser (options_.log_options , HighsLogType::kError ,
3202- " Highs::getRowByName: name %s is not found\n " , name.c_str ());
3203- return HighsStatus::kError ;
3204- }
3205- if (search->second == kHashIsDuplicate ) {
3206- highsLogUser (options_.log_options , HighsLogType::kError ,
3207- " Highs::getRowByName: name %s is duplicated\n " , name.c_str ());
3208- return HighsStatus::kError ;
3209- }
3210- row = search->second ;
3211- assert (lp.row_names_ [row] == name);
3212- return HighsStatus::kOk ;
3189+ std::string from_method = " Highs::getRowByName" ;
3190+ const bool is_column = false ;
3191+ return getIndexFromName (options_.log_options , from_method, is_column, name,
3192+ lp.row_hash_ .name2index , row, lp.row_names_ );
32133193}
32143194
32153195HighsStatus Highs::getCoeff (const HighsInt row, const HighsInt col,
0 commit comments