IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Meta.Numerics.Statistics.Distributions.DiscreteInterval Struct Reference

Represents an interval on the integers. More...

+ Inheritance diagram for Meta.Numerics.Statistics.Distributions.DiscreteInterval:
+ Collaboration diagram for Meta.Numerics.Statistics.Distributions.DiscreteInterval:

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)
 

Detailed Description

Represents an interval on the integers.

Constructor & Destructor Documentation

Meta.Numerics.Statistics.Distributions.DiscreteInterval.DiscreteInterval ( int  a,
int  b 
)
inline

Member Function Documentation

static double Meta.Numerics.Statistics.Distributions.DiscreteInterval.IntToDouble ( int  i)
inlinestaticprivate
static implicit Meta.Numerics.Statistics.Distributions.DiscreteInterval.operator Interval ( DiscreteInterval  i)
inlinestatic

Converts a discrete interval to a continuous interval.

Parameters
iThe discrete interval.
Returns
The corresponding continuous interval.

References Meta.Numerics.Statistics.Distributions.DiscreteInterval.a, Meta.Numerics.Statistics.Distributions.DiscreteInterval.b, and Meta.Numerics.Interval.FromEndpoints().

bool Meta.Numerics.Statistics.Distributions.DiscreteInterval.Equals ( DiscreteInterval  other)
inline

Determines if the given discrete intervals equals the current discrete interval.

Parameters
otherThe interval to compare.
Returns
True if the discrete intervals are equal, otherwise false.

References Meta.Numerics.Statistics.Distributions.DiscreteInterval.a, and Meta.Numerics.Statistics.Distributions.DiscreteInterval.b.

Referenced by Meta.Numerics.Statistics.Distributions.DiscreteInterval.operator==().

override bool Meta.Numerics.Statistics.Distributions.DiscreteInterval.Equals ( object  obj)
inline

Determines if the given object equals the current discrete interval.

Parameters
objThe object to compare.
Returns
True if the object describes the same discrete interval, otherwise false.
static bool Meta.Numerics.Statistics.Distributions.DiscreteInterval.operator== ( DiscreteInterval  interval1,
DiscreteInterval  interval2 
)
inlinestatic

Determines if the given discrete intervals are equal.

Parameters
interval1The first discrete interval.
interval2The second discrete interval.
Returns
True if the discrete intervals are equal, otherwise false.

References Meta.Numerics.Statistics.Distributions.DiscreteInterval.Equals().

static bool Meta.Numerics.Statistics.Distributions.DiscreteInterval.operator!= ( DiscreteInterval  interval1,
DiscreteInterval  interval2 
)
inlinestatic

Determines if the given discrete intervals are unequal.

Parameters
interval1The first discrete interval.
interval2The second discrete interval.
Returns
True if the discrete intervals are unequal, otherwise false.
override int Meta.Numerics.Statistics.Distributions.DiscreteInterval.GetHashCode ( )
inline

Returns a hash value for the current discrete interval.

Returns
A hash value for the discrete interval.

Member Data Documentation

Property Documentation

int Meta.Numerics.Statistics.Distributions.DiscreteInterval.LeftEndpoint
get

Gets the lower (left) boundary.

int Meta.Numerics.Statistics.Distributions.DiscreteInterval.RightEndpoint
get

Gets the upper (right) boundary.

int Meta.Numerics.Statistics.Distributions.DiscreteInterval.Width
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.


The documentation for this struct was generated from the following file: