GamsNLinstr.h

Go to the documentation of this file.
00001 /* Copyright (C) 2008 GAMS Development and others
00002    All Rights Reserved.
00003    This code is published under the Common Public License.
00004 
00005    $Id: GamsNLinstr.h 462 2008-06-21 18:31:26Z stefan $
00006 
00007    Author: Stefan Vigerske
00008 
00009    WARNING:
00010    The NL instruction (codes, format, semantics, etc.) are subject to change.
00011    Thus, there is no warranty that a code based on this file is going to work fine
00012    after changes in the GAMS I/O libraries as provided by GAMS.
00013    GAMS is NOT obligated to issue a warning when it changes the NL instructions.
00014 */
00015 
00016 #ifndef GAMSNLINSTR_H_
00017 #define GAMSNLINSTR_H_
00018 
00019 #include "GAMSlinksConfig.h"
00020 
00021 #if defined(__cplusplus)
00022 extern "C" {
00023 #endif
00024 
00027 typedef enum GamsOpCode_ {
00028         nlNoOp     =  0, /* no operation */
00029         nlPushV    =  1, /* push variable */
00030         nlPushI    =  2, /* push immediate (constant) */
00031         nlStore    =  3, /* store row */
00032         nlAdd      =  4, /* add */
00033         nlAddV     =  5, /* add variable */
00034         nlAddI     =  6, /* add immediate */
00035         nlAddL     =  7, /* add local */
00036         nlSub      =  8, /* minus */
00037         nlSubV     =  9, /* subtract variable */
00038         nlSubI     = 10, /* subtract immediate */
00039         nlSubL     = 11, /* subtract local */
00040         nlMul      = 12, /* multiply */
00041         nlMulV     = 13, /* multiply variable */
00042         nlMulI     = 14, /* multiply immediate */
00043         nlMulL     = 15, /* multiply local */
00044         nlDiv      = 16, /* divide */
00045         nlDivV     = 17, /* divide variable */
00046         nlDivI     = 18, /* divide immediate */
00047         nlDivL     = 19, /* divide local */
00048         nlUMin     = 20, /* unary minus */
00049         nlUMinV    = 21, /* unary minus variable */
00050         nlSwap     = 22, /* swap two positions on stack top */
00051         nlPushL    = 23, /* push local */
00052         nlPopL     = 24, /* pop local */
00053         nlPopDeriv = 25, /* pop derivative */
00054         nlHeader   = 26, /* header */
00055         nlUMinL    = 27, /* push umin local */
00056         nlStoreS   = 28, /* store scaled row */
00057         nlPopDerivS= 29, /* store scaled gradient */
00058         nlEquScale = 30, /* equation scale */
00059         nlEnd      = 31, /* end of instruction list */
00060         nlCallArg1 = 32,
00061         nlCallArg2 = 33,
00062         nlCallArgN = 34,
00063         nlFuncArgN = 35,
00064         nlPushS    = 36,
00065         nlPopup    = 37,
00066         nlArg      = 38,
00067         nlMulIAdd  = 39,
00068         nlPushZero = 40,
00069         nlMulPop1  = 41,
00070         nlMulPop2  = 42,
00071         nlMulPop   = 43,
00072         nlAddPop   = 44, 
00073         nlSubPop   = 45, 
00074         nlGetConst = 46, 
00075         nlMulConst1= 47, 
00076         nlMulConst2= 48, 
00077         nlMulConst = 49, 
00078         nlNegLocal = 50, 
00079         nlGetLocal = 51, 
00080         nlSetLocal1= 52, 
00081         nlSetLocal2= 53, 
00082         nlSetLocal = 54, 
00083         nlGetGrad  = 55, 
00084         nlPushIGrad= 56, 
00085         nlChk      = 57, 
00086         nlAddO     = 58, 
00087         nlPushO    = 59,
00088         nlInvoc    = 60, 
00089         nlStackIn  = 61,
00090         MAXINS     = 62
00091 } GamsOpCode;
00092 
00095 extern const char* GamsOpCodeName[MAXINS];
00096 
00099 typedef enum GamsFuncCode_ {fnmapval=0,fnceil,fnfloor,fnround,
00100     fnmod,fntrunc,fnsign,fnmin,
00101     fnmax,fnsqr,fnexp,fnlog,
00102     fnlog10,fnsqrt,fnabs,fncos,
00103     fnsin,fnarctan,fnerrf,fndunfm,
00104     fndnorm,fnpower,fnjdate,fnjtime,
00105     fnjstart,fnjnow,fnerror,fngyear,
00106     fngmonth,fngday,fngdow,fngleap,
00107     fnghour,fngminute,fngsecond,
00108     fncurseed,fntimest,fntimeco,
00109     fntimeex,fntimecl,fnfrac,fnerrorl,
00110     fnheaps,fnfact,fnunfmi,fnpi,
00111     fnncpf,fnncpcm,fnentropy,fnsigmoid,
00112     fnlog2,fnboolnot,fnbooland,
00113     fnboolor,fnboolxor,fnboolimp,
00114     fnbooleqv,fnrelopeq,fnrelopgt,
00115     fnrelopge,fnreloplt,fnrelople,
00116     fnrelopne,fnifthen,fnrpower,
00117     fnedist,fndiv,fndiv0,fnsllog10,
00118     fnsqlog10,fnslexp,fnsqexp,fnslrec,
00119     fnsqrec,fncvpower,fnvcpower,
00120     fncentropy,fngmillisec,fnmaxerror,
00121     fntimeel,fngamma,fnloggamma,fnbeta,
00122     fnlogbeta,fngammareg,fnbetareg,
00123     fnsinh,fncosh,fntanh,fnmathlastrc,
00124     fnmathlastec,fnmathoval,fnsignpower,
00125     fnhandle,fnncpvusin,fnncpvupow,
00126     fnbinomial,fnrehandle,fngamsver,
00127     fndelhandle,fntan,fnarccos,
00128     fnarcsin,fnarctan2,fnsleep,fnheapf,
00129     fncohandle,fngamsrel,fnpoly,
00130     fnlicensestatus,fnlicenselevel,fnheaplimit,
00131     fndummy} GamsFuncCode;
00132 
00133 
00136 GamsOpCode getInstrOpCode(unsigned int instr);
00137 
00141 int getInstrAddress(unsigned int instr);
00142 
00145 void reorderInstr(unsigned int* instr, int num_instr);
00146 
00147 #if defined(__cplusplus)
00148 } /* extern "C" */
00149 #endif
00150 
00151 #endif /*GAMSNLINSTR_H_*/

Generated on Tue Dec 30 03:01:24 2008 for GAMSlinks by  doxygen 1.4.7