Initializing help system before first use

XPRSloadlp, XPRSloadlp64

Purpose
Enables the user to pass a matrix directly to the Optimizer, rather than reading the matrix from a file.
Topic areas
Synopsis
int XPRS_CC XPRSloadlp(XPRSprob prob, const char *probname, int ncols, int nrows, const char rowtype[], const double rhs[], const double rng[], const double objcoef[], const int start[], const int collen[], const int rowind[], const double rowcoef[], const double lb[], const double ub[]);

int XPRS_CC XPRSloadlp64(XPRSprob prob, const char *probname, int ncols, int nrows, const char rowtype[], const double rhs[], const double rng[], const double objcoef[], const XPRSint64 start[], const int collen[], const int rowind[], const double rowcoef[], const double lb[], const double ub[]);
Arguments
prob 
The current problem.
probname 
A string of up to MAXPROBNAMELENGTH characters containing a names for the problem.
ncols 
Number of structural columns in the matrix.
nrows 
Number of rows in the matrix (not including the objective). Objective coefficients must be supplied in the objcoef array, and the objective function should not be included in any of the other arrays.
rowtype 
Character array of length nrows containing the row types:
indicates a ≤ constraint;
indicates an = constraint;
indicates a ≥ constraint;
indicates a range constraint;
indicates a nonbinding constraint.
rhs 
Double array of length nrows containing the right hand side coefficients of the rows. The right hand side value for a range row gives the upper bound on the row.
rng 
Double array of length nrows containing the range values for range rows. Values for all other rows will be ignored. May be NULL if not required. 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.
objcoef 
Double array of length ncols containing the objective function coefficients. This can be NULL to set all objective coefficients to 0 (zero).
start 
Integer array containing the offsets in the rowind and rowcoef arrays of the start of the elements for each column. This array is of length ncols or, if collen is NULL, length ncols+1. If collen is NULL, the extra entry of start, start[ncols], contains the position in the rowind and rowcoef arrays at which an extra column would start, if it were present. In C, this value is also the length of the rowind and rowcoef arrays.
collen 
Integer array of length ncols containing the number of nonzero elements in each column. May be NULL if not required. This array is not required if the non-zero coefficients in the rowind and rowcoef arrays are continuous, and the start array has ncols+1 entries as described above.
rowind 
Integer array containing the row indices for the nonzero elements in each column. If the indices are input contiguously, with the columns in ascending order, the length of the rowind is start[ncols-1]+collen[ncols-1] or, if collen is NULL, start[ncols].
rowcoef 
Double array containing the nonzero element values; length as for rowind.
lb 
Double array of length ncols containing the lower bounds on the columns. Use XPRS_MINUSINFINITY to represent a lower bound of minus infinity. If this is NULL then all lower bounds are 0 (zero).
ub 
Double array of length ncols containing the upper bounds on the columns. Use XPRS_PLUSINFINITY to represent an upper bound of plus infinity. It this is NULL then all upper bounds are infinite.
Related controls
Integer
Number of extra columns to be allowed for.
Number of extra matrix elements to be allowed for.
Number of extra rows to be allowed for.
Status for nonbinding rows.
Type of scaling.

Double
Tolerance on matrix elements.

Example
Given an LP problem:

minimize: x + y
subject to: 2x 3
x + 2y 3
x + y 1

the following shows how this may be loaded into the Optimizer using XPRSloadlp:
char probname[] = "small";
int ncols = 2, nrows = 3;
char rowtype[]    = {'G','G','G'};
double rhs[]     = { 3 , 3 , 1 };
double objcoef[]     = { 1 , 1 };
int start[]     = { 0 , 3 , 5 };
int rowind[]     = { 0 , 1 , 2 , 1 , 2 };
double rowcoef[] = { 2 , 1 , 1 , 2 , 1 };
double lb[]   = { 0 , 0 };
double ub[]   = {XPRS_PLUSINFINITY,XPRS_PLUSINFINITY};

XPRSloadlp(prob, probname, ncols, nrows, rowtype, rhs, NULL,
           objcoef, start, NULL, rowind, rowcoef, lb, ub)
Further information
1. The row and column indices follow the usual C convention of going from 0 to nrows-1 and 0 to ncols-1 respectively.
2. The double constants XPRS_PLUSINFINITY and XPRS_MINUSINFINITY are defined in the Optimizer library header file.
3. For a range constraint, the value in the rhs array specifies the upper bound on the constraint, while the value in the rng array specifies the range on the constraint. So a range constraint j is interpreted as:

\[ rhs_j -|rng_j | \leq \sum_i a_{ij} x_i \leq rhs_j \]
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.