Bonmin 1.8.9
Loading...
Searching...
No Matches
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
20namespace Bonmin {
24{
25public:
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 }
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 }
74private:
76 std::string fileName_;
77
79 double * primals_;
81 double * duals_;
82};
83
84}
85#endif /*_IPCBCINITPOINTREADER_H_*/
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
This class reads a file with a starting point for Ipopt initalization.
StartPointReader(std::string fileName="")
Constructor with fileName_ given by a string (and default)
const double * getDuals()
Access dual variables values.
bool readFile()
Reads the .initP file.
void gutsOfDestructor()
Dealocate arrays.
bool readFile(const std::string &fileName)
Reads the .initP file fileName.
bool readAndApply(OsiTMINLPInterface *solver)
Read warmstart info and apply to an IpoptInterface.
StartPointReader(const char *fileName)
Constructor with fileName_ given by a const char *.
const double * getPrimals()
Access primal variables values.
(C) Copyright International Business Machines Corporation 2007