OSnl2OS.h
Go to the documentation of this file.
1 /* $Id: OSnl2OS.h 4249 2011-08-11 01:08:14Z Gassmann $ */
16 #ifndef OSNL2OS_H
17 #define OSNL2OS_H
18 
19 
20 #include "OSoLReader.h"
21 #include "OSOption.h"
22 #include "OSInstance.h"
23 #include "OSnLNode.h"
24 #include "OSMathUtil.h"
25 #include <string>
26 #include <vector>
27 
28 
43 struct ograd;
44 struct cgrad;
45 struct ASL;
46 struct expr;
47 
49 {
52 };
53 
55 {
60 };
61 
63 {
68 };
69 
71 {
72  std::string name;
76 };
77 
78 class OSnl2OS
79 {
80 public:
82  //OSnl2OS( std::string nlfilename, std::string osol);
83  OSnl2OS();
84 
91  OSnl2OS(ASL *cw, ASL *rw, ASL *asl);
92 
94  ~OSnl2OS();
95 
102  ASL* getASL(std::string name);
103 
109  bool readNl(std::string stub);
110 
112  void setOsol(std::string osol);
113 
115  void setJobID(std::string jobID);
116 
125  bool setASL(ASL *asl, ASL *rw, ASL *cw);
126 
135  bool createOSObjects();
136 
144  void setVar(OSInstance *osinstance, int lower, int upper, char vartype);
145 
154  void setIBVar(OSInstance *osinstance, int lower, int upper);
155 
161 
167  OSnLNode* walkTree(expr *e);
168 
173 
178 
183  std::string osol;
184 
189  std::string jobID;
190 
191  std::vector<std::string> op_type;
192  std::vector<double> operand;
193  int numkount;
194 
195 private:
196 
200  ograd *og;
201 
207  ASL *cw, *rw, *asl;
208 
211  std::string stub;
212 
213 }; //end of OSnl2OS
214 
215 #endif
This file defines the OSnLNode class along with its derived classes.
ASL * cw
Pointers to AMPL data structures.
Definition: OSnl2OS.h:207
OS_AMPL_SUFFIX_TYPE type
Definition: OSnl2OS.h:73
ASL * asl
Definition: OSnl2OS.h:207
ograd * og
og is a pointer to the AMPL data structure holding the objective function coefficients ...
Definition: OSnl2OS.h:200
bool readNl(std::string stub)
read the nl file
Definition: OSnl2OS.cpp:109
bool createOSObjects()
create an OSInstance and OSOption representation from the AMPL nl content (Some of the information in...
Definition: OSnl2OS.cpp:504
void setOsol(std::string osol)
set the osol string
Definition: OSnl2OS.cpp:99
OS_AMPL_SUFFIX_SCOPE
Definition: OSnl2OS.h:54
The Option Class.
Definition: OSOption.h:3564
OSnl2OS()
the OSnl2OS class constructor
Definition: OSnl2OS.cpp:71
std::vector< double > operand
Definition: OSnl2OS.h:192
void fint fint fint real fint real real real real real real real real real * e
OSnLNode * walkTree(expr *e)
parse an nl tree structure holding a nonlinear expression
Definition: OSnl2OS.cpp:206
OS_AMPL_SUFFIX_DIRECTION
Definition: OSnl2OS.h:62
int numkount
Definition: OSnl2OS.h:193
std::string stub
stub is the name of the file with the nl instance
Definition: OSnl2OS.h:211
OSOption * osoption
osoption is a pointer to the OSOption object that gets created from the information in the nl file (a...
Definition: OSnl2OS.h:177
OS_AMPL_SUFFIX_TYPE
Definition: OSnl2OS.h:48
OS_AMPL_SUFFIX_SCOPE scope
Definition: OSnl2OS.h:74
std::string jobID
jobID is a string containing a jobID that may have been supplied on the command line (it may be empty...
Definition: OSnl2OS.h:189
~OSnl2OS()
the OSnl2OS class destructor
Definition: OSnl2OS.cpp:178
std::string name
Definition: OSnl2OS.h:72
ASL * rw
Definition: OSnl2OS.h:207
std::string osol
osol is a string containing the content of the OS option file (it may be empty if no option file was ...
Definition: OSnl2OS.h:183
std::vector< std::string > op_type
Definition: OSnl2OS.h:191
Used to read an OSoL string.
Definition: OSoLReader.h:37
bool setASL(ASL *asl, ASL *rw, ASL *cw)
set the pointers to the three ASL objects
ASL * getASL(std::string name)
return a pointer to an ASL object
Definition: OSnl2OS.cpp:87
void setIBVar(OSInstance *osinstance, int lower, int upper)
special version of the previous method because AMPL makes no distinction between integer and binary v...
Definition: OSnl2OS.cpp:481
void setJobID(std::string jobID)
set the job ID
Definition: OSnl2OS.cpp:104
The in-memory representation of an OSiL instance..
Definition: OSInstance.h:2262
OS_AMPL_SUFFIX_DIRECTION direction
Definition: OSnl2OS.h:75
The OSnLNode Class for nonlinear expressions.
Definition: OSnLNode.h:179
The OSnl2OS Class.
Definition: OSnl2OS.h:78
OSInstance * osinstance
osinstance is a pointer to the OSInstance object that gets created from the information in the nl fil...
Definition: OSnl2OS.h:172
void setVar(OSInstance *osinstance, int lower, int upper, char vartype)
store a number of variables into an OSInstance object
Definition: OSnl2OS.cpp:461
OSoLReader * osolreader
we may need to parse an OSoL file if there is suffix information indicated in the AMPL nl content ...
Definition: OSnl2OS.h:160