Package org.apache.sysds.runtime.data

## Class DataTensorBlock

- java.lang.Object
- - org.apache.sysds.runtime.data.DataTensorBlock

- All Implemented Interfaces:
    `Serializable`

      public class DataTensorBlock
      extends Object
      implements Serializable

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DataTensorBlock()` |
    `DataTensorBlock​(double val)` |
    `DataTensorBlock​(int ncols, Types.ValueType vt)` |
    `DataTensorBlock​(Types.ValueType[] schema)` |
    `DataTensorBlock​(Types.ValueType[] schema, int[] dims)` |
    `DataTensorBlock​(Types.ValueType[] schema, int[] dims, String[][] data)` |
    `DataTensorBlock​(Types.ValueType vt, int[] dims)` |
    `DataTensorBlock​(BasicTensorBlock that)` |
    `DataTensorBlock​(DataTensorBlock that)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DataTensorBlock` | `allocateBlock()` |
    `void` | `copy​(int[] lower, int[] upper, DataTensorBlock src)` | Copy a part of another `DataTensorBlock`
    `void` | `copy​(DataTensorBlock that)` |
    `Object` | `get​(int[] ix)` |
    `double` | `get​(int r, int c)` |
    `Types.ValueType` | `getColValueType​(int col)` |
    `int` | `getDim​(int i)` |
    `int[]` | `getDims()` |
    `long` | `getNonZeros()` |
    `int` | `getNumColumns()` |
    `int` | `getNumDims()` |
    `int` | `getNumRows()` |
    `Types.ValueType[]` | `getSchema()` |
    `boolean` | `isAllocated()` |
    `boolean` | `isEmpty​(boolean safe)` |
    `void` | `reset()` |
    `void` | `reset​(int[] dims)` |
    `void` | `reset​(int[] dims, Types.ValueType[] schema)` |
    `void` | `set​(int[] ix, Object v)` |
    `void` | `set​(int r, int c, double v)` |
    `void` | `set​(Object v)` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DataTensorBlock

          public DataTensorBlock()

    - #### DataTensorBlock

          public DataTensorBlock​(int ncols,
                                 Types.ValueType vt)

    - #### DataTensorBlock

          public DataTensorBlock​(Types.ValueType[] schema)

    - #### DataTensorBlock

          public DataTensorBlock​(Types.ValueType[] schema,
                                 int[] dims)

    - #### DataTensorBlock

          public DataTensorBlock​(Types.ValueType vt,
                                 int[] dims)

    - #### DataTensorBlock

          public DataTensorBlock​(Types.ValueType[] schema,
                                 int[] dims,
                                 String[][] data)

    - #### DataTensorBlock

          public DataTensorBlock​(double val)

    - #### DataTensorBlock

          public DataTensorBlock​(DataTensorBlock that)

    - #### DataTensorBlock

          public DataTensorBlock​(BasicTensorBlock that)

  - ### Method Detail

    - #### reset

          public void reset()

    - #### reset

          public void reset​(int[] dims)

    - #### reset

          public void reset​(int[] dims,
                            Types.ValueType[] schema)

    - #### allocateBlock

          public DataTensorBlock allocateBlock()

    - #### isAllocated

          public boolean isAllocated()

    - #### isEmpty

          public boolean isEmpty​(boolean safe)

    - #### getNonZeros

          public long getNonZeros()

    - #### getNumRows

          public int getNumRows()

    - #### getNumColumns

          public int getNumColumns()

    - #### getNumDims

          public int getNumDims()

    - #### getDim

          public int getDim​(int i)

    - #### getDims

          public int[] getDims()

    - #### getSchema

          public Types.ValueType[] getSchema()

    - #### getColValueType

          public Types.ValueType getColValueType​(int col)

    - #### get

          public Object get​(int[] ix)

    - #### get

          public double get​(int r,
                            int c)

    - #### set

          public void set​(Object v)

    - #### set

          public void set​(int[] ix,
                          Object v)

    - #### set

          public void set​(int r,
                          int c,
                          double v)

    - #### copy

          public void copy​(DataTensorBlock that)

    - #### copy

          public void copy​(int[] lower,
                           int[] upper,
                           DataTensorBlock src)

      Copy a part of another `DataTensorBlock`
      Parameters:
        `lower` - lower index of elements to copy (inclusive)
        `upper` - upper index of elements to copy (exclusive)
        `src` - source `DataTensorBlock`