A class for reading a .col or .row file containing name for variables and constraints (usually ampl generated file). More...
#include <BonColReader.hpp>
Classes | |
struct | ltstr |
String comparison strucutre. More... | |
Public Member Functions | |
NamesReader (const char *fileName, const char *suffix) | |
Constructor with a file name given by a const char *. More... | |
NamesReader (const std::string &fileName="", const std::string &suffix=".col") | |
Constructor with a file name given by a string and also default (empty string) More... | |
bool | readFile () |
Reads the .col file. More... | |
bool | readFile (const std::string &file) |
Reads the .col file fileName. More... | |
void | copyNames (OsiSolverInterface::OsiNameVec &Names) |
Copy the names to Names. More... | |
const std::string & | name (int i) |
Access Names of indexed by i. More... | |
int | index (const char *str) |
Access index of variable str. More... | |
Private Types | |
typedef std::map< const char *, int, ltstr > | namesHash |
Hash type. More... | |
Private Attributes | |
std::string | file_ |
Name of the file to read. More... | |
std::string | suffix_ |
Suffix of the file (".col", ".row") More... | |
namesHash | indices_ |
Hash map used to store the indices. More... | |
std::vector< std::string > | names_ |
Variable names. More... | |
A class for reading a .col or .row file containing name for variables and constraints (usually ampl generated file).
Definition at line 25 of file BonColReader.hpp.
|
private |
Hash type.
Definition at line 70 of file BonColReader.hpp.
Bonmin::NamesReader::NamesReader | ( | const char * | fileName, |
const char * | suffix | ||
) |
Constructor with a file name given by a const char *.
Definition at line 15 of file BonColReader.cpp.
Bonmin::NamesReader::NamesReader | ( | const std::string & | fileName = "" , |
const std::string & | suffix = ".col" |
||
) |
Constructor with a file name given by a string and also default (empty string)
Definition at line 24 of file BonColReader.cpp.
bool Bonmin::NamesReader::readFile | ( | ) |
Reads the .col file.
Definition at line 29 of file BonColReader.cpp.
|
inline |
Reads the .col file fileName.
Definition at line 35 of file BonColReader.hpp.
void Bonmin::NamesReader::copyNames | ( | OsiSolverInterface::OsiNameVec & | Names | ) |
Copy the names to Names.
Definition at line 62 of file BonColReader.cpp.
|
inline |
Access Names of indexed by i.
Definition at line 45 of file BonColReader.hpp.
|
inline |
Access index of variable str.
Definition at line 50 of file BonColReader.hpp.
|
private |
Name of the file to read.
Definition at line 55 of file BonColReader.hpp.
|
private |
Suffix of the file (".col", ".row")
Definition at line 58 of file BonColReader.hpp.
|
private |
Hash map used to store the indices.
Definition at line 72 of file BonColReader.hpp.
|
private |
Variable names.
Definition at line 74 of file BonColReader.hpp.