DiscreteInterval Class
Definition
- Assembly
- Bodu.Numerics.dll
- Package
- Bodu.Numerics 1.0.0
Provides type-inferring factory methods for DiscreteInterval<T>, mirroring the static factories on the type but inferring the endpoint type from the arguments.
public static class DiscreteInterval
- Inheritance
-
DiscreteInterval
- Inherited Members
Methods
AtLeast<T>(T)
Creates a lower-bounded interval [lower, +∞) with T inferred from the
argument.
public static DiscreteInterval<T> AtLeast<T>(T lower) where T : IBinaryInteger<T>
Parameters
lowerTThe inclusive lower bound.
Returns
- DiscreteInterval<T>
An upper-unbounded interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
AtMost<T>(T)
Creates an upper-bounded interval (-∞, upper] with T inferred from the
argument.
public static DiscreteInterval<T> AtMost<T>(T upper) where T : IBinaryInteger<T>
Parameters
upperTThe inclusive upper bound.
Returns
- DiscreteInterval<T>
A lower-unbounded interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
ClosedOpen<T>(T, T)
Creates a closed-open interval [lower, upper) with T inferred from the arguments.
public static DiscreteInterval<T> ClosedOpen<T>(T lower, T upper) where T : IBinaryInteger<T>
Parameters
lowerTThe inclusive lower bound.
upperTThe exclusive upper bound.
Returns
- DiscreteInterval<T>
The canonicalized interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
Closed<T>(T, T)
Creates a closed interval [lower, upper] with T inferred from the arguments.
public static DiscreteInterval<T> Closed<T>(T lower, T upper) where T : IBinaryInteger<T>
Parameters
lowerTThe inclusive lower bound.
upperTThe inclusive upper bound.
Returns
- DiscreteInterval<T>
The interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
GreaterThan<T>(T)
Creates a lower-bounded interval (lower, +∞) with T inferred from the
argument.
public static DiscreteInterval<T> GreaterThan<T>(T lower) where T : IBinaryInteger<T>
Parameters
lowerTThe exclusive lower bound.
Returns
- DiscreteInterval<T>
An upper-unbounded interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
LessThan<T>(T)
Creates an upper-bounded interval (-∞, upper) with T inferred from the
argument.
public static DiscreteInterval<T> LessThan<T>(T upper) where T : IBinaryInteger<T>
Parameters
upperTThe exclusive upper bound.
Returns
- DiscreteInterval<T>
A lower-unbounded interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
OpenClosed<T>(T, T)
Creates an open-closed interval (lower, upper] with T inferred from the
arguments.
public static DiscreteInterval<T> OpenClosed<T>(T lower, T upper) where T : IBinaryInteger<T>
Parameters
lowerTThe exclusive lower bound.
upperTThe inclusive upper bound.
Returns
- DiscreteInterval<T>
The canonicalized interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
Open<T>(T, T)
Creates an open interval (lower, upper) with T inferred from the arguments.
public static DiscreteInterval<T> Open<T>(T lower, T upper) where T : IBinaryInteger<T>
Parameters
lowerTThe exclusive lower bound.
upperTThe exclusive upper bound.
Returns
- DiscreteInterval<T>
The canonicalized interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
Singleton<T>(T)
Creates a single-integer interval [value, value] with T inferred from the
argument.
public static DiscreteInterval<T> Singleton<T>(T value) where T : IBinaryInteger<T>
Parameters
valueTThe single integer.
Returns
- DiscreteInterval<T>
A one-element interval.
Type Parameters
TThe integer endpoint type, inferred at the call site.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |