Internal Functions



Xpress-SLP provides a set of standard functions for use in formulae. Many are standard mathematical functions; there are a few which are intended for specialized applications.

The following is a list of all the Xpress-SLP internal functions:

ABS
Absolute value
ACT
Activity (left hand side) of a row
ARCCOS
Arc cosine trigonometric function
ARCSIN
Arc sine trigonometric function
ARCTAN
Arc tangent trigonometric function
COS
Cosine trigonometric function
DJ
Reduced cost (DJ) of a column
EQ
Equality test
EXP
Exponential function (e raised to the power)
GE
Greater than or equal test
GT
Greater than test
IAC
Gasoline blending interaction coefficients
IF
Zero/nonzero test
INTERP
General-purpose interpolation
LE
Less than or equal test
LN
Natural logarithm
LO
Lower bound of a column
LOG, LOG10
Logarithm to base 10
LT
Less than test
MATRIX
Current matrix entry
MAX
Maximum value of an arbitrary number of items
MIN
Minimum value of an arbitrary number of items
MV
Marginal value of a row
NE
Inequality test
NOT
Logical inversion
PARAM
Value of a numeric attribute or control
RHS
Right hand side of a row
RHSRANGE
Range (upper limit minus lower limit of the right side) of a row
SIN
Sine trigonometric function
SLACK
Slack activity of a row
SQRT
Square root
TAN
Tangent trigonometric function
UP
Upper bound of a column

Trigonometric functions

The trigonometric functions SIN, COS and TAN return the value corresponding to their argument in radians. SIN and COS are well-defined, continuous and differentiable for all values of their arguments; care must be exercised when using TAN because it is discontinuous.

The inverse trigonometric functions ARCSIN and ARCCOS are undefined for arguments outside the range -1 to +1 and special care is required to ensure that no attempt is made to evaluate them outside this range. Derivatives for the inverse trigonometric functions are always calculated numerically.

Other mathematical functions

Most of the mathematical functions are differentiable, although care should be taken in using analytic derivatives where the derivative is changing rapidly.

Logical functions

The logical functions all return 0 for "false" and 1 for "true". They are implemented so that complementary functions are never both true or both false.

For example:
exactly one of EQ(X,Y) and NE(X,Y) is true;
exactly one of LT(X,Y) and GE(X,Y) is true;
exactly one of IF(X) and NOT(X) is true;
if LE(X,Y) is true, then exactly one of LT(X,Y) and EQ(X,Y) is true.

Equality tests are carried out using the tolerances XSLP_EQTOL_A and XSLP_EQTOL_R. If
abs(X-Y) < XSLP_EQTOL_A or
abs(X-Y) < abs(X)*XSLP_EQTOL_R
then X and Y are regarded as equal.

Functions IF and NOT test for zero using tolerance XSLP_EQTOL_A.

Because of these tolerances, it is possible that EQ(X,Y) and EQ(Y,Z) are both true, but EQ(X,Z) is false. Where multiple tests of this type are being carried out, they should all test against the same value if possible.

Logical functions are not continuous or differentiable, and should be used with care in coefficients. Alternative modeling approaches should be used where possible.

Problem-related functions

The problem-related functions allow access to a limited range of problem and solution data. If they are used in formulae for coefficients they will be regarded as constants (their derivatives will be zero).

Row and column indices used as arguments to the functions always count from 1 and do not respect the value of XPRS_CSTYLE.

Specialized functions

The specialized functions are designed for use in particular applications, to reduce the need for custom-built user functions. Notes about their use will be found under the individual functions.



If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.