Class Packed64
Space optimized random access capable array of values with a fixed number of bits/value. Values are packed contiguously.
The implementation strives to perform af fast as possible under the constraint of contiguous bits, by avoiding expensive operations. This comes at the cost of code clarity.
Technical details: this implementation is a refinement of a non-branching version. The non-branching get and set methods meant that 2 or 4 atomics in the underlying array were always accessed, even for the cases where only 1 or 2 were needed. Even with caching, this had a detrimental effect on performance. Related to this issue, the old implementation used lookup tables for shifts and masks, which also proved to be a bit slower than calculating the shifts and masks on the fly. See https://issues.apache.org/jira/browse/LUCENE-4062 for details.
Inheritance
Inherited Members
Namespace: Lucene.Net.Util.Packed
Assembly: Lucene.Net.dll
Syntax
public class Packed64 : PackedInt32s.MutableImpl
Constructors
| Improve this Doc View SourcePacked64(Int32, DataInput, Int32, Int32)
Creates an array with content retrieved from the given DataInput.
Declaration
public Packed64(int packedIntsVersion, DataInput in, int valueCount, int bitsPerValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | packedIntsVersion | |
DataInput | in | A DataInput, positioned at the start of Packed64-content. |
System.Int32 | valueCount | The number of elements. |
System.Int32 | bitsPerValue | The number of bits available for any given value. |
Packed64(Int32, Int32)
Creates an array with the internal structures adjusted for the given limits and initialized to 0.
Declaration
public Packed64(int valueCount, int bitsPerValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | valueCount | The number of elements. |
System.Int32 | bitsPerValue | The number of bits available for any given value. |
Methods
| Improve this Doc View SourceClear()
Declaration
public override void Clear()
Overrides
| Improve this Doc View SourceFill(Int32, Int32, Int64)
Declaration
public override void Fill(int fromIndex, int toIndex, long val)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromIndex | |
System.Int32 | toIndex | |
System.Int64 | val |
Overrides
| Improve this Doc View SourceGet(Int32)
Declaration
public override long Get(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The position of the value. |
Returns
Type | Description |
---|---|
System.Int64 | The value at the given index. |
Overrides
| Improve this Doc View SourceGet(Int32, Int64[], Int32, Int32)
Declaration
public override int Get(int index, long[] arr, int off, int len)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Int64[] | arr | |
System.Int32 | off | |
System.Int32 | len |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceRamBytesUsed()
Declaration
public override long RamBytesUsed()
Returns
Type | Description |
---|---|
System.Int64 |
Overrides
| Improve this Doc View SourceSet(Int32, Int64)
Declaration
public override void Set(int index, long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Int64 | value |
Overrides
| Improve this Doc View SourceSet(Int32, Int64[], Int32, Int32)
Declaration
public override int Set(int index, long[] arr, int off, int len)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Int64[] | arr | |
System.Int32 | off | |
System.Int32 | len |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |