17 file_(), suffix_(suffix), x_()
26 file_(file), suffix_(suffix), x_()
31 std::string fileName =
file_;
32 size_t size = fileName.size();
33 bool hasNlExtension = (fileName.size()>4) && (fileName[size - 1] ==
'l') && (fileName[size - 2] ==
'n') && (fileName[size - 3] ==
'.');
35 fileName.erase(size-3,3);
37 std::ifstream inFile(fileName.c_str());
38 if(!inFile.is_open()) {
43 assert(token ==
"bonmin:");
48 if(token ==
"Options"){
49 for(
int i = 0 ; i < 6 ; i++){
53 inFile>>n_cols_2>>n_cols;
54 if(n_cols != static_cast<int>(
x_.size())){
55 fprintf(stderr,
"Number of columns different %d\n", n_cols);
59 for(
size_t i = 0 ; i <
x_.size() ; i++){
68 std::copy(
x_.begin(),
x_.end(),
x);
std::string suffix_
Suffix of the file (".col", ".row")
void copySol(double *x)
Copy the names to Names.
std::string file_
Name of the file to read.
bool readFile()
Reads the .sol file.
void fint fint fint real fint real * x
SolReader(const char *fileName, const char *suffix)
Constructor with a file name given by a const char *.
vector< double > x_
Sol values.