Package 

Class OrderedIntDoubleMapping

    • Constructor Detail

      • OrderedIntDoubleMapping

        OrderedIntDoubleMapping(boolean noDefault)
        Constructor for OrderedIntDoubleMapping.
        Parameters:
        noDefault - a boolean.
      • OrderedIntDoubleMapping

        OrderedIntDoubleMapping()
        Constructor for OrderedIntDoubleMapping.
      • OrderedIntDoubleMapping

        OrderedIntDoubleMapping(int capacity)
        Constructor for OrderedIntDoubleMapping.
        Parameters:
        capacity - a int.
      • OrderedIntDoubleMapping

        OrderedIntDoubleMapping(Array<int> indices, Array<double> values, int numMappings)
        Constructor for OrderedIntDoubleMapping.
        Parameters:
        indices - an array of objects.
        values - an array of objects.
        numMappings - a int.
    • Method Detail

      • getNumMappings

         int getNumMappings()

        Getter for the field numMappings.

      • isEmpty

         boolean isEmpty()

        isEmpty.

      • indexAt

         int indexAt(int offset)

        indexAt.

        Parameters:
        offset - a int.
      • setIndexAt

         void setIndexAt(int offset, int index)

        setIndexAt.

        Parameters:
        offset - a int.
        index - a int.
      • setValueAt

         void setValueAt(int offset, double value)

        setValueAt.

        Parameters:
        offset - a int.
        value - a double.
      • toSparseVector

         SparseRealVector toSparseVector(int dimension)

        toSparseVector.

        Parameters:
        dimension - a int.
      • toArray

         Array<double> toArray(int dim)

        toArray.

        Parameters:
        dim - a int.
      • get

         double get(int index)

        get.

        Parameters:
        index - a int.
      • set

         void set(int index, double value)

        set.

        Parameters:
        index - a int.
        value - a double.
      • merge

         void merge(OrderedIntDoubleMapping updates)

        Merges the updates in linear time by allocating new arrays and iterating through the existing indices and valuesand the updates' indices and values at the same time while selecting the minimum index to set at each step.

        Parameters:
        updates - another list of mappings to be merged in.
      • increment

         void increment(int index, double increment)

        increment.

        Parameters:
        index - a int.
        increment - a double.