Class EliasFanoDecoder
Inheritance
Namespace: Lucene.Net.Util.Packed
Assembly: Lucene.Net.dll
Syntax
public class EliasFanoDecoder : object
Constructors
| Improve this Doc View SourceEliasFanoDecoder(EliasFanoEncoder)
Construct a decoder for a given EliasFanoEncoder. The decoding index is set to just before the first encoded value.
Declaration
public EliasFanoDecoder(EliasFanoEncoder efEncoder)
Parameters
Type | Name | Description |
---|---|---|
EliasFanoEncoder | efEncoder |
Fields
| Improve this Doc View SourceNO_MORE_VALUES
Declaration
public const long NO_MORE_VALUES = null
Field Value
Type | Description |
---|---|
System.Int64 |
Properties
| Improve this Doc View SourceEliasFanoEncoder
Declaration
public virtual EliasFanoEncoder EliasFanoEncoder { get; }
Property Value
Type | Description |
---|---|
EliasFanoEncoder | The Elias-Fano encoder that is decoded. |
NumEncoded
The number of values encoded by the encoder.
Declaration
public virtual long NumEncoded { get; }
Property Value
Type | Description |
---|---|
System.Int64 | The number of values encoded by the encoder. |
Methods
| Improve this Doc View SourceAdvanceToIndex(Int64)
Advance the decoding index to a given index
.
and return true
iff it is available.
See also CurrentValue().
The current implementation does not use the index on the upper bit zero bit positions.
Note: there is currently no implementation of BackToIndex()
.
Declaration
public virtual bool AdvanceToIndex(long index)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | index |
Returns
Type | Description |
---|---|
System.Boolean |
AdvanceToValue(Int64)
Given a target
value, advance the decoding index to the first bigger or equal value
and return it if it is available. Otherwise return NO_MORE_VALUES.
The current implementation uses the index on the upper zero bit positions.
Declaration
public virtual long AdvanceToValue(long target)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | target |
Returns
Type | Description |
---|---|
System.Int64 |
BackToValue(Int64)
Given a target value, go back to the first smaller or equal value and return it if it is available. Otherwise return NO_MORE_VALUES.
The current implementation does not use the index on the upper zero bit positions.
Declaration
public virtual long BackToValue(long target)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | target |
Returns
Type | Description |
---|---|
System.Int64 |
CurrentIndex()
The current decoding index.
The first value encoded by EncodeNext(Int64) has index 0.
Only valid directly after
NextValue(), AdvanceToValue(Int64),
PreviousValue(), or BackToValue(Int64)
returned another value than NO_MORE_VALUES,
or AdvanceToIndex(Int64) returned true
.
Declaration
public virtual long CurrentIndex()
Returns
Type | Description |
---|---|
System.Int64 | The decoding index of the last decoded value, or as last set by AdvanceToIndex(Int64). |
CurrentValue()
The value at the current decoding index. Only valid when CurrentIndex() would return a valid result.
This is only intended for use after AdvanceToIndex(Int64) returned true
.
Declaration
public virtual long CurrentValue()
Returns
Type | Description |
---|---|
System.Int64 | The value encoded at CurrentIndex(). |
NextValue()
If another value is available after the current decoding index, return this value and and increase the decoding index by 1. Otherwise return NO_MORE_VALUES.
Declaration
public virtual long NextValue()
Returns
Type | Description |
---|---|
System.Int64 |
PreviousValue()
If another value is available before the current decoding index, return this value and decrease the decoding index by 1. Otherwise return NO_MORE_VALUES.
Declaration
public virtual long PreviousValue()
Returns
Type | Description |
---|---|
System.Int64 |
ToAfterSequence()
Set the decoding index to just after the last encoded value.
Declaration
public virtual void ToAfterSequence()
ToBeforeSequence()
Set the decoding index to just before the first encoded value.
Declaration
public virtual void ToBeforeSequence()