Initializing help system before first use

XPRSaddrows, XPRSaddrows64

Purpose
Adds rows to the optimizer matrix.
Topic area
Synopsis
int XPRS_CC XPRSaddrows(XPRSprob prob, int nrows, int ncoefs, const char rowtype[], const double rhs[], const double rng[], const int start[], const int colind[], const double rowcoef[]);

int XPRS_CC XPRSaddrows64(XPRSprob prob, int nrows, XPRSint64 ncoefs, const char rowtype[], const double rhs[], const double rng[], const XPRSint64 start[], const int colind[], const double rowcoef[]);
Arguments
prob 
The current problem.
nrows 
Number of new rows.
ncoefs 
Number of new nonzeros in the added rows.
rowtype 
Character array of length nrows containing the row types:
indicates a ≤ row;
indicates ≥ row;
indicates an = row.
indicates a range constraint;
indicates a nonbinding constraint.
rhs 
Double array of length nrows containing the right hand side elements.
rng 
Double array of length nrows containing the row range elements. This may be NULL if there are no ranged constraints. The values in the rng array will only be read for R type rows. The entries for other type rows will be ignored. The lower bound on a range row is the right hand side value minus the range value. The sign of the range value is ignored - the absolute value is used in all cases.
start 
Integer array of length nrows containing the offsets in the colind and rowcoef arrays of the start of the elements for each row.
colind 
Integer array of length ncoefs containing the (contiguous) column indices for the elements in each row.
rowcoef 
Double array of length ncoefs containing the (contiguous) element values.
Related controls
Integer
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:

maximize: 2x + y + 3z
subject to: x + 4y + 2z 24
y + z 5
3x + y 20
x + y + 3z 9

Then the following adds the row 8x + 9y + 10z ≤ 25 to the problem and names it NewRow:
rowtype[0] = 'L';
rhs[0] = 25.0;
start[] = {0};
colind[] = {0, 1, 2};
rowcoef[] = {8.0, 9.0, 10.0};
...
XPRSaddrows(prob,1,3,rowtype,rhs,NULL,start,colind, rowcoef);
XPRSaddnames(prob,XPRS_NAMES_ROW,"NewRow",4,4);
Further information
1. 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.
2. This function cannot be called while the current problem is being solved or when it is in an interrupted state. Use XPRSpostsolve to restore the problem to a non-solving state.
Related topics

© 2001-2025 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.