Initializing help system before first use

problem.loadcoefs

problem.loadcoefs


Purpose
Load non-linear coefficients into the SLP problem
Synopsis
problem.loadcoefs(rowindex, colindex, factor, fstart, parsed, type, value)
Arguments
rowindex 
Integer array holding index of row for the coefficient.
colindex 
Integer array holding index of column for the coefficient.
factor 
Double array holding factor by which formula is scaled. If this is None, then a value of 1.0 will be used.
fstart 
Integer array holding the start position in the arrays Type and Value of the formula for the coefficients. FormulaStart[nSLPCoef] should be set to the next position after the end of the last formula.
parsed 
Integer indicating whether the token arrays are formatted as internal unparsed ( Parsed=0) or internal parsed reverse Polish ( Parsed=1).
type 
Array of token types providing the formula for each coefficient.
value 
Array of values corresponding to the types in Type.
Example
Assume that the rows and columns of Prob are named Row1, Row2 ..., Col1, Col2 ... The following example loads coefficients representing:
Col2 * Col3 + Col6 * Col2 ˆ2 into Row1 and
Col2 ˆ 2 into Row3.
rowindex = [Row1,Row1,Row3]
colindex = [Col2,Col6,Col2]

formulastart = []

n = 0
ncoef = 0

formulastart[ncoef], ncoef = n, ncoef + 1
Type[n], Value[n], n = xslp_op_col, 3, n+1
Type[n],           n = xslp_op_eof,    n+1


formulastart[ncoef], ncoef = n, ncoef + 1

Type[n], Value[n], n = xslp_op_col, 2,             n+1
Type[n], Value[n], n = xslp_op_col, 2,             n+1
Type[n], Value[n], n = xslp_op_op,  xslp_MULTIPLY, n+1
Type[n],           n = xslp_op_eof,                n+1

formulastart[ncoef], ncoef = n, ncoef + 1

Type[n], Value[n], n = xslp_op_col, 2, n+1
Type[n],           n = xslp_op_eof,    n+1

formulastart[ncoef] = n

p.loadcoefs(rowindex, colindex, None, formulastart, 1, Type, Value)

The first coefficient in Row1 is in Col2 and has the formula Col3, so it represents Col2 * Col3.

The second coefficient in Row1 is in Col6 and has the formula Col2 * Col2 so it represents Col6 * Col2 ˆ2. The formulae are described as parsed (parsed=1), so the formula is written as
Col2 Col2 *
rather than the unparsed form
Col2 * Col2

The last coefficient, in Row3, is in Col2 and has the formula Col2, so it represents Col2 * Col2.


Further information

The jth coefficient is made up of two parts: Factor and Formula. Factor is a constant multiplier, which can be provided in the Factor array. If Xpress Nonlinear can identify a constant factor in Formula, then it will use that as well, to minimize the size of the formula which has to be calculated. Formula is made up of a list of tokens in Type and Value starting at FormulaStart[j]. The tokens follow the rules for parsed or unparsed formulae as indicated by the setting of Parsed. The formula must be terminated with an xslp_op_eof token. If several coefficients share the same formula, they can have the same value in FormulaStart. For possible token types and values see the chapter on "Formula Parsing".

The loadcoefs function loads items into the SLP problem. Any existing items of the same type are deleted first. The corresponding addcoefs function adds or replace items leaving other items of the same type unchanged.


Related topics

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.