@@ -2588,6 +2588,34 @@ void writeBasisFile(FILE*& file, const HighsOptions& options,
25882588 }
25892589}
25902590
2591+ HighsStatus getIndexFromName (const HighsLogOptions& log_options,
2592+ std::string& from_method,
2593+ const bool is_column,
2594+ std::string& name,
2595+ std::unordered_map<std::string, int > name2index,
2596+ HighsInt& index,
2597+ const std::vector<std::string>& names) {
2598+ auto search = name2index.find (name);
2599+ if (search == name2index.end ()) {
2600+ highsLogUser (log_options, HighsLogType::kError ,
2601+ " %s: %s name %s is not found\n " , from_method.c_str (),
2602+ is_column ? " column" : " row" ,
2603+ name.c_str ());
2604+ return HighsStatus::kError ;
2605+ }
2606+ if (search->second == kHashIsDuplicate ) {
2607+ highsLogUser (log_options, HighsLogType::kError ,
2608+ " %s: %s name %s is duplicated\n " , from_method.c_str (),
2609+ is_column ? " column" : " row" ,
2610+ name.c_str ());
2611+ return HighsStatus::kError ;
2612+ }
2613+ index = search->second ;
2614+ assert (names[index] == name);
2615+ return HighsStatus::kOk ;
2616+ }
2617+
2618+
25912619HighsStatus readBasisFile (const HighsLogOptions& log_options,
25922620 HighsLp& lp, HighsBasis& basis,
25932621 const std::string filename) {
0 commit comments