Class RingIntervalND<T extends Comparable<T>>
java.lang.Object
org.episteme.core.mathematics.algebra.intervals.OrderedSetIntervalND<T>
org.episteme.core.mathematics.algebra.intervals.RingIntervalND<T>
- All Implemented Interfaces:
Interval<T>
- Direct Known Subclasses:
FieldIntervalND
N-dimensional interval over a Ring (elements support addition and
subtraction).
Extends the capabilities of OrderedSetIntervalND by requiring elements to form a Ring structure, enabling operations that depend on subtraction (like computing the width/extent in each dimension).
A Ring requires:
- Addition: (a + b)
- Additive inverse/subtraction: (a - b)
- Multiplication: (a × b)
- Additive identity (zero)
- Multiplicative identity (one)
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
ConstructorsConstructorDescriptionRingIntervalND(T[] min, T[] max, boolean[] closedLeft, boolean[] closedRight, BinaryOperator<T> subtractor) Creates an N-dimensional Ring interval with specified bounds.RingIntervalND(T[] min, T[] max, BinaryOperator<T> subtractor) Creates a closed N-dimensional Ring interval [min, max].RingIntervalND(T min, T max, boolean closedLeft, boolean closedRight, BinaryOperator<T> subtractor) Creates a 1-dimensional Ring interval.RingIntervalND(T min, T max, BinaryOperator<T> subtractor) Creates a closed 1-dimensional Ring interval [min, max]. -
Method Summary
Modifier and TypeMethodDescriptionboundingInterval(Interval<T> other) Returns the smallest interval containing both this and another interval.Returns the subtraction operator used by this interval.getWidth(int dimension) Returns the width (extent) in the specified dimension.T[]Returns the widths in all dimensions.intersection(Interval<T> other) Returns the intersection of this interval with another.Methods inherited from class OrderedSetIntervalND
contains, contains, equals, getDimension, getMax, getMin, hashCode, isClosedLeft, isClosedRight, isEmpty, notation, overlaps, toString
-
Constructor Details
-
RingIntervalND
public RingIntervalND(T[] min, T[] max, boolean[] closedLeft, boolean[] closedRight, BinaryOperator<T> subtractor) Creates an N-dimensional Ring interval with specified bounds.- Parameters:
min- array of minimum values for each dimensionmax- array of maximum values for each dimensionclosedLeft- array indicating if left endpoints are closedclosedRight- array indicating if right endpoints are closedsubtractor- function to compute (a - b) for elements
-
RingIntervalND
Creates a closed N-dimensional Ring interval [min, max]. -
RingIntervalND
public RingIntervalND(T min, T max, boolean closedLeft, boolean closedRight, BinaryOperator<T> subtractor) Creates a 1-dimensional Ring interval. -
RingIntervalND
Creates a closed 1-dimensional Ring interval [min, max].
-
-
Method Details
-
getWidth
Returns the width (extent) in the specified dimension.Computed as max - min using the Ring's subtraction operation.
- Parameters:
dimension- the dimension index (0-based)- Returns:
- the width (max - min) in that dimension
-
getWidths
Returns the widths in all dimensions.- Returns:
- array of widths for each dimension
-
getSubtractor
Returns the subtraction operator used by this interval.- Returns:
- the binary subtraction operator
-
intersection
Description copied from interface:IntervalReturns the intersection of this interval with another.- Specified by:
intersectionin interfaceInterval<T extends Comparable<T>>- Overrides:
intersectionin classOrderedSetIntervalND<T extends Comparable<T>>- Parameters:
other- the interval to intersect with- Returns:
- the intersection interval, or null if empty
-
boundingInterval
Description copied from interface:IntervalReturns the smallest interval containing both this and another interval.- Specified by:
boundingIntervalin interfaceInterval<T extends Comparable<T>>- Overrides:
boundingIntervalin classOrderedSetIntervalND<T extends Comparable<T>>- Parameters:
other- the interval to union with- Returns:
- the bounding interval
-