XPRBindexSet
XPRBindexSet |
XPRBindexSet
|
|||
Synopsis
|
XPRBindexSet();
XPRBindexSet(xbidxset *iset); |
||
Argument
|
|
||
Description
|
Create a new index set object.
|
||
|
addElement
|
|||
Synopsis
|
int addElement(const char *text);
|
||
Argument
|
|
||
Return value
|
Sequence number of the index within the set, -1 in case of an error.
|
||
Description
|
This method adds an index entry to an index set. The new element is only added to the set if no identical index already exists. Both in the case of a new index entry and an existing one, the method returns the sequence number of the index in the index set. Note that the numbering of index elements starts with
0.
|
||
Example
|
The following example shows how to add an element to an index set and then retrieve its index and its name, (a) using the corresponding functions and (b) using the overloaded operators of this class.
XPRBprob prob("myprob"); XPRBindexSet ISet; int ind; ISet = prob.newIndexSet("IS"); ind = ISet.addElement("a"); cout << "First element: " << ISet.getIndexName(ind); cout << ", index of 'a': " << ISet.getIndex("a") << endl; ISet += "b"; // Add a second element cout << "Element 1: " << ISet[1]; cout << ", index of 'b': " << ISet["b"] << endl; |
||
Related topics
|
Calls
XPRBaddidxel
|
||
getCRef
|
|||
Synopsis
|
xbidxset *getCRef();
|
||
Return value
|
The underlying modeling object in BCL C.
|
||
Description
|
This method returns the index set object in BCL C that belongs to the C++ index set object.
|
||
getIndex
|
|||
Synopsis
|
int getIndex(const char *text);
|
||
Argument
|
|
||
Return value
|
Sequence number of the index in the set, or -1 if not contained.
|
||
Description
|
|||
Example
|
|||
Related topics
|
Calls
XPRBgetidxel
|
||
getIndexName
|
|||
Synopsis
|
const char *getIndexName(int i);
|
||
Argument
|
|
||
Return value
|
Name of the i
th element in the set if function executed successfully,
NULL otherwise.
|
||
Description
|
|||
Example
|
|||
Related topics
|
Calls
XPRBgetidxelname
|
||
getName
|
|||
Synopsis
|
const char *getName();
|
||
Return value
|
Name of the index set if function executed successfully,
NULL otherwise.
|
||
Description
|
|||
Example
|
See
XPRBindexSet.getSize.
|
||
Related topics
|
Calls
XPRBgetidxsetname
|
||
getSize
|
|||
Synopsis
|
int getSize();
|
||
Return value
|
Size (= number of elements) of the set, -1 in case of an error.
|
||
Description
|
This function returns the current number of elements in an index set. This value does not necessarily correspond to the size specified at the creation of the set. The returned value may be smaller if fewer elements than the originally reserved number have been added, or larger if more elements have been added. (In the latter case, the size of the set is automatically increased.)
|
||
Example
|
This example displays the name, size, and complete contents of an index set.
XPRBprob prob("myprob"); XPRBindexSet ISet; ISet = prob.newIndexSet("IS"); cout << ISet.getName() << " size: " << ISet.getSize() << endl; ISet.print(); |
||
Related topics
|
Calls
XPRBgetidxsetsize
|
||
isValid
|
|||
Synopsis
|
bool isValid();
|
||
Return value
|
true if object is valid,
false otherwise.
|
||
Description
|
This method checks whether the index set object is correctly defined. It should always be used to test the result returned by
XPRBprob.getIndexSetByName.
|
||
Example
|
|||
print
|
|||
Synopsis
|
int print();
|
||
Return value
|
0 if function executed successfully, 1 otherwise.
|
||
Description
|
|||
Example
|
See
XPRBindexSet.getSize.
|
||
Related topics
|
Calls
XPRBprintidxset
|
||
reset
|
|||
Synopsis
|
void reset();
|
||
Description
|
|||
|
© 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.