Class SparseRow

    • Constructor Detail

      • SparseRow

        public SparseRow()
      • SparseRow

        public SparseRow(int capacity)
      • SparseRow

        public SparseRow(int estnnz,
                         int maxnnz)
      • SparseRow

        public SparseRow(SparseRow that)
    • Method Detail

      • size

        public int size()
      • setSize

        public void setSize(int newsize)
      • isEmpty

        public boolean isEmpty()
      • values

        public double[] values()
      • indexes

        public int[] indexes()
      • setValues

        public void setValues(double[] d)
      • setIndexes

        public void setIndexes(int[] i)
      • capacity

        public int capacity()
      • reset

        public void reset(int estnns,
                          int maxnns)
      • recap

        public void recap(int newCap)
      • compact

        public void compact()
        In-place compaction of non-zero-entries; removes zero entries and shifts non-zero entries to the left if necessary.
      • set

        public boolean set(int col,
                           double v)
      • append

        public void append(int col,
                           double v)
      • get

        public double get(int col)
      • searchIndexesFirstLTE

        public int searchIndexesFirstLTE(int col)
      • searchIndexesFirstGTE

        public int searchIndexesFirstGTE(int col)
      • searchIndexesFirstGT

        public int searchIndexesFirstGT(int col)
      • deleteIndexRange

        public void deleteIndexRange(int lowerCol,
                                     int upperCol)
      • setIndexRange

        public void setIndexRange(int lowerCol,
                                  int upperCol,
                                  double[] v,
                                  int vix,
                                  int len)
        Inserts a dense vector into a column range; calling this methods helps to avoid repeated shifting of remaining values/indexes for every set value.
        lowerCol - lower column index
        upperCol - upper column index
        v - dense vector
        vix - ?
        len - ?
      • sort

        public void sort()
        In-place sort of column-index value pairs in order to allow binary search after constant-time append was used for reading unordered sparse rows. We first check if already sorted and subsequently sort if necessary in order to get O(n) bestcase. Note: In-place sort necessary in order to guarantee the memory estimate for operations that implicitly read that data set.

Copyright © 2017 The Apache Software Foundation. All rights reserved.