use of io.questdb.std.LongList in project questdb by bluestreak01.
the class IntervalUtilsTest method runTestIntersectInplace.
private void runTestIntersectInplace(LongList intervals, int divider, String expected) {
LongList copy = new LongList();
copy.add(intervals, divider, intervals.size());
copy.add(intervals, 0, divider);
IntervalUtils.intersectInplace(intervals, divider);
TestUtils.assertEquals(expected, toIntervalString(intervals, 0));
IntervalUtils.intersectInplace(copy, copy.size() - divider);
TestUtils.assertEquals(expected, toIntervalString(copy, 0));
}
use of io.questdb.std.LongList in project questdb by bluestreak01.
the class IntervalUtilsTest method testIntersectInplace4.
@Test
public void testIntersectInplace4() {
LongList intervals = new LongList();
// A
add(intervals, -5, -3);
add(intervals, -1, 10);
add(intervals, 12, 13);
// B
add(intervals, -20, -2);
add(intervals, 1, 2);
add(intervals, 4, 5);
add(intervals, 7, 7);
add(intervals, 9, 12);
runTestIntersectInplace(intervals, 6, "[-5,-3], [1,2], [4,5], [7,7], [9,10], [12,12]");
}
use of io.questdb.std.LongList in project questdb by bluestreak01.
the class IntervalUtilsTest method testInvertSimple.
@Test
public void testInvertSimple() {
LongList intervals = new LongList();
// A
add(intervals, -20, -2);
// B
add(intervals, 1, 2);
runTestInvertInplace(intervals, 2, "[NaN,0], [3,9223372036854775807]");
}
use of io.questdb.std.LongList in project questdb by bluestreak01.
the class IntervalUtilsTest method testUnionAllAfterB.
@Test
public void testUnionAllAfterB() {
LongList intervals = new LongList();
// A
add(intervals, 100, 101);
add(intervals, 200, 201);
add(intervals, 205, 206);
// B
add(intervals, 1, 2);
add(intervals, 3, 4);
add(intervals, 6, 7);
runTestUnionInplace(intervals, 6, "[1,2], [3,4], [6,7], [100,101], [200,201], [205,206]");
}
use of io.questdb.std.LongList in project questdb by bluestreak01.
the class IntervalUtilsTest method testInvertWithPositiveInfinity.
@Test
public void testInvertWithPositiveInfinity() {
LongList intervals = new LongList();
// A
// B
add(intervals, Long.MIN_VALUE, 2);
add(intervals, 100, 200);
runTestInvertInplace(intervals, 0, "[3,99], [201,9223372036854775807]");
}
Aggregations