IpCbcBoundsReader.hpp

Go to the documentation of this file.
00001 // (C) Copyright Carnegie Mellon University 2005
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // Authors :
00006 // Pierre Bonami, Carnegie Mellon University,
00007 //
00008 // Date : 26/05/2005
00009 
00010 #ifndef IpCbcBoundsReader_HPP
00011 #define IpCbcBoundsReader_HPP
00012 
00013 #include <string>
00014 #include "IpoptInterface.hpp"
00015 
00018 class IpCbcBoundsReader
00019 {
00020 public:
00021   //Default constructor
00022   IpCbcBoundsReader():
00023       fileName_(),
00024       lowerBounds_(NULL),
00025       upperBounds_(NULL),
00026       nLower_(0),
00027       nUpper_(0)
00028   {}
00029 
00030   // Constructor with name of the file to read passed.
00031   IpCbcBoundsReader(const std::string &fileName):
00032       fileName_(fileName),
00033       lowerBounds_(NULL),
00034       upperBounds_(NULL),
00035       indexLowers_(NULL),
00036       indexUppers_(NULL),
00037       nLower_(0),
00038       nUpper_(0)
00039   {}
00040 
00041   // Set the name of the file to read.
00042   void setFileName(const std::string &fileName)
00043   {
00044     fileName_ = fileName;
00045   }
00046 
00047   // Destructor
00048   ~IpCbcBoundsReader();
00049 
00050   // Cleanup allocated data
00051   void gutsOfDestructor();
00052 
00053 
00054   // Read the file with given fileName
00055   void read(const std::string &);
00056 
00057   //Read the file named fileName_
00058   void read();
00059 
00060   //Read fileName_ and apply the bounds read to solver
00061   void readAndApply(IpoptInterface& solver);
00062 private:
00063 
00065   std::string fileName_;
00067   double * lowerBounds_;
00069   double * upperBounds_;
00071   int * indexLowers_;
00073   int * indexUppers_;
00075   int nLower_;
00077   int nUpper_;
00078 };
00079 
00080 #endif

Generated on Fri May 16 21:05:59 2008 for Bonmin by  doxygen 1.4.7