Package org.apache.sysds.runtime.data
Class BasicTensorBlock
- java.lang.Object
- 
- org.apache.sysds.runtime.data.BasicTensorBlock
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class BasicTensorBlock extends Object implements Serializable - See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static SparseBlock.TypeDEFAULT_SPARSEBLOCKstatic doubleSPARSITY_TURN_POINT
 - 
Constructor SummaryConstructors Constructor Description BasicTensorBlock()BasicTensorBlock(double val)BasicTensorBlock(int[] dims, Types.ValueType vt, double val)BasicTensorBlock(Types.ValueType vt, int[] dims)BasicTensorBlock(Types.ValueType vt, int[] dims, boolean sp)BasicTensorBlock(Types.ValueType vt, int[] dims, boolean sp, long estnnz)BasicTensorBlock(BasicTensorBlock that)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description BasicTensorBlockaggregateUnaryOperations(AggregateUnaryOperator op, BasicTensorBlock result)Aggregate a unary operation on this tensor.BasicTensorBlockallocateBlock()BasicTensorBlockallocateDenseBlock()booleanallocateDenseBlock(boolean clearNNZ)booleanallocateSparseBlock()booleanallocateSparseBlock(boolean clearNNZ)voidcopy(int[] lower, int[] upper, BasicTensorBlock src)Copy a part of anotherBasicTensorBlockvoidcopy(BasicTensorBlock that)BasicTensorBlockcopyShallow(BasicTensorBlock that)Objectget(int[] ix)doubleget(int r, int c)DenseBlockgetDenseBlock()intgetDim(int i)int[]getDims()longgetLength()longgetNonZeros()intgetNumColumns()intgetNumDims()intgetNumRows()SparseBlockgetSparseBlock()Types.ValueTypegetValueType()voidincrementalAggregate(AggregateOperator aggOp, BasicTensorBlock partialResult)booleanisAllocated()booleanisEmpty(boolean safe)booleanisSparse()longrecomputeNonZeros()Recomputes and materializes the number of non-zero values of the entire basic tensor block.voidreset()voidreset(int[] dims)voidreset(int[] dims, boolean sp)voidreset(int[] dims, boolean sp, long estnnz)voidreset(int[] dims, long estnnz)voidset(double v)voidset(int[] ix, Object v)voidset(int r, int c, double v)voidset(Object v)voidset(BasicTensorBlock other)voidset(MatrixBlock other)
 
- 
- 
- 
Field Detail- 
SPARSITY_TURN_POINTpublic static final double SPARSITY_TURN_POINT - See Also:
- Constant Field Values
 
 - 
DEFAULT_SPARSEBLOCKpublic static final SparseBlock.Type DEFAULT_SPARSEBLOCK 
 
- 
 - 
Constructor Detail- 
BasicTensorBlockpublic BasicTensorBlock() 
 - 
BasicTensorBlockpublic BasicTensorBlock(Types.ValueType vt, int[] dims) 
 - 
BasicTensorBlockpublic BasicTensorBlock(Types.ValueType vt, int[] dims, boolean sp) 
 - 
BasicTensorBlockpublic BasicTensorBlock(Types.ValueType vt, int[] dims, boolean sp, long estnnz) 
 - 
BasicTensorBlockpublic BasicTensorBlock(BasicTensorBlock that) 
 - 
BasicTensorBlockpublic BasicTensorBlock(double val) 
 - 
BasicTensorBlockpublic BasicTensorBlock(int[] dims, Types.ValueType vt, double val)
 
- 
 - 
Method Detail- 
getLengthpublic long getLength() 
 - 
resetpublic void reset() 
 - 
resetpublic void reset(int[] dims) 
 - 
resetpublic void reset(int[] dims, long estnnz)
 - 
resetpublic void reset(int[] dims, boolean sp)
 - 
resetpublic void reset(int[] dims, boolean sp, long estnnz)
 - 
recomputeNonZerospublic long recomputeNonZeros() Recomputes and materializes the number of non-zero values of the entire basic tensor block.- Returns:
- number of non-zeros
 
 - 
isAllocatedpublic boolean isAllocated() 
 - 
allocateDenseBlockpublic BasicTensorBlock allocateDenseBlock() 
 - 
allocateBlockpublic BasicTensorBlock allocateBlock() 
 - 
allocateDenseBlockpublic boolean allocateDenseBlock(boolean clearNNZ) 
 - 
allocateSparseBlockpublic boolean allocateSparseBlock() 
 - 
allocateSparseBlockpublic boolean allocateSparseBlock(boolean clearNNZ) 
 - 
getValueTypepublic Types.ValueType getValueType() 
 - 
getNonZerospublic long getNonZeros() 
 - 
getNumRowspublic int getNumRows() 
 - 
getNumColumnspublic int getNumColumns() 
 - 
getNumDimspublic int getNumDims() 
 - 
getDimpublic int getDim(int i) 
 - 
getDimspublic int[] getDims() 
 - 
isSparsepublic boolean isSparse() 
 - 
isEmptypublic boolean isEmpty(boolean safe) 
 - 
getDenseBlockpublic DenseBlock getDenseBlock() 
 - 
getSparseBlockpublic SparseBlock getSparseBlock() 
 - 
getpublic Object get(int[] ix) 
 - 
getpublic double get(int r, int c)
 - 
setpublic void set(int[] ix, Object v)
 - 
setpublic void set(int r, int c, double v)
 - 
setpublic void set(double v) 
 - 
setpublic void set(Object v) 
 - 
setpublic void set(BasicTensorBlock other) 
 - 
setpublic void set(MatrixBlock other) 
 - 
copypublic void copy(BasicTensorBlock that) 
 - 
copyShallowpublic BasicTensorBlock copyShallow(BasicTensorBlock that) 
 - 
copypublic void copy(int[] lower, int[] upper, BasicTensorBlock src)Copy a part of anotherBasicTensorBlock- Parameters:
- lower- lower index of elements to copy (inclusive)
- upper- upper index of elements to copy (exclusive)
- src- source- BasicTensorBlock
 
 - 
aggregateUnaryOperationspublic 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
 
 - 
incrementalAggregatepublic void incrementalAggregate(AggregateOperator aggOp, BasicTensorBlock partialResult) 
 
- 
 
-