Detailed Description
Value type for collection expressions (lists).
Such a value is obtained with LSExpression::getCollectionValue(). It represents a reference to the value of a variable and the value of this variable is modified when the LSCollection object if modified.
- See Also
- LSModel
-
LSExpression
- Since
- 5.5
Constructor & Destructor Documentation
localsolver::LSCollection::~LSCollection |
( |
| ) |
|
|
inline |
localsolver::LSCollection::LSCollection |
( |
| ) |
|
|
inline |
localsolver::LSCollection::LSCollection |
( |
const LSCollection & |
other | ) |
|
|
inline |
Member Function Documentation
int localsolver::LSCollection::getIndex |
( |
| ) |
const |
|
inline |
Gets the index of the corresponding expression in the model.
- Returns
- Index in the model.
void localsolver::LSCollection::add |
( |
lsint |
val | ) |
|
|
inline |
Adds the given value to this collection.
Only allowed in state S_Modeling. This function will fail if the given value is outside of the range of the list or if this value is already included in this list (remind that a list cannot contain twice the same value.
- Parameters
-
val | The value to be added. |
void localsolver::LSCollection::clear |
( |
| ) |
|
|
inline |
Remove all values of this collection.
Only allowed in state S_Modeling.
lsint localsolver::LSCollection::count |
( |
| ) |
const |
|
inline |
Gets the number of values in the collection.
lsint localsolver::LSCollection::get |
( |
int |
position | ) |
const |
|
inline |
Gets the value at the given position.
- Parameters
-
position | The considered position (must be non negative and striclty smaller than the number of values in the collection). |
lsint localsolver::LSCollection::operator[] |
( |
int |
i | ) |
const |
|
inline |
operator overloading for get
std::string localsolver::LSCollection::toString |
( |
| ) |
const |
|
inline |
Returns a string representation of this expression.
This representation provides the index of the expression, its type, and its name (if any). Useful for debugging or logging purposes.
- Returns
- String representation.
bool localsolver::LSCollection::operator== |
( |
const LSCollection & |
other | ) |
|
|
inline |
bool localsolver::LSCollection::operator!= |
( |
const LSCollection & |
other | ) |
|
|
inline |