HxInterval Class

class Hexaly.Optimizer.HxInterval

Value type for interval expressions. Such value is obtained with HxExpression::GetIntervalValue() or HxSolution::GetIntervalValue().

Since:

12.0

See:

HxSolution

See:

HxExpression

Summary

Methods

IsPresent

Returns true if the interval is present (non-void).

IsVoid

Returns true if the interval is void.

IsDegenerate

Returns true if the interval is degenerate.

Start

Returns the start of the interval.

End

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.

GetEnumerator

Gets the enumerator for the content of this interval.

ToString

Returns a string representation of the interval.

Instance methods

HxInterval()

Constructor of HxInterval. Returns a void interval.

Returns:

Void interval.

Return type:

HxInterval

HxInterval(long value)

Constructor of HxInterval. Returns a degenerate interval of value [value, value).

Arguments:

value – Start and end of the interval.

Returns:

Degenerate interval.

Return type:

HxInterval

HxInterval(long start, long end)

Constructor of HxInterval. Returns an interval of value [start, end). End must be greater (or equal) than start.

Arguments:
  • start – Start of the interval.

  • end – End of the interval.

Returns:

Degenerate interval.

Return type:

HxInterval

bool IsPresent()

Returns true if the interval is present (non-void). A void interval is an empty interval with no valid start or end bounds.

Returns:

True if the interval is present.

Return type:

bool

bool 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.

Return type:

bool

bool 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.

Return type:

bool

long Start()

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.

Return type:

long

long End()

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.

Return type:

long

long Count()

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.

Return type:

long

bool Contains(long value)

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

Arguments:

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

Returns:

True if the interval contains the value.

Return type:

bool

IEnumerator<long> GetEnumerator()
IEnumerator GetEnumerator()

Gets the enumerator for the content of this interval.

string ToString()

Returns a string representation of the interval.

Returns:

String representation.

Return type:

string