Class BasicTensorBlock

    • Constructor Detail

      • 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​(double val)
      • BasicTensorBlock

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

      • 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 boolean allocateDenseBlock​(boolean clearNNZ)
      • allocateSparseBlock

        public boolean allocateSparseBlock()
      • allocateSparseBlock

        public boolean allocateSparseBlock​(boolean clearNNZ)
      • 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()
      • 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)
      • 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