Bonmin  1.8.8
BonStartPointReader.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 _BONSTARTPOINTREADER_H_
11 #define _BONSTARTPOINTREADER_H_
12 #include <string>
13 #include <list>
14 #include <fstream>
15 #include <iostream>
17 
18 
19 
20 namespace Bonmin {
24 {
25 public:
27  StartPointReader(std::string fileName = ""):
28  fileName_(fileName),
29  primals_(NULL),
30  duals_(NULL)
31  {}
33  StartPointReader(const char * fileName):
34  fileName_(fileName),
35  primals_(NULL),
36  duals_(NULL)
37  {}
38 
40  bool readFile();
42  bool readFile(const std::string &fileName)
43  {
44  fileName_=fileName;
45  return readFile();
46  }
48  bool readAndApply(OsiTMINLPInterface * solver);
50  {
52  }
53 
54 
57  {
58  if(primals_!=NULL)
59  delete[] primals_;
60  if(duals_!=NULL)
61  delete[] duals_;
62  }
63 
65  const double * getPrimals()
66  {
67  return primals_;
68  }
70  const double * getDuals()
71  {
72  return duals_;
73  }
74 private:
76  std::string fileName_;
77 
79  double * primals_;
81  double * duals_;
82 };
83 
84 }
85 #endif /*_IPCBCINITPOINTREADER_H_*/
std::string fileName_
Name of the file with initial point.
StartPointReader(const char *fileName)
Constructor with fileName_ given by a const char *.
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
void gutsOfDestructor()
Dealocate arrays.
double * primals_
Primal variables values.
bool readAndApply(OsiTMINLPInterface *solver)
Read warmstart info and apply to an IpoptInterface.
StartPointReader(std::string fileName="")
Constructor with fileName_ given by a string (and default)
bool readFile()
Reads the .initP file.
bool readFile(const std::string &fileName)
Reads the .initP file fileName.
This class reads a file with a starting point for Ipopt initalization.
double * duals_
Dual variables values.
const double * getPrimals()
Access primal variables values.
const double * getDuals()
Access dual variables values.