Class EliasFanoPrefixSumLongBigList
- All Implemented Interfaces:
BigList<Long>
,LongBigList
,LongCollection
,LongIterable
,LongStack
,Size64
,Stack<Long>
,Serializable
,Comparable<BigList<? extends Long>>
,Iterable<Long>
,Collection<Long>
Instances of this class store in compacted form a list of longs. Values are provided either through an iterable object. As an additional service, this list provides access to the prefix sums of its values.
Implementation details
Instances of this class are essentially a view over an instance of
EliasFanoMonotoneLongBigList
storing the prefix sums. The getLong(long)
method
delegates to EliasFanoMonotoneLongBigList.getDelta(long)
. The iterator has the same properties of the iterator
returned by EliasFanoMonotoneLongBiglist
.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
An list iterator over the values of thisEliasFanoPrefixSumLongBigList
.Nested classes/interfaces inherited from class it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList
EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.longs.AbstractLongBigList
AbstractLongBigList.LongRandomAccessSubList, AbstractLongBigList.LongSubList
-
Field Summary
Fields inherited from class it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList
l, length, lowerBits, lowerBitsMask, selectUpper
-
Constructor Summary
ConstructorDescriptionEliasFanoPrefixSumLongBigList
(ByteIterable elements) Creates a new Elias–Fano prefix-sum long big list.EliasFanoPrefixSumLongBigList
(IntIterable elements) Creates a new Elias–Fano prefix-sum long big list.EliasFanoPrefixSumLongBigList
(LongIterable elements) Creates a new Elias–Fano prefix-sum long big list.EliasFanoPrefixSumLongBigList
(ShortIterable elements) Creates a new Elias–Fano prefix-sum long big list. -
Method Summary
Modifier and TypeMethodDescriptionlong
getLong
(long index) Returns the element at the specified position.iterator()
Returns a list iterator over the values of thisEliasFanoPrefixSumLongBigList
.Returns a list iterator over the values of thisEliasFanoPrefixSumLongBigList
.listIterator
(long from) Returns a list iterator over the values of thisEliasFanoPrefixSumLongBigList
.long
prefixSum
(long index) Returns the prefix sum of this list up to the given index.long
size64()
Methods inherited from class it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList
dump, dump, fits, get, get, getDelta, numBits
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongBigList
add, add, add, addAll, addAll, addAll, addAll, addElements, addElements, clear, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, forEach, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, peek, peekLong, pop, popLong, push, push, rem, remove, removeElements, removeLong, set, set, setElements, size, size, subList, top, topLong, toString
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection
add, contains, containsAll, containsAll, forEach, remove, removeAll, removeAll, removeIf, retainAll, retainAll, toArray, toLongArray, toLongArray
Methods inherited from class java.util.AbstractCollection
isEmpty, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toArray
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongBigList
addAll, addAll, addAll, addAll, getElements, setElements, setElements, spliterator
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection
add, contains, containsAll, longIterator, longParallelStream, longSpliterator, longStream, parallelStream, remove, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toLongArray, toLongArray
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterable
forEach, forEach
-
Constructor Details
-
EliasFanoPrefixSumLongBigList
Creates a new Elias–Fano prefix-sum long big list.- Parameters:
elements
- an iterable object.
-
EliasFanoPrefixSumLongBigList
Creates a new Elias–Fano prefix-sum long big list.- Parameters:
elements
- an iterable object.
-
EliasFanoPrefixSumLongBigList
Creates a new Elias–Fano prefix-sum long big list.- Parameters:
elements
- an iterable object.
-
EliasFanoPrefixSumLongBigList
Creates a new Elias–Fano prefix-sum long big list.- Parameters:
elements
- an iterable object.
-
-
Method Details
-
getLong
public long getLong(long index) Description copied from class:EliasFanoMonotoneLongBigList
Returns the element at the specified position.- Specified by:
getLong
in interfaceLongBigList
- Overrides:
getLong
in classEliasFanoMonotoneLongBigList
- Parameters:
index
- a position in the list.- Returns:
- the element at the specified position; if
index
is out of bounds, behavior is undefined.
-
prefixSum
public long prefixSum(long index) Returns the prefix sum of this list up to the given index.- Parameters:
index
- an index from 0 to the length of this list.- Returns:
- the sum of the values with index between 0 (inclusive) and
index
(exclusive).
-
size64
public long size64()- Specified by:
size64
in interfaceSize64
- Overrides:
size64
in classEliasFanoMonotoneLongBigList
-
listIterator
Returns a list iterator over the values of thisEliasFanoPrefixSumLongBigList
.Forward iteration will be faster than iterated calls to
getLong()
. Backward iteration is available, but it will performs similarly togetLong()
.- Specified by:
listIterator
in interfaceBigList<Long>
- Specified by:
listIterator
in interfaceLongBigList
- Overrides:
listIterator
in classEliasFanoMonotoneLongBigList
- Parameters:
from
- the starting element in the list.- Returns:
- a list iterator over the values of this
EliasFanoPrefixSumLongBigList
. - See Also:
-
listIterator
Returns a list iterator over the values of thisEliasFanoPrefixSumLongBigList
.Forward iteration will be faster than iterated calls to
getLong()
. Backward iteration is available, but it will performs similarly togetLong()
.- Specified by:
listIterator
in interfaceBigList<Long>
- Specified by:
listIterator
in interfaceLongBigList
- Overrides:
listIterator
in classEliasFanoMonotoneLongBigList
- Returns:
- a list iterator over the values of this
EliasFanoPrefixSumLongBigList
. - See Also:
-
iterator
Returns a list iterator over the values of thisEliasFanoPrefixSumLongBigList
.Forward iteration will be faster than iterated calls to
getLong()
. Backward iteration is available, but it will performs similarly togetLong()
.- Specified by:
iterator
in interfaceCollection<Long>
- Specified by:
iterator
in interfaceIterable<Long>
- Specified by:
iterator
in interfaceLongBigList
- Specified by:
iterator
in interfaceLongCollection
- Specified by:
iterator
in interfaceLongIterable
- Overrides:
iterator
in classEliasFanoMonotoneLongBigList
- Returns:
- a list iterator over the values of this
EliasFanoPrefixSumLongBigList
. - See Also:
-