Class GV3CompressedFunction.Builder<T>
java.lang.Object
it.unimi.dsi.sux4j.mph.GV3CompressedFunction.Builder<T>
- Enclosing class:
GV3CompressedFunction<T>
- Since:
- 4.2.0
- Author:
- Sebastiano Vigna, Marco Genuzio
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BucketedHashStore<T> protected booleanWhetherbuild()has already been called.protected Codecprotected booleanprotected booleanprotected Fileprotected it.unimi.dsi.bits.TransformationStrategy<? super T> protected it.unimi.dsi.fastutil.longs.LongIterable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new function.Specifies a codec that will be used to encode the function output values.indirect()Specifies the keys of the function; if you have specified aBucketedHashStore, it can benull.peeled()Specifies to use peeling rather than lazy Gaussian elimination; the resulting structure uses +12% space, but it can be constructed much more quickly.store(BucketedHashStore<T> bucketedHashStore) Specifies a bucketed hash store containing the keys.Specifies a temporary directory for theBucketedHashStore.Specifies the transformation strategy for the keys of the function; the strategy can be raw.values(it.unimi.dsi.fastutil.longs.LongIterable values) Specifies the values assigned to the keys; the output width of the function will be the minimum width needed to represent all values.
-
Field Details
-
keys
-
transform
-
tempDir
-
bucketedHashStore
-
values
protected it.unimi.dsi.fastutil.longs.LongIterable values -
indirect
protected boolean indirect -
built
protected boolean builtWhetherbuild()has already been called. -
codec
-
peeled
protected boolean peeled
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
keys
Specifies the keys of the function; if you have specified aBucketedHashStore, it can benull.- Parameters:
keys- the keys of the function.- Returns:
- this builder.
-
transform
public GV3CompressedFunction.Builder<T> transform(it.unimi.dsi.bits.TransformationStrategy<? super T> transform) Specifies the transformation strategy for the keys of the function; the strategy can be raw.- Parameters:
transform- a transformation strategy for the keys of the function.- Returns:
- this builder.
-
tempDir
Specifies a temporary directory for theBucketedHashStore.- Parameters:
tempDir- a temporary directory for theBucketedHashStorefiles, ornullfor the standard temporary directory.- Returns:
- this builder.
-
store
Specifies a bucketed hash store containing the keys.Note that if you specify a store, it is your responsibility that it conforms to the rest of the data: it must contain ranks if you do not specify values or if you use the indirect feature, values otherwise.
- Parameters:
bucketedHashStore- a bucketed hash store containing the keys associated with their values and counting value frequencies, ornull; the store can be unchecked, but in this case you must specify keys and a transform (otherwise, in case of a hash collision in the store anIllegalStateExceptionwill be thrown).- Returns:
- this builder.
-
values
-
indirect
-
codec
Specifies a codec that will be used to encode the function output values. The default is a Codec.Huffman codec with default parameters.- Parameters:
codec- a codec that will be used to encode the function output values- Returns:
- this builder.
-
peeled
Specifies to use peeling rather than lazy Gaussian elimination; the resulting structure uses +12% space, but it can be constructed much more quickly.- Returns:
- this builder.
-
build
Builds a new function.- Returns:
- a
GOV3Functioninstance with the specified parameters. - Throws:
IllegalStateException- if called more than once.IOException
-