XPRSaddrows, XPRSaddrows64
XPRSaddrows, XPRSaddrows64 |
Purpose
Synopsis
int XPRS_CC XPRSaddrows(XPRSprob prob, int newrow, int newnz, const char qrtype[], const double rhs[], const double range[], const int mstart[], const int mclind[], const double dmatval[]);
int XPRS_CC XPRSaddrows64(XPRSprob prob, int newrow, XPRSint64 newnz, const char qrtype[], const double rhs[], const double range[], const XPRSint64 mstart[], const int mclind[], const double dmatval[]);
Arguments
prob
|
The current problem.
|
||||||||||
newrow
|
Number of new rows.
|
||||||||||
newnz
|
Number of new nonzeros in the added rows.
|
||||||||||
qrtype
|
Character array of length newrow containing the row types:
|
||||||||||
rhs
|
Double array of length
newrow containing the right hand side elements.
|
||||||||||
range
|
Double array of length
newrow containing the row range elements. This may be
NULL if there are no ranged constraints. The values in the
range array will only be read for
R type rows. The entries for other type rows will be ignored.
|
||||||||||
mstart
|
Integer array of length
newrow containing the offsets in the
mclind and
dmatval arrays of the start of the elements for each row.
|
||||||||||
mclind
|
Integer array of length
newnz containing the (contiguous) column indices for the elements in each row.
|
||||||||||
dmatval
|
Double array of length
newnz containing the (contiguous) element values.
|
Related controls
Integer
Double
Number of extra matrix elements to be allowed for.
|
|
Number of extra rows to be allowed for.
|
Double
Tolerance on matrix elements.
|
Example
Suppose the current problem is:
Then the following adds the row 8x + 9y + 10z ≤ 25 to the problem and names it
NewRow:
maximize: | 2x + y + 3z | ||
subject to: | x + 4y + 2z | ≤ | 24 |
y + z | ≤ | 5 | |
3x + y | ≤ | 20 | |
x + y + 3z | ≤ | 9 |
qrtype[0] = 'L'; rhs[0] = 25.0; mstart[] = {0}; mclind[] = {0, 1, 2}; dmatval[] = {8.0, 9.0, 10.0}; ... XPRSaddrows(prob,1,3,qrtype,rhs,NULL,mstart,mclind, dmatval); XPRSaddnames(prob,1,"NewRow",4,4);
Further information
Range rows are automatically converted to type
L, with an upper bound in the slack. This must be taken into consideration, when retrieving row type, right–hand side values or range information for rows.
Related topics