OS  2.10.2
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);
84 
91  OSnl2OS(ASL *cw, ASL *rw, ASL *asl);
92 
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 
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
OS_AMPL_SUFFIX_TYPE
OS_AMPL_SUFFIX_TYPE
Definition: OSnl2OS.h:49
OSnl2OS::osol
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
OS_AMPL_SUFFIX_SCOPE_variables
@ OS_AMPL_SUFFIX_SCOPE_variables
Definition: OSnl2OS.h:56
OS_AMPL_SUFFIX_TYPE_double
@ OS_AMPL_SUFFIX_TYPE_double
Definition: OSnl2OS.h:51
OS_AMPL_SUFFIX_SCOPE_objectives
@ OS_AMPL_SUFFIX_SCOPE_objectives
Definition: OSnl2OS.h:58
OSoLReader
Used to read an OSoL string.
Definition: OSoLReader.h:38
OSInstance
The in-memory representation of an OSiL instance..
Definition: OSInstance.h:2263
OSMathUtil.h
OS_AMPL_SUFFIX::direction
OS_AMPL_SUFFIX_DIRECTION direction
Definition: OSnl2OS.h:75
OSnl2OS::OSnl2OS
OSnl2OS()
the OSnl2OS class constructor
OSnl2OS::OSnl2OS
OSnl2OS(ASL *cw, ASL *rw, ASL *asl)
alternate constructor which does not allocate the ASL structs
OSnl2OS::setOsol
void setOsol(std::string osol)
set the osol string
OSInstance.h
This file defines the OSInstance class along with its supporting classes.
OSOption.h
OSnl2OS::getASL
ASL * getASL(std::string name)
return a pointer to an ASL object
OS_AMPL_SUFFIX_DIRECTION_toSolver
@ OS_AMPL_SUFFIX_DIRECTION_toSolver
Definition: OSnl2OS.h:64
OSnl2OS
The OSnl2OS Class.
Definition: OSnl2OS.h:79
OSnl2OS::osinstance
OSInstance * osinstance
osinstance is a pointer to the OSInstance object that gets created from the information in the nl fil...
Definition: OSnl2OS.h:172
OS_AMPL_SUFFIX_DIRECTION_both
@ OS_AMPL_SUFFIX_DIRECTION_both
Definition: OSnl2OS.h:66
OSoLReader.h
OS_AMPL_SUFFIX_DIRECTION_local
@ OS_AMPL_SUFFIX_DIRECTION_local
Definition: OSnl2OS.h:67
OSnl2OS::~OSnl2OS
~OSnl2OS()
the OSnl2OS class destructor
OSnl2OS::operand
std::vector< double > operand
Definition: OSnl2OS.h:192
OSnLNode
The OSnLNode Class for nonlinear expressions.
Definition: OSnLNode.h:180
OS_AMPL_SUFFIX::name
std::string name
Definition: OSnl2OS.h:72
OS_AMPL_SUFFIX
Definition: OSnl2OS.h:71
OSnl2OS::osoption
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
OSnl2OS::readNl
bool readNl(std::string stub)
read the nl file
OSnl2OS::setVar
void setVar(OSInstance *osinstance, int lower, int upper, char vartype)
store a number of variables into an OSInstance object
OSOption
The Option Class.
Definition: OSOption.h:3565
OSnl2OS::osolreader
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
OS_AMPL_SUFFIX_SCOPE_problems
@ OS_AMPL_SUFFIX_SCOPE_problems
Definition: OSnl2OS.h:59
OSnl2OS::walkTree
OSnLNode * walkTree(expr *e)
parse an nl tree structure holding a nonlinear expression
OSnl2OS::setASL
bool setASL(ASL *asl, ASL *rw, ASL *cw)
set the pointers to the three ASL objects
OSnl2OS::setIBVar
void setIBVar(OSInstance *osinstance, int lower, int upper)
special version of the previous method because AMPL makes no distinction between integer and binary v...
OS_AMPL_SUFFIX_SCOPE_constraints
@ OS_AMPL_SUFFIX_SCOPE_constraints
Definition: OSnl2OS.h:57
OS_AMPL_SUFFIX_SCOPE
OS_AMPL_SUFFIX_SCOPE
Definition: OSnl2OS.h:55
OS_AMPL_SUFFIX_DIRECTION
OS_AMPL_SUFFIX_DIRECTION
Definition: OSnl2OS.h:63
OSnl2OS::createOSObjects
bool createOSObjects()
create an OSInstance and OSOption representation from the AMPL nl content (Some of the information in...
OSnl2OS::setJobID
void setJobID(std::string jobID)
set the job ID
OS_AMPL_SUFFIX_DIRECTION_toAMPL
@ OS_AMPL_SUFFIX_DIRECTION_toAMPL
Definition: OSnl2OS.h:65
OSnl2OS::op_type
std::vector< std::string > op_type
Definition: OSnl2OS.h:191
OS_AMPL_SUFFIX_TYPE_integer
@ OS_AMPL_SUFFIX_TYPE_integer
Definition: OSnl2OS.h:50
OSnl2OS::jobID
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
OS_AMPL_SUFFIX::type
OS_AMPL_SUFFIX_TYPE type
Definition: OSnl2OS.h:73
OS_AMPL_SUFFIX::scope
OS_AMPL_SUFFIX_SCOPE scope
Definition: OSnl2OS.h:74
OSnl2OS::numkount
int numkount
Definition: OSnl2OS.h:193
OSnLNode.h
This file defines the OSnLNode class along with its derived classes.