Bonmin
1.8.8
src
Interfaces
Ampl
BonSolReader.hpp
Go to the documentation of this file.
1
// (C) Copyright CNRS 2011
2
// All Rights Reserved.
3
// This code is published under the Eclipse Public License.
4
//
5
// Authors :
6
// Pierre Bonami, LIF, CNRS,
7
//
8
// Date : 03/01/2011
9
10
#ifndef SolReader_HPP
11
#define SolReader_HPP
12
#include <string>
13
#include <vector>
14
#include <list>
15
#include <fstream>
16
#include <iostream>
17
#include <
CoinHelperFunctions.hpp
>
18
#include "
OsiSolverInterface.hpp
"
19
#include "
BonTypes.hpp
"
20
21
namespace
Bonmin
{
24
class
SolReader
25
{
26
public
:
28
SolReader
(
const
char
* fileName,
const
char
* suffix);
30
SolReader
(
const
std::string & fileName=
""
,
const
std::string& suffix=
".col"
);
32
bool
readFile
();
34
bool
readFile
(
const
std::string &file)
35
{
36
file_=file;
37
return
readFile
();
38
}
39
41
void
copySol
(
double
*
x
);
42
43
const
double
*
x
(){
44
return
x_();
45
}
46
48
void
set_n_cols
(
int
n){
49
x_.resize(n);
50
}
51
private
:
53
std::string file_;
54
56
std::string suffix_;
57
59
vector<double>
x_;
60
};
61
}
62
#endif
Bonmin::SolReader::set_n_cols
void set_n_cols(int n)
Set the number of variables in the problem.
Definition:
BonSolReader.hpp:48
Bonmin
(C) Copyright International Business Machines Corporation 2007
Definition:
BonAmplSetup.hpp:15
Bonmin::SolReader::x
const double * x()
Definition:
BonSolReader.hpp:43
OsiSolverInterface.hpp
Bonmin::vector< double >
BonTypes.hpp
Bonmin::SolReader::readFile
bool readFile(const std::string &file)
Reads the .sol file fileName.
Definition:
BonSolReader.hpp:34
Bonmin::SolReader::copySol
void copySol(double *x)
Copy the names to Names.
CoinHelperFunctions.hpp
Bonmin::SolReader::readFile
bool readFile()
Reads the .sol file.
Bonmin::SolReader
A class for reading a .col or .row file containing name for variables and constraints (usually ampl g...
Definition:
BonSolReader.hpp:24
Bonmin::SolReader::SolReader
SolReader(const char *fileName, const char *suffix)
Constructor with a file name given by a const char *.
Generated by
1.8.17