Initializing help system before first use

XPRBnewvar

XPRBnewvar


Purpose
Declare a single variable.
Synopsis
XPRBvar XPRBnewvar(XPRBprob prob, int type, const char *name, double bdl, double bdu);
Arguments
prob 
Reference to a problem.
type 
The variable type, which may be one of:
XPRB_PL 
continuous;
XPRB_BV 
binary;
XPRB_UI 
general integer;
XPRB_PI 
partial integer;
XPRB_SC 
semi-continuous;
XPRB_SI 
semi-continuous integer.
name 
The variable name (of unlimited length). May be NULL if not required.
bdl 
The variable's lower bound.
bdu 
The variable's upper bound.
Return value
Reference to the new variable if function executed successfully, NULL otherwise.
Example
XPRBprob prob;
XPRBvar x1, x2;
 ...
x1 = XPRBnewvar(prob, XPRB_UI, "abc3", 1, 100);
x2 = XPRBnewvar(prob, XPRB_SC, "klm2", 0, 20);
This defines an integer variable x1, taking values between 1 and 100, with the name abc3, and a semi-continuous variable x2, taking the value 0 or values between 1 and 20, with the name klm2.
Further information
1. The creation of a variable in BCL involves not only its name but also its type and bounds (which may be infinite, defined by the corresponding Xpress constants). The function returns the BCL reference to the variable ( i.e. a model variable). If the indicated name is already in use, BCL adds an index to it. If no variable name is given, BCL generates a default name starting with VAR. (The generation of unique names will only take place if the names dictionary is enabled, see XPRBsetdictionarysize.) If a partial integer, semi-continuous, or semi-continuous integer variable is being created, the integer or semi-continuous limit ( i.e. the lower bound of the continuous part for partial integer and semi-continuous, and of the semi-continuous integer part for semi-continuous integer) is set to the maximum of 1 and bdl. This value can be subsequently modified with the function XPRBsetlim.
2. The lower and upper bounds may take values of -XPRB_INFINITY and XPRB_INFINITY for minus and plus infinity respectively.
Related topics

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