XSLPchgformulatext
XSLPchgformulatext |
Purpose
Add or replace a single matrix formula using a character string for the formula..
Synopsis
int XPRS_CC XSLPchgformulatext(XSLPprob Prob, int RowIndex, char *Formula);
Arguments
Prob
|
The current SLP problem.
|
RowIndex
|
The index of the matrix row for the coefficient.
|
Formula
|
Character string holding the formula with the tokens separated by spaces.
|
Example
Assuming that the columns of the matrix are named
Col1,
Col2, etc, the following example puts the formula
sin(Col1) into row 1.
char *Formula="sin ( Col1 )"; XSLPchgformulatext(Prob, 1, Formula);
Note that all the tokens in the formula (including mathematical operators and separators) are separated by one or more spaces.
Further information
If the coefficient already exists as a constant or formula, it will be changed into the new coefficient. If it does not exist, it will be added to the problem.
This function can only be used if all the operands in the formula can be correctly identified as constants, existing columns, character variables or functions. Therefore, if a formula refers to a new column, that new item must be added to the Xpress NonLinear problem first.
Related topics
XSLPgetformulatext,
XSLPaddformulas,
XSLPchgformulatext,
XSLPchgformula,
XSLPloadformulas,
XSLPgetformularows,
XSLPgetformula,
XSLPdelformulas