00001
00016 #ifndef OSNL2OS_H
00017 #define OSNL2OS_H
00018
00019
00020
00021 #include "OSOption.h"
00022 #include "OSInstance.h"
00023 #include "OSnLNode.h"
00024 #include "OSMathUtil.h"
00025 #include <string>
00026 #include <vector>
00027
00028
00043 struct ograd;
00044 struct cgrad;
00045 struct ASL;
00046 struct expr;
00047
00048 enum OS_AMPL_SUFFIX_TYPE
00049 {
00050 OS_AMPL_SUFFIX_TYPE_integer,
00051 OS_AMPL_SUFFIX_TYPE_double
00052 };
00053
00054 enum OS_AMPL_SUFFIX_SCOPE
00055 {
00056 OS_AMPL_SUFFIX_SCOPE_variables,
00057 OS_AMPL_SUFFIX_SCOPE_constraints,
00058 OS_AMPL_SUFFIX_SCOPE_objectives,
00059 OS_AMPL_SUFFIX_SCOPE_problems
00060 };
00061
00062 enum OS_AMPL_SUFFIX_DIRECTION
00063 {
00064 OS_AMPL_SUFFIX_DIRECTION_toSolver,
00065 OS_AMPL_SUFFIX_DIRECTION_toAMPL,
00066 OS_AMPL_SUFFIX_DIRECTION_both,
00067 OS_AMPL_SUFFIX_DIRECTION_local
00068 };
00069
00070 struct OS_AMPL_SUFFIX
00071 {
00072 std::string name;
00073 OS_AMPL_SUFFIX_TYPE type;
00074 OS_AMPL_SUFFIX_SCOPE scope;
00075 OS_AMPL_SUFFIX_DIRECTION direction;
00076 };
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 class OSnl2OS
00094 {
00095 public:
00097 OSnl2OS( std::string nlfilename, std::string osol);
00098
00100 ~OSnl2OS();
00101
00115 bool createOSObjects();
00116
00121 OSoLReader *osolreader;
00122
00128 OSnLNode* walkTree(expr *e);
00129
00133 OSInstance *osinstance;
00134
00138 OSOption *osoption;
00139
00144 std::string osol;
00145
00146 std::vector<std::string> op_type;
00147 std::vector<double> operand;
00148 int numkount;
00149
00150 private:
00151
00155 ograd *og;
00156
00162 ASL *asl, *cw, *rw;
00163
00166 std::string stub;
00167
00168 };
00169
00170 #endif