My Project
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
43struct ograd;
44struct cgrad;
45struct ASL;
46struct expr;
47
53
61
69
77
79{
80public:
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;
194
195private:
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.
OS_AMPL_SUFFIX_SCOPE
Definition OSnl2OS.h:55
@ OS_AMPL_SUFFIX_SCOPE_objectives
Definition OSnl2OS.h:58
@ OS_AMPL_SUFFIX_SCOPE_problems
Definition OSnl2OS.h:59
@ OS_AMPL_SUFFIX_SCOPE_constraints
Definition OSnl2OS.h:57
@ OS_AMPL_SUFFIX_SCOPE_variables
Definition OSnl2OS.h:56
OS_AMPL_SUFFIX_TYPE
Definition OSnl2OS.h:49
@ OS_AMPL_SUFFIX_TYPE_integer
Definition OSnl2OS.h:50
@ OS_AMPL_SUFFIX_TYPE_double
Definition OSnl2OS.h:51
OS_AMPL_SUFFIX_DIRECTION
Definition OSnl2OS.h:63
@ OS_AMPL_SUFFIX_DIRECTION_both
Definition OSnl2OS.h:66
@ OS_AMPL_SUFFIX_DIRECTION_toAMPL
Definition OSnl2OS.h:65
@ OS_AMPL_SUFFIX_DIRECTION_toSolver
Definition OSnl2OS.h:64
@ OS_AMPL_SUFFIX_DIRECTION_local
Definition OSnl2OS.h:67
The in-memory representation of an OSiL instance..
The Option Class.
Definition OSOption.h:3565
The OSnLNode Class for nonlinear expressions.
Definition OSnLNode.h:180
The OSnl2OS Class.
Definition OSnl2OS.h:79
bool setASL(ASL *asl, ASL *rw, ASL *cw)
set the pointers to the three ASL objects
~OSnl2OS()
the OSnl2OS class destructor
Definition OSnl2OS.cpp:178
std::vector< std::string > op_type
Definition OSnl2OS.h:191
void setJobID(std::string jobID)
set the job ID
Definition OSnl2OS.cpp:104
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
ASL * cw
Pointers to AMPL data structures.
Definition OSnl2OS.h:207
ASL * getASL(std::string name)
return a pointer to an ASL object
Definition OSnl2OS.cpp:87
OSInstance * osinstance
osinstance is a pointer to the OSInstance object that gets created from the information in the nl fil...
Definition OSnl2OS.h:172
bool readNl(std::string stub)
read the nl file
Definition OSnl2OS.cpp:109
ASL * rw
Definition OSnl2OS.h:207
bool createOSObjects()
create an OSInstance and OSOption representation from the AMPL nl content (Some of the information in...
Definition OSnl2OS.cpp:504
std::vector< double > operand
Definition OSnl2OS.h:192
ograd * og
og is a pointer to the AMPL data structure holding the objective function coefficients
Definition OSnl2OS.h:200
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
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
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
int numkount
Definition OSnl2OS.h:193
void setOsol(std::string osol)
set the osol string
Definition OSnl2OS.cpp:99
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 constructor
Definition OSnl2OS.cpp:71
void setVar(OSInstance *osinstance, int lower, int upper, char vartype)
store a number of variables into an OSInstance object
Definition OSnl2OS.cpp:461
ASL * asl
Definition OSnl2OS.h:207
std::string stub
stub is the name of the file with the nl instance
Definition OSnl2OS.h:211
OSnLNode * walkTree(expr *e)
parse an nl tree structure holding a nonlinear expression
Definition OSnl2OS.cpp:206
Used to read an OSoL string.
Definition OSoLReader.h:38
OS_AMPL_SUFFIX_DIRECTION direction
Definition OSnl2OS.h:75
OS_AMPL_SUFFIX_SCOPE scope
Definition OSnl2OS.h:74
OS_AMPL_SUFFIX_TYPE type
Definition OSnl2OS.h:73
std::string name
Definition OSnl2OS.h:72