Nonlinear Operation Codes#
Nonlinear expressions are built as a tree of operations, each with an
associated operation code (opcode). Each opcode has both a name and
an integer value. Our programming language APIs provide predefined
constants for all of these, which we recommend you use. These
constants are accessed by prepending a fixed prefix (which varies
slightly by language) to the opcode name. To access the SQRT
operation code (to define the square root function) from our various
APIs, for example, you would use the following:
Language |
Operation Code |
---|---|
C |
|
C++ |
|
Java |
|
.NET |
|
Python [1] |
|
The following table lists the available operation codes:
Opcode name |
Value |
Arity |
Data |
---|---|---|---|
|
0 |
n/a |
value of constant |
|
1 |
n/a |
index of variable (or variable object) |
|
2 |
n-ary |
\(-1.0\) |
|
3 |
binary |
\(-1.0\) |
|
4 |
n-ary |
\(-1.0\) |
|
5 |
binary |
\(-1.0\) |
|
6 |
unary |
\(-1.0\) |
|
7 |
unary |
\(-1.0\) |
|
8 |
unary |
\(-1.0\) |
|
9 |
unary |
\(-1.0\) |
|
10 |
unary |
\(-1.0\) |
|
11 |
unary |
\(-1.0\) |
|
12 |
binary |
\(-1.0\) |
|
13 |
unary |
\(-1.0\) |
|
14 |
unary |
\(-1.0\) |
|
15 |
unary |
\(-1.0\) |
|
16 |
unary |
\(-1.0\) |
|
17 |
unary |
\(-1.0\) |
These operation codes will also appear in MPS and LP files (using the names from the table above).
See our section Operation Codes for a detailed description of each operation code.