Class FieldIntervalND<T extends Comparable<T>>
java.lang.Object
org.episteme.core.mathematics.algebra.intervals.OrderedSetIntervalND<T>
org.episteme.core.mathematics.algebra.intervals.RingIntervalND<T>
org.episteme.core.mathematics.algebra.intervals.FieldIntervalND<T>
- All Implemented Interfaces:
Interval<T>
N-dimensional interval over a Field (elements support full arithmetic).
Extends RingIntervalND by requiring elements to form a Field structure, enabling operations that depend on division (like computing the center/midpoint of each dimension).
A Field requires all Ring operations plus:
- Division: (a / b) for b ≠0
- Multiplicative inverse
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
ConstructorsConstructorDescriptionFieldIntervalND(T[] min, T[] max, boolean[] closedLeft, boolean[] closedRight, BinaryOperator<T> adder, BinaryOperator<T> subtractor, BinaryOperator<T> divider, Function<Integer, T> fromInt) Creates an N-dimensional Field interval with specified bounds.FieldIntervalND(T[] min, T[] max, BinaryOperator<T> adder, BinaryOperator<T> subtractor, BinaryOperator<T> divider, Function<Integer, T> fromInt) Creates a closed N-dimensional Field interval [min, max].FieldIntervalND(T min, T max, boolean closedLeft, boolean closedRight, BinaryOperator<T> adder, BinaryOperator<T> subtractor, BinaryOperator<T> divider, Function<Integer, T> fromInt) Creates a 1-dimensional Field interval.FieldIntervalND(T min, T max, BinaryOperator<T> adder, BinaryOperator<T> subtractor, BinaryOperator<T> divider, Function<Integer, T> fromInt) Creates a closed 1-dimensional Field interval [min, max]. -
Method Summary
Modifier and TypeMethodDescriptionboundingInterval(Interval<T> other) Returns the smallest interval containing both this and another interval.getAdder()Returns the adder operator.Returns the divider operator.Returns the fromInt converter.getMidpoint(int dimension) Returns the midpoint (center) in the specified dimension.T[]Returns the midpoints (center) in all dimensions.intersection(Interval<T> other) Returns the intersection of this interval with another.Methods inherited from class RingIntervalND
getSubtractor, getWidth, getWidthsMethods inherited from class OrderedSetIntervalND
contains, contains, equals, getDimension, getMax, getMin, hashCode, isClosedLeft, isClosedRight, isEmpty, notation, overlaps, toString
-
Constructor Details
-
FieldIntervalND
public FieldIntervalND(T[] min, T[] max, boolean[] closedLeft, boolean[] closedRight, BinaryOperator<T> adder, BinaryOperator<T> subtractor, BinaryOperator<T> divider, Function<Integer, T> fromInt) Creates an N-dimensional Field 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 closedadder- function to compute (a + b)subtractor- function to compute (a - b)divider- function to compute (a / b)fromInt- function to create element from integer (for computing 2 in midpoint)
-
FieldIntervalND
public FieldIntervalND(T[] min, T[] max, BinaryOperator<T> adder, BinaryOperator<T> subtractor, BinaryOperator<T> divider, Function<Integer, T> fromInt) Creates a closed N-dimensional Field interval [min, max]. -
FieldIntervalND
public FieldIntervalND(T min, T max, boolean closedLeft, boolean closedRight, BinaryOperator<T> adder, BinaryOperator<T> subtractor, BinaryOperator<T> divider, Function<Integer, T> fromInt) Creates a 1-dimensional Field interval. -
FieldIntervalND
public FieldIntervalND(T min, T max, BinaryOperator<T> adder, BinaryOperator<T> subtractor, BinaryOperator<T> divider, Function<Integer, T> fromInt) Creates a closed 1-dimensional Field interval [min, max].
-
-
Method Details
-
getMidpoint
Returns the midpoint (center) in the specified dimension.Computed as (min + max) / 2 using the Field's arithmetic operations.
- Parameters:
dimension- the dimension index (0-based)- Returns:
- the midpoint value in that dimension
-
getMidpoints
Returns the midpoints (center) in all dimensions.- Returns:
- array of midpoint values for each dimension
-
getAdder
Returns the adder operator. -
getDivider
Returns the divider operator. -
getFromInt
-
intersection
Description copied from interface:IntervalReturns the intersection of this interval with another.- Specified by:
intersectionin interfaceInterval<T extends Comparable<T>>- Overrides:
intersectionin classRingIntervalND<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 classRingIntervalND<T extends Comparable<T>>- Parameters:
other- the interval to union with- Returns:
- the bounding interval
-