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 valueACT Activity (left hand side) of a rowARCCOS Arc cosine trigonometric functionARCSIN Arc sine trigonometric functionARCTAN Arc tangent trigonometric functionCOS Cosine trigonometric functionDJ Reduced cost (DJ) of a columnEQ Equality testEXP Exponential function (e raised to the power)GE Greater than or equal testGT Greater than testIAC Gasoline blending interaction coefficientsIF Zero/nonzero testINTERP General-purpose interpolationLE Less than or equal testLN Natural logarithmLO Lower bound of a columnLOG, LOG10 Logarithm to base 10LT Less than testMATRIX Current matrix entryMAX Maximum value of an arbitrary number of itemsMIN Minimum value of an arbitrary number of itemsMV Marginal value of a rowNE Inequality testNOT Logical inversionPARAM Value of a numeric attribute or controlRHS Right hand side of a rowRHSRANGE Range (upper limit minus lower limit of the right side) of a rowSIN Sine trigonometric functionSLACK Slack activity of a rowSQRT Square rootTAN Tangent trigonometric functionUP Upper bound of a columnTrigonometric 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.