17 file_(), suffix_(suffix), indices_(), names_()
26 file_(file), suffix_(suffix), indices_(), names_()
31 std::string colFileName =
file_;
32 size_t size = colFileName.size();
33 bool hasNlExtension = (colFileName.size()>4) && (colFileName[size - 1] ==
'l') && (colFileName[size - 2] ==
'n') && (colFileName[size - 3] ==
'.');
35 colFileName.erase(size-3,3);
37 std::ifstream inFile(colFileName.c_str());
38 if(!inFile.is_open()) {
55 for(
int i = 0 ; i < nVar ; i++) {
void copyNames(OsiSolverInterface::OsiNameVec &Names)
Copy the names to Names.
namesHash indices_
Hash map used to store the indices.
std::string file_
Name of the file to read.
bool readFile()
Reads the .col file.
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")
std::vector< std::string > names_
Variable names.
const std::string & name(int i)
Access Names of indexed by i.