10 #ifndef NameReader_HPP
11 #define NameReader_HPP
17 #include <CoinHelperFunctions.hpp>
18 #include "OsiSolverInterface.hpp"
29 NamesReader(
const char * fileName,
const char * suffix);
31 NamesReader(
const std::string & fileName=
"",
const std::string& suffix=
".col");
42 void copyNames(OsiSolverInterface::OsiNameVec& Names);
45 const std::string&
name(
int i){
65 return strcmp(s1, s2) < 0;
70 typedef std::map<const char *, int, ltstr>
namesHash;
void copyNames(OsiSolverInterface::OsiNameVec &Names)
Copy the names to Names.
std::map< const char *, int, ltstr > namesHash
Hash type.
namesHash indices_
Hash map used to store the indices.
String comparison strucutre.
std::string file_
Name of the file to read.
int index(const char *str)
Access index of variable str.
bool readFile()
Reads the .col file.
bool readFile(const std::string &file)
Reads the .col file fileName.
NamesReader(const char *fileName, const char *suffix)
Constructor with a file name given by a const char *.
std::string suffix_
Suffix of the file (".col", ".row")
bool operator()(const char *s1, const char *s2) const
A class for reading a .col or .row file containing name for variables and constraints (usually ampl g...
std::vector< std::string > names_
Variable names.
const std::string & name(int i)
Access Names of indexed by i.