IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Represents an interval on the integers. More...
Public Member Functions | |
DiscreteInterval (int a, int b) | |
bool | Equals (DiscreteInterval other) |
Determines if the given discrete intervals equals the current discrete interval. More... | |
override bool | Equals (object obj) |
Determines if the given object equals the current discrete interval. More... | |
override int | GetHashCode () |
Returns a hash value for the current discrete interval. More... | |
Static Public Member Functions | |
static implicit | operator Interval (DiscreteInterval i) |
Converts a discrete interval to a continuous interval. More... | |
static bool | operator== (DiscreteInterval interval1, DiscreteInterval interval2) |
Determines if the given discrete intervals are equal. More... | |
static bool | operator!= (DiscreteInterval interval1, DiscreteInterval interval2) |
Determines if the given discrete intervals are unequal. More... | |
Public Attributes | |
int | a |
int | b |
Properties | |
int | LeftEndpoint [get] |
Gets the lower (left) boundary. More... | |
int | RightEndpoint [get] |
Gets the upper (right) boundary. More... | |
int | Width [get] |
Gets the width of the interval. More... | |
Static Private Member Functions | |
static double | IntToDouble (int i) |
Represents an interval on the integers.
|
inline |
|
inlinestaticprivate |
|
inlinestatic |
Converts a discrete interval to a continuous interval.
i | The discrete interval. |
References Meta.Numerics.Statistics.Distributions.DiscreteInterval.a, Meta.Numerics.Statistics.Distributions.DiscreteInterval.b, and Meta.Numerics.Interval.FromEndpoints().
|
inline |
Determines if the given discrete intervals equals the current discrete interval.
other | The interval to compare. |
References Meta.Numerics.Statistics.Distributions.DiscreteInterval.a, and Meta.Numerics.Statistics.Distributions.DiscreteInterval.b.
Referenced by Meta.Numerics.Statistics.Distributions.DiscreteInterval.operator==().
|
inline |
Determines if the given object equals the current discrete interval.
obj | The object to compare. |
|
inlinestatic |
Determines if the given discrete intervals are equal.
interval1 | The first discrete interval. |
interval2 | The second discrete interval. |
References Meta.Numerics.Statistics.Distributions.DiscreteInterval.Equals().
|
inlinestatic |
Determines if the given discrete intervals are unequal.
interval1 | The first discrete interval. |
interval2 | The second discrete interval. |
|
inline |
Returns a hash value for the current discrete interval.
int Meta.Numerics.Statistics.Distributions.DiscreteInterval.a |
int Meta.Numerics.Statistics.Distributions.DiscreteInterval.b |
|
get |
Gets the lower (left) boundary.
|
get |
Gets the upper (right) boundary.
|
get |
Gets the width of the interval.
Note that the width of the interval is one less than the number of integers in it. For example: the interval [1,3] has width two, but contains three integers.