Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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
    object
    NumericDocValues
    PackedInt32s.Reader
    PackedInt32s.Mutable
    PackedInt32s.MutableImpl
    Packed64
    Inherited Members
    PackedInt32s.MutableImpl.m_valueCount
    PackedInt32s.MutableImpl.m_bitsPerValue
    PackedInt32s.MutableImpl.BitsPerValue
    PackedInt32s.MutableImpl.Count
    PackedInt32s.Mutable.Save(DataOutput)
    PackedInt32s.Reader.GetArray()
    PackedInt32s.Reader.HasArray
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Util.Packed
    Assembly: Lucene.Net.dll
    Syntax
    public class Packed64 : PackedInt32s.MutableImpl

    Constructors

    Packed64(int, DataInput, int, int)

    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
    int packedIntsVersion
    DataInput in

    A DataInput, positioned at the start of Packed64-content.

    int valueCount

    The number of elements.

    int bitsPerValue

    The number of bits available for any given value.

    Exceptions
    Type Condition
    IOException

    If the values for the backing array could not be retrieved.

    Packed64(int, int)

    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
    int valueCount

    The number of elements.

    int bitsPerValue

    The number of bits available for any given value.

    Methods

    Clear()

    Sets all values to 0.

    Declaration
    public override void Clear()
    Overrides
    PackedInt32s.Mutable.Clear()

    Fill(int, int, long)

    Fill the mutable from fromIndex (inclusive) to toIndex (exclusive) with val.

    Declaration
    public override void Fill(int fromIndex, int toIndex, long val)
    Parameters
    Type Name Description
    int fromIndex
    int toIndex
    long val
    Overrides
    PackedInt32s.Mutable.Fill(int, int, long)

    Get(int)

    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.
    Declaration
    public override long Get(int index)
    Parameters
    Type Name Description
    int index

    The position of the value.

    Returns
    Type Description
    long

    The value at the given index.

    Overrides
    NumericDocValues.Get(int)

    Get(int, long[], int, int)

    Bulk get: read at least one and at most len longs starting from index into arr[off:off+len] and return the actual number of values that have been read.

    Declaration
    public override int Get(int index, long[] arr, int off, int len)
    Parameters
    Type Name Description
    int index
    long[] arr
    int off
    int len
    Returns
    Type Description
    int
    Overrides
    PackedInt32s.Reader.Get(int, long[], int, int)

    RamBytesUsed()

    Return the in-memory size in bytes.

    Declaration
    public override long RamBytesUsed()
    Returns
    Type Description
    long
    Overrides
    PackedInt32s.Reader.RamBytesUsed()

    Set(int, long)

    Set the value at the given index in the array.

    Declaration
    public override void Set(int index, long value)
    Parameters
    Type Name Description
    int index

    Where the value should be positioned.

    long value

    A value conforming to the constraints set by the array.

    Overrides
    PackedInt32s.Mutable.Set(int, long)

    Set(int, long[], int, int)

    Bulk set: set at least one and at most len longs starting at off in arr into this mutable, starting at index. Returns the actual number of values that have been set.

    Declaration
    public override int Set(int index, long[] arr, int off, int len)
    Parameters
    Type Name Description
    int index
    long[] arr
    int off
    int len
    Returns
    Type Description
    int
    Overrides
    PackedInt32s.Mutable.Set(int, long[], int, int)

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current object.

    Overrides
    object.ToString()
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.