GAMSlinks
0.4
Main Page
Classes
Files
File List
File Members
GAMSlinks
src
GamsIO
GamsNLinstr.h
Go to the documentation of this file.
1
/* Copyright (C) 2008 GAMS Development and others
2
All Rights Reserved.
3
This code is published under the Common Public License.
4
5
$Id: GamsNLinstr.h 462 2008-06-21 18:31:26Z stefan $
6
7
Author: Stefan Vigerske
8
9
WARNING:
10
The NL instruction (codes, format, semantics, etc.) are subject to change.
11
Thus, there is no warranty that a code based on this file is going to work fine
12
after changes in the GAMS I/O libraries as provided by GAMS.
13
GAMS is NOT obligated to issue a warning when it changes the NL instructions.
14
*/
15
16
#ifndef GAMSNLINSTR_H_
17
#define GAMSNLINSTR_H_
18
19
#include "
GAMSlinksConfig.h
"
20
21
#if defined(__cplusplus)
22
extern
"C"
{
23
#endif
24
27
typedef
enum
GamsOpCode_
{
28
nlNoOp
= 0,
/* no operation */
29
nlPushV
= 1,
/* push variable */
30
nlPushI
= 2,
/* push immediate (constant) */
31
nlStore
= 3,
/* store row */
32
nlAdd
= 4,
/* add */
33
nlAddV
= 5,
/* add variable */
34
nlAddI
= 6,
/* add immediate */
35
nlAddL
= 7,
/* add local */
36
nlSub
= 8,
/* minus */
37
nlSubV
= 9,
/* subtract variable */
38
nlSubI
= 10,
/* subtract immediate */
39
nlSubL
= 11,
/* subtract local */
40
nlMul
= 12,
/* multiply */
41
nlMulV
= 13,
/* multiply variable */
42
nlMulI
= 14,
/* multiply immediate */
43
nlMulL
= 15,
/* multiply local */
44
nlDiv
= 16,
/* divide */
45
nlDivV
= 17,
/* divide variable */
46
nlDivI
= 18,
/* divide immediate */
47
nlDivL
= 19,
/* divide local */
48
nlUMin
= 20,
/* unary minus */
49
nlUMinV
= 21,
/* unary minus variable */
50
nlSwap
= 22,
/* swap two positions on stack top */
51
nlPushL
= 23,
/* push local */
52
nlPopL
= 24,
/* pop local */
53
nlPopDeriv
= 25,
/* pop derivative */
54
nlHeader
= 26,
/* header */
55
nlUMinL
= 27,
/* push umin local */
56
nlStoreS
= 28,
/* store scaled row */
57
nlPopDerivS
= 29,
/* store scaled gradient */
58
nlEquScale
= 30,
/* equation scale */
59
nlEnd
= 31,
/* end of instruction list */
60
nlCallArg1
= 32,
61
nlCallArg2
= 33,
62
nlCallArgN
= 34,
63
nlFuncArgN
= 35,
64
nlPushS
= 36,
65
nlPopup
= 37,
66
nlArg
= 38,
67
nlMulIAdd
= 39,
68
nlPushZero
= 40,
69
nlMulPop1
= 41,
70
nlMulPop2
= 42,
71
nlMulPop
= 43,
72
nlAddPop
= 44,
73
nlSubPop
= 45,
74
nlGetConst
= 46,
75
nlMulConst1
= 47,
76
nlMulConst2
= 48,
77
nlMulConst
= 49,
78
nlNegLocal
= 50,
79
nlGetLocal
= 51,
80
nlSetLocal1
= 52,
81
nlSetLocal2
= 53,
82
nlSetLocal
= 54,
83
nlGetGrad
= 55,
84
nlPushIGrad
= 56,
85
nlChk
= 57,
86
nlAddO
= 58,
87
nlPushO
= 59,
88
nlInvoc
= 60,
89
nlStackIn
= 61,
90
MAXINS
= 62
91
}
GamsOpCode
;
92
95
extern
const
char
*
GamsOpCodeName
[
MAXINS
];
96
99
typedef
enum
GamsFuncCode_
{
fnmapval
=0,
fnceil
,
fnfloor
,
fnround
,
100
fnmod
,
fntrunc
,
fnsign
,
fnmin
,
101
fnmax
,
fnsqr
,
fnexp
,
fnlog
,
102
fnlog10
,
fnsqrt
,
fnabs
,
fncos
,
103
fnsin
,
fnarctan
,
fnerrf
,
fndunfm
,
104
fndnorm
,
fnpower
,
fnjdate
,
fnjtime
,
105
fnjstart
,
fnjnow
,
fnerror
,
fngyear
,
106
fngmonth
,
fngday
,
fngdow
,
fngleap
,
107
fnghour
,
fngminute
,
fngsecond
,
108
fncurseed
,
fntimest
,
fntimeco
,
109
fntimeex
,
fntimecl
,
fnfrac
,
fnerrorl
,
110
fnheaps
,
fnfact
,
fnunfmi
,
fnpi
,
111
fnncpf
,
fnncpcm
,
fnentropy
,
fnsigmoid
,
112
fnlog2
,
fnboolnot
,
fnbooland
,
113
fnboolor
,
fnboolxor
,
fnboolimp
,
114
fnbooleqv
,
fnrelopeq
,
fnrelopgt
,
115
fnrelopge
,
fnreloplt
,
fnrelople
,
116
fnrelopne
,
fnifthen
,
fnrpower
,
117
fnedist
,
fndiv
,
fndiv0
,
fnsllog10
,
118
fnsqlog10
,
fnslexp
,
fnsqexp
,
fnslrec
,
119
fnsqrec
,
fncvpower
,
fnvcpower
,
120
fncentropy
,
fngmillisec
,
fnmaxerror
,
121
fntimeel
,
fngamma
,
fnloggamma
,
fnbeta
,
122
fnlogbeta
,
fngammareg
,
fnbetareg
,
123
fnsinh
,
fncosh
,
fntanh
,
fnmathlastrc
,
124
fnmathlastec
,
fnmathoval
,
fnsignpower
,
125
fnhandle
,
fnncpvusin
,
fnncpvupow
,
126
fnbinomial
,
fnrehandle
,
fngamsver
,
127
fndelhandle
,
fntan
,
fnarccos
,
128
fnarcsin
,
fnarctan2
,
fnsleep
,
fnheapf
,
129
fncohandle
,
fngamsrel
,
fnpoly
,
130
fnlicensestatus
,
fnlicenselevel
,
fnheaplimit
,
131
fndummy
}
GamsFuncCode
;
132
133
136
GamsOpCode
getInstrOpCode
(
unsigned
int
instr);
137
141
int
getInstrAddress
(
unsigned
int
instr);
142
145
void
reorderInstr
(
unsigned
int
* instr,
int
num_instr);
146
147
#if defined(__cplusplus)
148
}
/* extern "C" */
149
#endif
150
151
#endif
/*GAMSNLINSTR_H_*/
nlPushS
Definition:
GamsNLinstr.h:64
nlGetGrad
Definition:
GamsNLinstr.h:83
getInstrAddress
int getInstrAddress(unsigned int instr)
Gives the address in a GAMS nonlinear instruction.
nlPushO
Definition:
GamsNLinstr.h:87
fnheaplimit
Definition:
GamsNLinstr.h:130
fnreloplt
Definition:
GamsNLinstr.h:115
nlAddPop
Definition:
GamsNLinstr.h:72
nlCallArgN
Definition:
GamsNLinstr.h:62
fngammareg
Definition:
GamsNLinstr.h:122
fngdow
Definition:
GamsNLinstr.h:106
fngamma
Definition:
GamsNLinstr.h:121
nlPushV
Definition:
GamsNLinstr.h:29
nlPushZero
Definition:
GamsNLinstr.h:68
fnsqr
Definition:
GamsNLinstr.h:101
fnheaps
Definition:
GamsNLinstr.h:110
GAMSlinksConfig.h
fndnorm
Definition:
GamsNLinstr.h:104
fnfact
Definition:
GamsNLinstr.h:110
fnslrec
Definition:
GamsNLinstr.h:118
fngamsver
Definition:
GamsNLinstr.h:126
fngleap
Definition:
GamsNLinstr.h:106
fnrelopne
Definition:
GamsNLinstr.h:116
nlSubI
Definition:
GamsNLinstr.h:38
GamsOpCode
enum GamsOpCode_ GamsOpCode
The opcodes of GAMS nonlinear expressions.
fnarccos
Definition:
GamsNLinstr.h:127
fnsqrec
Definition:
GamsNLinstr.h:119
fnslexp
Definition:
GamsNLinstr.h:118
getInstrOpCode
GamsOpCode getInstrOpCode(unsigned int instr)
Gives the opcode of a GAMS nonlinear instruction.
nlEnd
Definition:
GamsNLinstr.h:59
nlHeader
Definition:
GamsNLinstr.h:54
fngamsrel
Definition:
GamsNLinstr.h:129
fnboolimp
Definition:
GamsNLinstr.h:113
nlMulL
Definition:
GamsNLinstr.h:43
nlSetLocal
Definition:
GamsNLinstr.h:82
nlEquScale
Definition:
GamsNLinstr.h:58
nlMulConst2
Definition:
GamsNLinstr.h:76
fnsign
Definition:
GamsNLinstr.h:100
nlStoreS
Definition:
GamsNLinstr.h:56
fnedist
Definition:
GamsNLinstr.h:117
nlPopDeriv
Definition:
GamsNLinstr.h:53
fnround
Definition:
GamsNLinstr.h:99
nlCallArg2
Definition:
GamsNLinstr.h:61
fnjnow
Definition:
GamsNLinstr.h:105
nlSubV
Definition:
GamsNLinstr.h:37
fnexp
Definition:
GamsNLinstr.h:101
fnifthen
Definition:
GamsNLinstr.h:116
fnvcpower
Definition:
GamsNLinstr.h:119
nlInvoc
Definition:
GamsNLinstr.h:88
fncentropy
Definition:
GamsNLinstr.h:120
fnrelople
Definition:
GamsNLinstr.h:115
nlUMinV
Definition:
GamsNLinstr.h:49
nlUMinL
Definition:
GamsNLinstr.h:55
fnncpvupow
Definition:
GamsNLinstr.h:125
fnceil
Definition:
GamsNLinstr.h:99
nlAdd
Definition:
GamsNLinstr.h:32
fnjtime
Definition:
GamsNLinstr.h:104
fndunfm
Definition:
GamsNLinstr.h:103
nlDiv
Definition:
GamsNLinstr.h:44
fntan
Definition:
GamsNLinstr.h:127
fnerrf
Definition:
GamsNLinstr.h:103
fnpoly
Definition:
GamsNLinstr.h:129
nlAddI
Definition:
GamsNLinstr.h:34
nlStore
Definition:
GamsNLinstr.h:31
fngmonth
Definition:
GamsNLinstr.h:106
nlPushIGrad
Definition:
GamsNLinstr.h:84
fntimeel
Definition:
GamsNLinstr.h:121
nlPushL
Definition:
GamsNLinstr.h:51
nlMulConst1
Definition:
GamsNLinstr.h:75
fnbeta
Definition:
GamsNLinstr.h:121
fnerror
Definition:
GamsNLinstr.h:105
fnarcsin
Definition:
GamsNLinstr.h:128
fnmod
Definition:
GamsNLinstr.h:100
nlAddL
Definition:
GamsNLinstr.h:35
fnlicenselevel
Definition:
GamsNLinstr.h:130
nlDivL
Definition:
GamsNLinstr.h:47
nlStackIn
Definition:
GamsNLinstr.h:89
fnrehandle
Definition:
GamsNLinstr.h:126
nlCallArg1
Definition:
GamsNLinstr.h:60
GamsOpCode_
GamsOpCode_
The opcodes of GAMS nonlinear expressions.
Definition:
GamsNLinstr.h:27
fnlicensestatus
Definition:
GamsNLinstr.h:130
nlSwap
Definition:
GamsNLinstr.h:50
nlArg
Definition:
GamsNLinstr.h:66
nlSetLocal1
Definition:
GamsNLinstr.h:80
fnmathlastrc
Definition:
GamsNLinstr.h:123
fnabs
Definition:
GamsNLinstr.h:102
nlSub
Definition:
GamsNLinstr.h:36
fnsqexp
Definition:
GamsNLinstr.h:118
fnsqrt
Definition:
GamsNLinstr.h:102
nlMul
Definition:
GamsNLinstr.h:40
nlDivV
Definition:
GamsNLinstr.h:45
fnbinomial
Definition:
GamsNLinstr.h:126
nlNegLocal
Definition:
GamsNLinstr.h:78
nlMulPop2
Definition:
GamsNLinstr.h:70
fnncpvusin
Definition:
GamsNLinstr.h:125
nlPopup
Definition:
GamsNLinstr.h:65
fnheapf
Definition:
GamsNLinstr.h:128
fngyear
Definition:
GamsNLinstr.h:105
nlAddV
Definition:
GamsNLinstr.h:33
fnlogbeta
Definition:
GamsNLinstr.h:122
nlUMin
Definition:
GamsNLinstr.h:48
nlMulPop1
Definition:
GamsNLinstr.h:69
fnrelopeq
Definition:
GamsNLinstr.h:114
fnrelopgt
Definition:
GamsNLinstr.h:114
fntimeco
Definition:
GamsNLinstr.h:108
fnarctan
Definition:
GamsNLinstr.h:103
GamsFuncCode
enum GamsFuncCode_ GamsFuncCode
The codes of GAMS nonlinear functions.
fnrelopge
Definition:
GamsNLinstr.h:115
fnmax
Definition:
GamsNLinstr.h:101
fntimeex
Definition:
GamsNLinstr.h:109
nlSubPop
Definition:
GamsNLinstr.h:73
fngday
Definition:
GamsNLinstr.h:106
fnentropy
Definition:
GamsNLinstr.h:111
fndiv0
Definition:
GamsNLinstr.h:117
fngmillisec
Definition:
GamsNLinstr.h:120
fnlog2
Definition:
GamsNLinstr.h:112
fnhandle
Definition:
GamsNLinstr.h:125
nlDivI
Definition:
GamsNLinstr.h:46
nlSetLocal2
Definition:
GamsNLinstr.h:81
fnarctan2
Definition:
GamsNLinstr.h:128
fnsleep
Definition:
GamsNLinstr.h:128
nlMulPop
Definition:
GamsNLinstr.h:71
fnmapval
Definition:
GamsNLinstr.h:99
nlNoOp
Definition:
GamsNLinstr.h:28
fncvpower
Definition:
GamsNLinstr.h:119
fnsllog10
Definition:
GamsNLinstr.h:117
fnbetareg
Definition:
GamsNLinstr.h:122
fnsinh
Definition:
GamsNLinstr.h:123
fnloggamma
Definition:
GamsNLinstr.h:121
fncos
Definition:
GamsNLinstr.h:102
fncohandle
Definition:
GamsNLinstr.h:129
fnjstart
Definition:
GamsNLinstr.h:105
fndelhandle
Definition:
GamsNLinstr.h:127
nlPushI
Definition:
GamsNLinstr.h:30
fnlog10
Definition:
GamsNLinstr.h:102
fnpi
Definition:
GamsNLinstr.h:110
fnbooleqv
Definition:
GamsNLinstr.h:114
fnmathoval
Definition:
GamsNLinstr.h:124
fnsqlog10
Definition:
GamsNLinstr.h:118
reorderInstr
void reorderInstr(unsigned int *instr, int num_instr)
Reorders instructions such that they do not contain PushS, Popup, or Swap anymore.
nlGetLocal
Definition:
GamsNLinstr.h:79
fnfrac
Definition:
GamsNLinstr.h:109
GamsOpCodeName
const char * GamsOpCodeName[MAXINS]
Names of GAMS nonlinear expressions for printing.
fnmaxerror
Definition:
GamsNLinstr.h:120
fnpower
Definition:
GamsNLinstr.h:104
fnbooland
Definition:
GamsNLinstr.h:112
nlGetConst
Definition:
GamsNLinstr.h:74
nlSubL
Definition:
GamsNLinstr.h:39
fntanh
Definition:
GamsNLinstr.h:123
fnfloor
Definition:
GamsNLinstr.h:99
fnboolxor
Definition:
GamsNLinstr.h:113
fncurseed
Definition:
GamsNLinstr.h:108
nlChk
Definition:
GamsNLinstr.h:85
fnerrorl
Definition:
GamsNLinstr.h:109
fntrunc
Definition:
GamsNLinstr.h:100
GamsFuncCode_
GamsFuncCode_
The codes of GAMS nonlinear functions.
Definition:
GamsNLinstr.h:99
fnmin
Definition:
GamsNLinstr.h:100
nlMulI
Definition:
GamsNLinstr.h:42
fnboolnot
Definition:
GamsNLinstr.h:112
fngminute
Definition:
GamsNLinstr.h:107
fnncpf
Definition:
GamsNLinstr.h:111
nlAddO
Definition:
GamsNLinstr.h:86
fncosh
Definition:
GamsNLinstr.h:123
fngsecond
Definition:
GamsNLinstr.h:107
fnncpcm
Definition:
GamsNLinstr.h:111
fnghour
Definition:
GamsNLinstr.h:107
nlMulIAdd
Definition:
GamsNLinstr.h:67
fndummy
Definition:
GamsNLinstr.h:131
fnsigmoid
Definition:
GamsNLinstr.h:111
fntimest
Definition:
GamsNLinstr.h:108
fndiv
Definition:
GamsNLinstr.h:117
nlPopDerivS
Definition:
GamsNLinstr.h:57
fntimecl
Definition:
GamsNLinstr.h:109
fnsignpower
Definition:
GamsNLinstr.h:124
fnsin
Definition:
GamsNLinstr.h:103
fnunfmi
Definition:
GamsNLinstr.h:110
fnboolor
Definition:
GamsNLinstr.h:113
fnrpower
Definition:
GamsNLinstr.h:116
fnlog
Definition:
GamsNLinstr.h:101
nlPopL
Definition:
GamsNLinstr.h:52
MAXINS
Definition:
GamsNLinstr.h:90
nlMulConst
Definition:
GamsNLinstr.h:77
nlMulV
Definition:
GamsNLinstr.h:41
nlFuncArgN
Definition:
GamsNLinstr.h:63
fnmathlastec
Definition:
GamsNLinstr.h:124
fnjdate
Definition:
GamsNLinstr.h:104
Generated by
1.8.5