XPRBsetdictionarysize
XPRBsetdictionarysize |
Purpose
Synopsis
int XPRBsetdictionarysize(XPRBprob prob, int dict, int size)
Arguments
prob
|
Reference to a problem.
|
||||
dict
|
Choice of the dictionary. Possible values:
|
||||
size
|
Non-negative value, preferrably a prime number; 0 disables the dictionary (for names dictionary only).
|
Return value
0 if function executed successfully, 1 otherwise.
Example
Switch off the names dictionary:
XPRBprob expl2; expl2 = XPRBnewprob("example2"); XPRBsetdictionarysize(expl2, XPRB_DICT_NAMES, 0);
Further information
1. This function sets the size of the hash table of the names or indices dictionaries of the given problem. It can only be called immediately after the creation of the corresponding problem.
2. The
names dictionary serves for storing and accessing the names of all modeling objects (variables, arrays of variables, constraints, SOS, index sets). Once it has been disabled it cannot be enabled any more. All methods relative to the names cannot be used if this dictionary has been disabled and BCL will not generate any unique names at the creation of model objects. If this dictionary is enabled (default setting) BCL automatically resizes this dictionary to a suitable size for your problem. If nevertheless you wish to set the size by yourself we recommend to choose a value close to the number of variables+constraints in your problem.
3. The
indices dictionary serves for storing all index set elements. The indices dictionary cannot be disabled, it is created automatically once an index set element is defined.
Related topics