Class BasicTensorBlock

java.lang.Object
org.apache.sysds.runtime.data.BasicTensorBlock
All Implemented Interfaces:
Serializable

public class BasicTensorBlock extends Object implements Serializable
See Also:
  • Field Details

  • Constructor Details

    • BasicTensorBlock

      public BasicTensorBlock()
    • BasicTensorBlock

      public BasicTensorBlock(Types.ValueType vt, int[] dims)
    • BasicTensorBlock

      public BasicTensorBlock(Types.ValueType vt, int[] dims, boolean sp)
    • BasicTensorBlock

      public BasicTensorBlock(Types.ValueType vt, int[] dims, boolean sp, long estnnz)
    • BasicTensorBlock

      public BasicTensorBlock(BasicTensorBlock that)
    • BasicTensorBlock

      public BasicTensorBlock(double val)
    • BasicTensorBlock

      public BasicTensorBlock(int[] dims, Types.ValueType vt, double val)
  • Method Details

    • getLength

      public long getLength()
    • reset

      public void reset()
    • reset

      public void reset(int[] dims)
    • reset

      public void reset(int[] dims, long estnnz)
    • reset

      public void reset(int[] dims, boolean sp)
    • reset

      public void reset(int[] dims, boolean sp, long estnnz)
    • recomputeNonZeros

      public long recomputeNonZeros()
      Recomputes and materializes the number of non-zero values of the entire basic tensor block.
      Returns:
      number of non-zeros
    • isAllocated

      public boolean isAllocated()
    • allocateDenseBlock

      public BasicTensorBlock allocateDenseBlock()
    • allocateBlock

      public BasicTensorBlock allocateBlock()
    • allocateDenseBlock

      public boolean allocateDenseBlock(boolean clearNNZ)
    • allocateSparseBlock

      public boolean allocateSparseBlock()
    • allocateSparseBlock

      public boolean allocateSparseBlock(boolean clearNNZ)
    • getValueType

      public Types.ValueType getValueType()
    • 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()
    • isSparse

      public boolean isSparse()
    • isEmpty

      public boolean isEmpty(boolean safe)
    • getDenseBlock

      public DenseBlock getDenseBlock()
    • getSparseBlock

      public SparseBlock getSparseBlock()
    • get

      public Object get(int[] ix)
    • get

      public double get(int r, int c)
    • set

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

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

      public void set(double v)
    • set

      public void set(Object v)
    • set

      public void set(BasicTensorBlock other)
    • set

      public void set(MatrixBlock other)
    • copy

      public void copy(BasicTensorBlock that)
    • copyShallow

      public BasicTensorBlock copyShallow(BasicTensorBlock that)
    • copy

      public void copy(int[] lower, int[] upper, BasicTensorBlock src)
      Copy a part of another BasicTensorBlock
      Parameters:
      lower - lower index of elements to copy (inclusive)
      upper - upper index of elements to copy (exclusive)
      src - source BasicTensorBlock
    • aggregateUnaryOperations

      public BasicTensorBlock aggregateUnaryOperations(AggregateUnaryOperator op, BasicTensorBlock result)
      Aggregate a unary operation on this tensor.
      Parameters:
      op - the operation to apply
      result - the result tensor
      Returns:
      the result tensor
    • incrementalAggregate

      public void incrementalAggregate(AggregateOperator aggOp, BasicTensorBlock partialResult)