Bonmin  1.8.8
BonBoundsReader.hpp
Go to the documentation of this file.
1 // (C) Copyright Carnegie Mellon University 2005
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // Pierre Bonami, Carnegie Mellon University,
7 //
8 // Date : 26/05/2005
9 
10 #ifndef BoundsReader_HPP
11 #define BoundsReader_HPP
12 
13 #include <string>
15 
16 
17 namespace Bonmin {
21 {
22 public:
23  //Default constructor
25  fileName_(),
26  lowerBounds_(NULL),
27  upperBounds_(NULL),
28  nLower_(0),
29  nUpper_(0)
30  {}
31 
32  // Constructor with name of the file to read passed.
33  BoundsReader(const std::string &fileName):
34  fileName_(fileName),
35  lowerBounds_(NULL),
36  upperBounds_(NULL),
37  indexLowers_(NULL),
38  indexUppers_(NULL),
39  nLower_(0),
40  nUpper_(0)
41  {}
42 
43  // Set the name of the file to read.
44  void setFileName(const std::string &fileName)
45  {
46  fileName_ = fileName;
47  }
48 
49  // Destructor
50  ~BoundsReader();
51 
52  // Cleanup allocated data
53  void gutsOfDestructor();
54 
55 
56  // Read the file with given fileName
57  void read(const std::string &);
58 
59  //Read the file named fileName_
60  void read();
61 
62  //Read fileName_ and apply the bounds read to solver
63  void readAndApply(OsiTMINLPInterface * solver);
64 private:
65 
67  std::string fileName_;
69  double * lowerBounds_;
71  double * upperBounds_;
73  int * indexLowers_;
75  int * indexUppers_;
77  int nLower_;
79  int nUpper_;
80 };
81 }
82 #endif
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
BoundsReader(const std::string &fileName)
double * upperBounds_
changed upper bounds
double * lowerBounds_
changed lower bounds
std::string fileName_
Current file.
void setFileName(const std::string &fileName)
int * indexUppers_
index of the changed upperBounds_
Reads a file containing change bounds for variables.
int nUpper_
number of changed upperBounds_
void readAndApply(OsiTMINLPInterface *solver)
int * indexLowers_
index of the changed lowerBounds_
int nLower_
number of changed lowerBounds_