Class DataBatch

    • Method Detail

      • from

        public static DataBatch from​(Factory2D<? extends Mutate2D.ModifiableReceiver<java.lang.Double>> factory,
                                     int batchSize,
                                     int dataNodes)
        With the batch size/capacity specified. The returned instance will throw an exception if too many rows are added to it.
      • addRow

        public void addRow​(Access1D<java.lang.Double> row)
      • addRows

        public void addRows​(java.util.Collection<? extends Access1D<java.lang.Double>> rows)
      • addRowWithSingleUnit

        public void addRowWithSingleUnit​(int unitIndex)
      • countColumns

        public long countColumns()
        Assumes all rows are of equal length and will only check the first. Returns 0 if there are no rows.
        Specified by:
        countColumns in interface Structure2D
        Returns:
        The number of columns
        See Also:
        Structure2D.countColumns()
      • countRows

        public long countRows()
        Description copied from interface: Structure2D
        Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.
        Specified by:
        countRows in interface Structure2D
        Returns:
        The number of rows
      • doubleValue

        public double doubleValue​(int row,
                                  int col)
        Description copied from interface: Access2D
        Extracts one element of this matrix as a double.
        Specified by:
        doubleValue in interface Access2D<java.lang.Double>
        Parameters:
        row - A row index.
        col - A column index.
        Returns:
        One matrix element
      • get

        public java.lang.Double get​(long row,
                                    long col)
        Specified by:
        get in interface Access2D<java.lang.Double>
      • getColDim

        public int getColDim()
        Specified by:
        getColDim in interface Structure2D
        Returns:
        The number of columns
      • getRowDim

        public int getRowDim()
        Specified by:
        getRowDim in interface Structure2D
        Returns:
        The number of rows
      • isFull

        public boolean isFull()
      • remaining

        public int remaining()
        Remaining capacity / batch entries / number of rows.
      • reset

        public void reset()