Package net.algart.math
Class IRangeFinder
java.lang.Object
net.algart.math.IRangeFinder
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
compact()
int
findContaining
(double point, int[] resultIndexes) void
findContaining
(double point, IntConsumer indexConsumer) void
findContaining
(double point, IRangeConsumer rangeConsumer) int
findContaining
(int point, int[] resultIndexes) void
findContaining
(int point, IntConsumer indexConsumer) void
findContaining
(int point, IRangeConsumer rangeConsumer) int
findIntersecting
(int min, int max, int[] resultIndexes) void
findIntersecting
(int min, int max, IntConsumer indexConsumer) void
findIntersecting
(int min, int max, IRangeConsumer rangeConsumer) static IRangeFinder
static IRangeFinder
static IRangeFinder
getInstance
(int[] left, int[] right) static IRangeFinder
getInstance
(IntUnaryOperator left, IntUnaryOperator right, int numberOfRanges) final boolean
indexActual
(int k) final IntUnaryOperator
left()
final int
left
(int k) final int
final IntUnaryOperator
right()
final int
right
(int k) final IRangeFinder
final IRangeFinder
setIndexActual
(IntPredicate indexActual) Allows to remove some ranges from finding, for example, if they were processed by some way and already not necessary.final IRangeFinder
setIndexedRanges
(int[] allLeft, int[] allRight, int[] indexes, int numberOfRanges) final IRangeFinder
setRanges
(int[] left, int[] right) final IRangeFinder
setRanges
(IntUnaryOperator left, IntUnaryOperator right, int numberOfRanges) toString()
static int
unpackHigh
(long packed) static int
unpackLow
(long packed)
-
Method Details
-
getEmptyInstance
-
getEmptyUnoptimizedInstance
-
getInstance
public static IRangeFinder getInstance(IntUnaryOperator left, IntUnaryOperator right, int numberOfRanges) -
getInstance
-
left
-
right
-
left
public final int left(int k) -
right
public final int right(int k) -
numberOfRanges
public final int numberOfRanges() -
setRanges
public final IRangeFinder setRanges(IntUnaryOperator left, IntUnaryOperator right, int numberOfRanges) -
setRanges
-
setIndexedRanges
public final IRangeFinder setIndexedRanges(int[] allLeft, int[] allRight, int[] indexes, int numberOfRanges) -
setIndexActual
Allows to remove some ranges from finding, for example, if they were processed by some way and already not necessary. For such indexes, indexActual.test(index) should return false. By default, all indexes are actual (built-in indexActual always returns true).Note that this method should be very quick/ If it requires essential time, it is better to check actuality in the high-level processing.
- Parameters:
indexActual
- whether a range with the given index is necessary to be returned- Returns:
- a reference to this object.
-
setAllIndexesActual
-
indexActual
public final boolean indexActual(int k) -
compact
-
findContaining
-
findContaining
-
findContaining
public int findContaining(int point, int[] resultIndexes) -
findContaining
-
findContaining
-
findContaining
public int findContaining(double point, int[] resultIndexes) -
findIntersecting
-
findIntersecting
-
findIntersecting
public int findIntersecting(int min, int max, int[] resultIndexes) -
clear
public void clear() -
toString
-
unpackHigh
public static int unpackHigh(long packed) -
unpackLow
public static int unpackLow(long packed)
-