// Generated API outline. Implementation bodies omitted. #nullable enable using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Http; using System.Threading.Tasks; using System.Threading; using System; using nfloat = System.Runtime.InteropServices.NFloat; using static Xui.Core.Math2D.Constants; namespace Xui.Core.Math1D { using Xui.Core.Set; /// /// Provides interval types ( and ) over a comparable element type, /// each modeled as a set with membership, containment, and intersection operations. /// public partial class Interval where T : IComparable, IEquatable { /// /// Represents a closed interval [, ] over a comparable type, /// modeled as a set with membership and containment operations. /// /// /// The closed convention [Start, End] means both bounds are inclusive. /// The interval is empty when Start > End. /// public struct Closed : INonEnumerableSet, IEquatable { /// The inclusive lower bound of the interval. public T Start; /// The inclusive upper bound of the interval. public T End; /// /// Creates a new closed interval [, ]. /// [DebuggerStepThrough] public Closed(T start, T end); /// /// Whether this interval represents the empty set (Start > End). /// public bool IsEmpty { get; } /// /// Membership test: ∈ [Start, End]. /// [DebuggerStepThrough] public bool Contains(T value); /// /// Subset test: ⊆ this. /// [DebuggerStepThrough] public bool Contains(Closed other); /// /// Whether two intervals share any elements (this ∩ other ≠ ∅). /// [DebuggerStepThrough] public bool Overlaps(Closed other); /// /// Set intersection: this ∩ . /// Returns ∅ if the intervals do not overlap. /// public Closed Intersect(Closed other); /// /// Implicit conversion from a 2-tuple to a closed interval. /// [DebuggerStepThrough] public static implicit operator Closed((T Start, T End) tuple); [DebuggerStepThrough] public static bool operator ==(Closed left, Closed right); [DebuggerStepThrough] public static bool operator !=(Closed left, Closed right); /// Indicates whether the current object is equal to another object of the same type. /// An object to compare with this object. /// /// if the current object is equal to the parameter; otherwise, . [DebuggerStepThrough] public bool Equals(Closed other); /// Indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// /// if and this instance are the same type and represent the same value; otherwise, . public override bool Equals(object? obj); /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. public override int GetHashCode(); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. [DebuggerStepThrough] public override string ToString(); } } /// /// Provides interval types ( and ) over a comparable element type, /// each modeled as a set with membership, containment, and intersection operations. /// public partial class Interval where T : IComparable, IEquatable { /// /// Represents a half-open interval [, ) over a comparable type, /// modeled as a set with membership and containment operations. /// /// /// The half-open convention [Start, End) means Start is inclusive and End is exclusive. /// The interval is empty when Start >= End, making [n, n) a natural /// representation for a cursor position with no selection. /// public struct ClosedOpen : INonEnumerableSet, IEquatable { /// The inclusive lower bound of the interval. public T Start; /// The exclusive upper bound of the interval. public T End; /// /// Creates a new half-open interval [, ). /// [DebuggerStepThrough] public ClosedOpen(T start, T end); /// /// Whether this interval represents the empty set (Start >= End). /// public bool IsEmpty { get; } /// /// Membership test: ∈ [Start, End). /// [DebuggerStepThrough] public bool Contains(T value); /// /// Subset test: ⊆ this. /// [DebuggerStepThrough] public bool Contains(ClosedOpen other); /// /// Whether two intervals share any elements (this ∩ other ≠ ∅). /// [DebuggerStepThrough] public bool Overlaps(ClosedOpen other); /// /// Set intersection: this ∩ . /// Returns ∅ if the intervals do not overlap. /// public ClosedOpen Intersect(ClosedOpen other); /// /// Implicit conversion from a 2-tuple to a half-open interval. /// [DebuggerStepThrough] public static implicit operator ClosedOpen((T Start, T End) tuple); [DebuggerStepThrough] public static bool operator ==(ClosedOpen left, ClosedOpen right); [DebuggerStepThrough] public static bool operator !=(ClosedOpen left, ClosedOpen right); /// Indicates whether the current object is equal to another object of the same type. /// An object to compare with this object. /// /// if the current object is equal to the parameter; otherwise, . [DebuggerStepThrough] public bool Equals(ClosedOpen other); /// Indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// /// if and this instance are the same type and represent the same value; otherwise, . public override bool Equals(object? obj); /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. public override int GetHashCode(); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. [DebuggerStepThrough] public override string ToString(); } } }