|
Bonmin
1.7
|
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 *. | |
| NamesReader (const std::string &fileName="", const std::string &suffix=".col") | |
| Constructor with a file name given by a string and also default (empty string) | |
| bool | readFile () |
| Reads the .col file. | |
| bool | readFile (const std::string &file) |
| Reads the .col file fileName. | |
| void | copyNames (OsiSolverInterface::OsiNameVec &Names) |
| Copy the names to Names. | |
| const std::string & | name (int i) |
| Access Names of indexed by i. | |
| int | index (const char *str) |
| Access index of variable str. | |
Private Types | |
| typedef std::map< const char *, int, ltstr > | namesHash |
| Hash type. | |
Private Attributes | |
| std::string | file_ |
| Name of the file to read. | |
| std::string | suffix_ |
| Suffix of the file (".col", ".row") | |
| namesHash | indices_ |
| Hash map used to store the indices. | |
| std::vector< std::string > | names_ |
| Variable names. | |
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.
typedef std::map<const char *, int, ltstr> Bonmin::NamesReader::namesHash [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 *.
| 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)
| bool Bonmin::NamesReader::readFile | ( | ) |
Reads the .col file.
Referenced by readFile().
| bool Bonmin::NamesReader::readFile | ( | const std::string & | file | ) | [inline] |
Reads the .col file fileName.
Definition at line 35 of file BonColReader.hpp.
References file_, and readFile().
| void Bonmin::NamesReader::copyNames | ( | OsiSolverInterface::OsiNameVec & | Names | ) |
Copy the names to Names.
| const std::string& Bonmin::NamesReader::name | ( | int | i | ) | [inline] |
| int Bonmin::NamesReader::index | ( | const char * | str | ) | [inline] |
std::string Bonmin::NamesReader::file_ [private] |
std::string Bonmin::NamesReader::suffix_ [private] |
Suffix of the file (".col", ".row")
Definition at line 58 of file BonColReader.hpp.
namesHash Bonmin::NamesReader::indices_ [private] |
Hash map used to store the indices.
Definition at line 72 of file BonColReader.hpp.
Referenced by index().
std::vector<std::string> Bonmin::NamesReader::names_ [private] |
1.7.5.1