LocalSolver logo
is now
Hexaly logo

We're excited to share that we are moving forward. We're leaving behind the LocalSolver brand and transitioning to our new identity: Hexaly. This represents a leap forward in our mission to enable every organization to make better decisions faster when faced with operational and strategic challenges.


LSInterval Class

class LSInterval

Value type for interval expressions. Such value is obtained with LSExpression::getIntervalValue() or LSSolution::getIntervalValue().

See:

LSSolution

See:

LSExpression

Since:

12.0

Summary

Functions

isVoid

Returns true if the interval is void.

isDegenerate

Returns true if the interval is degenerate.

getStart

Returns the start of the interval.

getEnd

Returns the end of the interval.

count

Returns the number of elements in the interval.

contains

Returns true if the interval contains the given value, false otherwise.

toString

Returns a string representation of the interval.

Functions

bool LSInterval::isVoid()

Returns true if the interval is void. A void interval is an empty interval with no valid start or end bounds.

Returns:

True if the interval is void.

bool LSInterval::isDegenerate()

Returns true if the interval is degenerate. A degenerate interval is an interval with equal start and end bounds. It does not contain any element however.

Returns:

True if the interval is degenerate.

lsint LSInterval::getStart()

Returns the start of the interval. Cannot be called on a void interval as it does not have a valid start.

Returns:

Start of the interval.

lsint LSInterval::getEnd()

Returns the end of the interval. Cannot be called on a void interval as it does not have a valid end.

Returns:

End of the interval.

lsint LSInterval::count() const

Returns the number of elements in the interval. A void or degenerate interval does not contain any element.

Returns:

Number of elements in the interval.

bool LSInterval::contains(lsint value) const

Returns true if the interval contains the given value, false otherwise.

Parameters:

value – element whose presence in this interval is to be tested.

Returns:

True if the interval contains the value.

std::string LSInterval::toString() const

Returns a string representation of the interval.

Returns:

String representation.