public class CompressedMatrixBlock extends MatrixBlock
MatrixBlock.SparsityEstimateMatrixValue.CellIndexCONVERT_MCSR_TO_CSR_ON_DEEP_SERIALIZE, DEFAULT_INPLACE_SPARSEBLOCK, DEFAULT_SPARSEBLOCK, HEADER_SIZE, MAX_SHALLOW_SERIALIZE_OVERHEAD, SPARSITY_TURN_POINT, ULTRA_SPARSE_BLOCK_NNZ, ULTRA_SPARSITY_TURN_POINT, ULTRA_SPARSITY_TURN_POINT2| Constructor and Description | 
|---|
CompressedMatrixBlock()  | 
CompressedMatrixBlock(CompressedMatrixBlock that)
Copy constructor taking that CompressedMatrixBlock and populate this new compressedMatrixBlock with pointers to
 the same columnGroups. 
 | 
CompressedMatrixBlock(int rl,
                     int cl)
Main constructor for building a block from scratch. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
MatrixBlock | 
aggregateBinaryOperations(MatrixBlock m1,
                         MatrixBlock m2,
                         MatrixBlock ret,
                         AggregateBinaryOperator op)  | 
MatrixBlock | 
aggregateBinaryOperations(MatrixBlock m1,
                         MatrixBlock m2,
                         MatrixBlock ret,
                         AggregateBinaryOperator op,
                         boolean transposeLeft,
                         boolean transposeRight)  | 
MatrixBlock | 
aggregateTernaryOperations(MatrixBlock m1,
                          MatrixBlock m2,
                          MatrixBlock m3,
                          MatrixBlock ret,
                          AggregateTernaryOperator op,
                          boolean inCP)  | 
MatrixBlock | 
aggregateUnaryOperations(AggregateUnaryOperator op,
                        MatrixValue result,
                        int blen,
                        MatrixIndexes indexesIn,
                        boolean inCP)  | 
void | 
allocateAndResetSparseBlock(boolean clearNNZ,
                           SparseBlock.Type stype)  | 
Future<MatrixBlock> | 
allocateBlockAsync()  | 
void | 
allocateColGroup(AColGroup cg)
Allocate the given column group and remove all references to old column groups. 
 | 
void | 
allocateColGroupList(List<AColGroup> colGroups)
Replace the column groups in this CompressedMatrixBlock with the given column groups 
 | 
boolean | 
allocateDenseBlock(boolean clearNNZ)  | 
boolean | 
allocateSparseRowsBlock(boolean clearNNZ)  | 
MatrixBlock | 
append(MatrixBlock[] that,
      MatrixBlock ret,
      boolean cbind)  | 
void | 
append(MatrixValue v2,
      ArrayList<IndexedMatrixValue> outlist,
      int blen,
      boolean cbind,
      boolean m2IsLast,
      int nextNCol)  | 
void | 
appendRow(int r,
         SparseRow row,
         boolean deep)  | 
void | 
appendRowToSparse(SparseBlock dest,
                 MatrixBlock src,
                 int i,
                 int rowoffset,
                 int coloffset,
                 boolean deep)  | 
void | 
appendToSparse(MatrixBlock that,
              int rowoffset,
              int coloffset,
              boolean deep)  | 
void | 
appendValue(int r,
           int c,
           double v)
Append value is only used when values are appended at the end of each row for the sparse representation
 This can only be called, when the caller knows the access pattern of the block 
 | 
void | 
appendValuePlain(int r,
                int c,
                double v)  | 
static long | 
baseSizeInMemory()  | 
MatrixBlock | 
binaryOperations(BinaryOperator op,
                MatrixValue thatValue,
                MatrixValue result)  | 
MatrixBlock | 
binaryOperationsInPlace(BinaryOperator op,
                       MatrixValue thatValue)  | 
MatrixBlock | 
binaryOperationsLeft(BinaryOperator op,
                    MatrixValue thatValue,
                    MatrixValue result)  | 
MatrixBlock | 
chainMatrixMultOperations(MatrixBlock v,
                         MatrixBlock w,
                         MatrixBlock out,
                         MapMultChain.ChainType ctype,
                         int k)  | 
void | 
checkNaN()
Checks for existing NaN values in the matrix block. 
 | 
void | 
clearSoftReferenceToDecompressed()  | 
CM_COV_Object | 
cmOperations(CMOperator op)  | 
CM_COV_Object | 
cmOperations(CMOperator op,
            MatrixBlock weights)  | 
MatrixBlock | 
colSum()
Wrapper method for single threaded reduceall-colSum of a matrix. 
 | 
void | 
compactEmptyBlock()
Free unnecessarily allocated empty block. 
 | 
boolean | 
containsValue(double pattern)  | 
void | 
copy(int rl,
    int ru,
    int cl,
    int cu,
    MatrixBlock src,
    boolean awareDestNZ)
In-place copy of matrix src into the index range of the existing current matrix. 
 | 
void | 
copy(MatrixValue thatValue)
Copy that MatrixValue into this MatrixValue. 
 | 
void | 
copy(MatrixValue thatValue,
    boolean sp)
Copy that MatrixValue into this MatrixValue. 
 | 
MatrixBlock | 
copyShallow(MatrixBlock that)  | 
CM_COV_Object | 
covOperations(COVOperator op,
             MatrixBlock that)  | 
CM_COV_Object | 
covOperations(COVOperator op,
             MatrixBlock that,
             MatrixBlock weights)  | 
void | 
ctableOperations(Operator op,
                double scalar,
                double scalar2,
                CTableMap resultMap,
                MatrixBlock resultBlock)
D = ctable(A,v2,w)
  this <- A; scalar_that <- v2; scalar_that2 <- w; result <- D
  
 (i1,j1,v1) from input1 (this)
 (v2) from sclar_input2 (scalarThat)
 (w)  from scalar_input3 (scalarThat2) 
 | 
void | 
ctableOperations(Operator op,
                double scalar,
                MatrixValue that,
                CTableMap resultMap,
                MatrixBlock resultBlock)
D = ctable(A,v2,W)
  this <- A; scalarThat <- v2; that2 <- W; result <- D
  
 (i1,j1,v1) from input1 (this)
 (v2) from sclar_input2 (scalarThat)
 (i3,j3,w)  from input3 (that2) 
 | 
void | 
ctableOperations(Operator op,
                MatrixIndexes ix1,
                double scalar,
                boolean left,
                int brlen,
                CTableMap resultMap,
                MatrixBlock resultBlock)
Specific ctable case of ctable(seq(...),X), where X is the only
 matrix input. 
 | 
void | 
ctableOperations(Operator op,
                MatrixValue that,
                double scalar,
                boolean ignoreZeros,
                CTableMap resultMap,
                MatrixBlock resultBlock)
D = ctable(A,B,w)
  this <- A; that <- B; scalar_that2 <- w; result <- D
  
 (i1,j1,v1) from input1 (this)
 (i1,j1,v2) from input2 (that)
 (w)  from scalar_input3 (scalarThat2)
 
 NOTE: This method supports both vectors and matrices. 
 | 
void | 
ctableOperations(Operator op,
                MatrixValue that,
                MatrixValue that2,
                CTableMap resultMap,
                MatrixBlock resultBlock)  | 
MatrixBlock | 
ctableSeqOperations(MatrixValue thatMatrix,
                   double thatScalar,
                   MatrixBlock resultBlock,
                   boolean updateClen)  | 
MatrixBlock | 
decompress()
Decompress block into a MatrixBlock 
 | 
MatrixBlock | 
decompress(int k)
Decompress block into a MatrixBlock 
 | 
void | 
dropLastRowsOrColumns(Types.CorrectionLocationType correctionLocation)  | 
long | 
estimateCompressedSizeInMemory()
Obtain an upper bound on the memory used to store the compressed block. 
 | 
long | 
estimateSizeInMemory()  | 
long | 
estimateSizeOnDisk()  | 
boolean | 
evalSparseFormatInMemory()
Evaluates if this matrix block should be in sparse format in
 memory. 
 | 
boolean | 
evalSparseFormatOnDisk()
Evaluates if this matrix block should be in sparse format on
 disk. 
 | 
void | 
examSparsity(boolean allowCSR)
Evaluates if this matrix block should be in sparse format in
 memory. 
 | 
MatrixBlock | 
extractTriangular(MatrixBlock ret,
                 boolean lower,
                 boolean diag,
                 boolean values)  | 
MatrixBlock | 
getCachedDecompressed()
Get the cached decompressed matrix (if it exists otherwise null). 
 | 
List<AColGroup> | 
getColGroups()
Get the column groups of this CompressedMatrixBlock 
 | 
DenseBlock | 
getDenseBlock()  | 
double[] | 
getDenseBlockValues()  | 
long | 
getExactSizeOnDisk()
NOTE: The used estimates must be kept consistent with the respective write functions. 
 | 
long | 
getInMemorySize()
Get the in-memory size in bytes of the cache block. 
 | 
SoftReference<MatrixBlock> | 
getSoftReferenceToDecompressed()  | 
SparseBlock | 
getSparseBlock()  | 
Iterator<IJV> | 
getSparseBlockIterator()  | 
Iterator<IJV> | 
getSparseBlockIterator(int rl,
                      int ru)  | 
MatrixBlock | 
getUncompressed()  | 
static MatrixBlock | 
getUncompressed(MatrixValue mVal)  | 
static MatrixBlock | 
getUncompressed(MatrixValue mVal,
               String message)  | 
MatrixBlock | 
getUncompressed(String operation)  | 
ColGroupUncompressed | 
getUncompressedColGroup()  | 
double | 
getValueDenseUnsafe(int r,
                   int c)  | 
MatrixBlock | 
groupedAggOperations(MatrixValue tgt,
                    MatrixValue wghts,
                    MatrixValue ret,
                    int ngroups,
                    Operator op,
                    int k)  | 
void | 
incrementalAggregate(AggregateOperator aggOp,
                    MatrixValue newWithCorrection)  | 
void | 
incrementalAggregate(AggregateOperator aggOp,
                    MatrixValue correction,
                    MatrixValue newWithCorrection,
                    boolean deep)  | 
void | 
init(double[][] arr,
    int r,
    int c)
NOTE: This method is designed only for dense representation. 
 | 
void | 
init(double[] arr,
    int r,
    int c)
NOTE: This method is designed only for dense representation. 
 | 
double | 
interQuartileMean()  | 
boolean | 
isAllocated()  | 
boolean | 
isEmptyBlock(boolean safe)  | 
boolean | 
isInSparseFormat()
Returns the current representation (true for sparse). 
 | 
boolean | 
isOverlapping()  | 
boolean | 
isShallowSerialize(boolean inclConvert)
Indicates if the cache block is subject to shallow serialized,
 which is generally true if in-memory size and serialized size
 are almost identical allowing to avoid unnecessary deep serialize. 
 | 
boolean | 
isSparsePermutationMatrix()  | 
boolean | 
isThreadSafe()
Indicates if concurrent modifications of disjoint rows are thread-safe. 
 | 
boolean | 
isUltraSparse()  | 
boolean | 
isUltraSparse(boolean checkNnz)  | 
MatrixBlock | 
leftIndexingOperations(MatrixBlock rhsMatrix,
                      int rl,
                      int ru,
                      int cl,
                      int cu,
                      MatrixBlock ret,
                      MatrixObject.UpdateType update)  | 
MatrixBlock | 
leftIndexingOperations(ScalarObject scalar,
                      int rl,
                      int cl,
                      MatrixBlock ret,
                      MatrixObject.UpdateType update)
Explicitly allow left indexing for scalars. 
 | 
double | 
max()
Wrapper method for reduceall-max of a matrix. 
 | 
double | 
mean()
Wrapper method for reduceall-mean of a matrix. 
 | 
void | 
merge(MatrixBlock that,
     boolean appendOnly,
     boolean par,
     boolean deep)  | 
double | 
min()
Wrapper method for reduceall-min of a matrix. 
 | 
double | 
minNonZero()
Utility function for computing the min non-zero value. 
 | 
void | 
permutationMatrixMultOperations(MatrixValue m2Val,
                               MatrixValue out1Val,
                               MatrixValue out2Val,
                               int k)  | 
double | 
pickValue(double quantile,
         boolean average)  | 
MatrixBlock | 
pickValues(MatrixValue quantiles,
          MatrixValue ret)  | 
double | 
prod()
Wrapper method for reduceall-product of a matrix. 
 | 
MatrixBlock | 
quaternaryOperations(QuaternaryOperator qop,
                    MatrixBlock um,
                    MatrixBlock vm,
                    MatrixBlock wm,
                    MatrixBlock out,
                    int k)  | 
double | 
quickGetValue(int r,
             int c)  | 
double | 
quickGetValueThreadSafe(int r,
                       int c)  | 
void | 
quickSetValue(int r,
             int c,
             double v)  | 
MatrixBlock | 
randOperationsInPlace(RandomMatrixGenerator rgen,
                     org.apache.commons.math3.random.Well1024a bigrand,
                     long bSeed)
Function to generate a matrix of random numbers. 
 | 
MatrixBlock | 
randOperationsInPlace(RandomMatrixGenerator rgen,
                     org.apache.commons.math3.random.Well1024a bigrand,
                     long bSeed,
                     int k)
Function to generate a matrix of random numbers. 
 | 
void | 
readExternal(ObjectInput is)
Redirects the default java serialization via externalizable to our default hadoop writable serialization for
 efficient broadcast/rdd de-serialization. 
 | 
void | 
readFields(DataInput in)  | 
long | 
recomputeNonZeros()
Recomputes and materializes the number of non-zero values
 of the entire matrix block. 
 | 
long | 
recomputeNonZeros(int rl,
                 int ru)  | 
long | 
recomputeNonZeros(int rl,
                 int ru,
                 int cl,
                 int cu)
Recomputes the number of non-zero values of a specified 
 range of the matrix block. 
 | 
MatrixBlock | 
removeEmptyOperations(MatrixBlock ret,
                     boolean rows,
                     boolean emptyReturn,
                     MatrixBlock select)  | 
MatrixBlock | 
reorgOperations(ReorgOperator op,
               MatrixValue ret,
               int startRow,
               int startColumn,
               int length)  | 
MatrixBlock | 
replaceOperations(MatrixValue result,
                 double pattern,
                 double replacement)  | 
void | 
reset(int rl,
     int cl,
     boolean sp,
     long estnnz,
     double val)
Internal canonical reset of dense and sparse matrix blocks. 
 | 
MatrixBlock | 
rexpandOperations(MatrixBlock ret,
                 double max,
                 boolean rows,
                 boolean cast,
                 boolean ignore,
                 int k)  | 
MatrixBlock | 
scalarOperations(ScalarOperator sop,
                MatrixValue result)  | 
MatrixBlock | 
seqOperationsInPlace(double from,
                    double to,
                    double incr)  | 
void | 
setDenseBlock(DenseBlock dblock)  | 
void | 
setOverlapping(boolean overlapping)  | 
void | 
setSparseBlock(SparseBlock sblock)  | 
void | 
slice(ArrayList<IndexedMatrixValue> outlist,
     IndexRange range,
     int rowCut,
     int colCut,
     int blen,
     int boundaryRlen,
     int boundaryClen)
Slice out up to 4 matrixBlocks that are separated by the row and col Cuts. 
 | 
MatrixBlock | 
slice(int rl,
     int ru,
     int cl,
     int cu,
     boolean deep,
     CacheBlock ret)
Method to perform rightIndex operation for a given lower and upper bounds in row and column dimensions. 
 | 
MatrixBlock | 
sortOperations(MatrixValue weights,
              MatrixBlock result)  | 
void | 
sortSparseRows()
Sorts all existing sparse rows by column indexes. 
 | 
void | 
sortSparseRows(int rl,
              int ru)
Sorts all existing sparse rows in range [rl,ru) by 
 column indexes. 
 | 
void | 
sparseToDense()  | 
CompressedMatrixBlock | 
squash(int k)  | 
double | 
sum()
Wrapper method for reduceall-sum of a matrix. 
 | 
double | 
sumSq()
Wrapper method for reduceall-sumSq of a matrix. 
 | 
double | 
sumWeightForQuantile()
In a given two column matrix, the second column denotes weights. 
 | 
MatrixBlock | 
ternaryOperations(TernaryOperator op,
                 MatrixBlock m2,
                 MatrixBlock m3,
                 MatrixBlock ret)  | 
void | 
toShallowSerializeBlock()
Converts a cache block that is not shallow serializable into
 a form that is shallow serializable. 
 | 
String | 
toString()  | 
MatrixBlock | 
transposeSelfMatrixMultOperations(MatrixBlock out,
                                 MMTSJ.MMTSJType tstype,
                                 int k)  | 
MatrixBlock | 
uaggouterchainOperations(MatrixBlock mbLeft,
                        MatrixBlock mbRight,
                        MatrixBlock mbOut,
                        BinaryOperator bOp,
                        AggregateUnaryOperator uaggOp)  | 
MatrixBlock | 
unaryOperations(UnaryOperator op,
               MatrixValue result)  | 
void | 
write(DataOutput out)  | 
void | 
writeExternal(ObjectOutput os)
Redirects the default java serialization via externalizable to our default hadoop writable serialization for
 efficient broadcast/rdd serialization. 
 | 
MatrixBlock | 
zeroOutOperations(MatrixValue result,
                 IndexRange range,
                 boolean complementary)  | 
aggregateBinaryOperations, aggregateUnaryOperations, allocateBlock, allocateDenseBlock, allocateDenseBlockUnsafe, allocateSparseRowsBlock, append, append, appendRow, appendToSparse, binaryOperations, chainMatrixMultOperations, checkDimensionsForAppend, checkNonZeros, checkSparseRows, checkSparseRows, cleanupBlock, compareTo, computeIQMCorrection, ctableOperations, ctableSeqOperations, denseToSparse, equals, estimateSizeDenseInMemory, estimateSizeInMemory, estimateSizeOnDisk, estimateSizeSparseInMemory, estimateSizeSparseInMemory, estimateSparsityOnAggBinary, evalSparseFormatInMemory, evalSparseFormatInMemory, evalSparseFormatOnDisk, examSparsity, getDataCharacteristics, getDouble, getDoubleNaN, getExactSerializedSize, getHeaderSize, getLength, getNonZeros, getNumColumns, getNumRows, getSparsity, getString, getValue, groupedAggOperations, hashCode, isEmpty, isEmptyBlock, isShallowSerialize, isThreadSafe, isVector, leftIndexingOperations, median, merge, merge, merge, naryOperations, permutationMatrixMultOperations, pickValue, prepareAggregateUnaryOutput, quaternaryOperations, randOperations, randOperations, randOperations, randOperations, removeEmptyOperations, reset, reset, reset, reset, reset, reset, rowSum, rowSum, sampleOperations, seqOperations, setNonZeros, setNumColumns, setNumRows, setValue, slice, slice, slice, slice, slice, slice, sortOperations, sortOperations, transposeSelfMatrixMultOperationspublic CompressedMatrixBlock()
public CompressedMatrixBlock(int rl,
                             int cl)
rl - number of rows in the blockcl - number of columnspublic CompressedMatrixBlock(CompressedMatrixBlock that)
that - CompressedMatrixBlock to copy values frompublic void reset(int rl,
                  int cl,
                  boolean sp,
                  long estnnz,
                  double val)
MatrixBlockreset in class MatrixBlockrl - number of rowscl - number of columnssp - sparse representationestnnz - estimated number of non-zerosval - initialization valuepublic void allocateColGroup(AColGroup cg)
cg - The column group to use after.public void allocateColGroupList(List<AColGroup> colGroups)
colGroups - new ColGroups in the MatrixBlockpublic List<AColGroup> getColGroups()
public MatrixBlock decompress()
public MatrixBlock decompress(int k)
k - degree of parallelismpublic MatrixBlock getCachedDecompressed()
public CompressedMatrixBlock squash(int k)
public long recomputeNonZeros()
MatrixBlockrecomputeNonZeros in class MatrixBlockpublic long recomputeNonZeros(int rl,
                              int ru)
recomputeNonZeros in class MatrixBlockpublic long recomputeNonZeros(int rl,
                              int ru,
                              int cl,
                              int cu)
MatrixBlockrecomputeNonZeros in class MatrixBlockrl - row lower index, 0-based, inclusiveru - row upper index, 0-based, inclusivecl - column lower index, 0-based, inclusivecu - column upper index, 0-based, inclusivepublic long getInMemorySize()
CacheBlockgetInMemorySize in interface CacheBlockgetInMemorySize in class MatrixBlockpublic long estimateSizeInMemory()
estimateSizeInMemory in class MatrixBlockpublic long estimateCompressedSizeInMemory()
public static long baseSizeInMemory()
public double quickGetValue(int r,
                            int c)
quickGetValue in class MatrixBlockpublic long getExactSizeOnDisk()
MatrixBlockgetExactSizeOnDisk in class MatrixBlockpublic long estimateSizeOnDisk()
estimateSizeOnDisk in class MatrixBlockpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritablereadFields in class MatrixBlockIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.Writablewrite in class MatrixBlockIOExceptionpublic void readExternal(ObjectInput is) throws IOException
readExternal in interface ExternalizablereadExternal in class MatrixBlockis - object inputIOException - if IOException occurspublic void writeExternal(ObjectOutput os) throws IOException
writeExternal in interface ExternalizablewriteExternal in class MatrixBlockos - object outputIOException - if IOException occurspublic MatrixBlock scalarOperations(ScalarOperator sop, MatrixValue result)
scalarOperations in class MatrixBlockpublic MatrixBlock binaryOperations(BinaryOperator op, MatrixValue thatValue, MatrixValue result)
binaryOperations in class MatrixBlockpublic MatrixBlock binaryOperationsLeft(BinaryOperator op, MatrixValue thatValue, MatrixValue result)
public MatrixBlock append(MatrixBlock[] that, MatrixBlock ret, boolean cbind)
append in class MatrixBlockpublic void append(MatrixValue v2, ArrayList<IndexedMatrixValue> outlist, int blen, boolean cbind, boolean m2IsLast, int nextNCol)
append in class MatrixBlockpublic MatrixBlock chainMatrixMultOperations(MatrixBlock v, MatrixBlock w, MatrixBlock out, MapMultChain.ChainType ctype, int k)
chainMatrixMultOperations in class MatrixBlockpublic MatrixBlock aggregateBinaryOperations(MatrixBlock m1, MatrixBlock m2, MatrixBlock ret, AggregateBinaryOperator op)
aggregateBinaryOperations in class MatrixBlockpublic MatrixBlock aggregateBinaryOperations(MatrixBlock m1, MatrixBlock m2, MatrixBlock ret, AggregateBinaryOperator op, boolean transposeLeft, boolean transposeRight)
public MatrixBlock aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result, int blen, MatrixIndexes indexesIn, boolean inCP)
aggregateUnaryOperations in class MatrixBlockpublic MatrixBlock transposeSelfMatrixMultOperations(MatrixBlock out, MMTSJ.MMTSJType tstype, int k)
transposeSelfMatrixMultOperations in class MatrixBlockpublic MatrixBlock replaceOperations(MatrixValue result, double pattern, double replacement)
replaceOperations in class MatrixBlockpublic MatrixBlock reorgOperations(ReorgOperator op, MatrixValue ret, int startRow, int startColumn, int length)
reorgOperations in class MatrixBlockpublic ColGroupUncompressed getUncompressedColGroup()
public String toString()
toString in class MatrixBlockpublic boolean isOverlapping()
public void setOverlapping(boolean overlapping)
public MatrixBlock slice(int rl, int ru, int cl, int cu, boolean deep, CacheBlock ret)
MatrixBlockslice in interface CacheBlockslice in class MatrixBlockrl - row lower if this value is bellow 0 or above the number of rows contained in the matrix an execption is thrownru - row upper if this value is bellow rl or above the number of rows contained in the matrix an exception is throwncl - column lower if this value us bellow 0 or above the number of columns contained in the matrix an exception is throwncu - column upper if this value us bellow cl or above the number of columns contained in the matrix an exception is throwndeep - should perform deep copy, this is relelvant in cases where the matrix is in sparse format,
            or the entire matrix is sliced outret - output sliced out matrix blockpublic void slice(ArrayList<IndexedMatrixValue> outlist, IndexRange range, int rowCut, int colCut, int blen, int boundaryRlen, int boundaryClen)
MatrixValueslice in class MatrixBlockoutlist - The output matrix blocks that is extracted from the matrixrange - An index range containing overlapping information.rowCut - The row to cut and split the matrix.colCut - The column to cut ans split the matrix.blen - The Block size of the output matrices.boundaryRlen - The row length of the edge case matrix block, used for the final blocks
                     that does not have enough rows to construct a full block.boundaryClen - The col length of the edge case matrix block, used for the final blocks
                     that does not have enough cols to construct a full block.public MatrixBlock unaryOperations(UnaryOperator op, MatrixValue result)
unaryOperations in class MatrixBlockpublic boolean containsValue(double pattern)
containsValue in class MatrixBlockpublic double max()
MatrixBlockmax in class MatrixBlockpublic double min()
MatrixBlockmin in class MatrixBlockpublic double sum()
MatrixBlocksum in class MatrixBlockpublic MatrixBlock colSum()
MatrixBlockcolSum in class MatrixBlockpublic double sumSq()
MatrixBlocksumSq in class MatrixBlockpublic double prod()
MatrixBlockprod in class MatrixBlockpublic double mean()
MatrixBlockmean in class MatrixBlockpublic MatrixBlock rexpandOperations(MatrixBlock ret, double max, boolean rows, boolean cast, boolean ignore, int k)
rexpandOperations in class MatrixBlockpublic boolean isEmptyBlock(boolean safe)
isEmptyBlock in class MatrixBlockpublic MatrixBlock binaryOperationsInPlace(BinaryOperator op, MatrixValue thatValue)
binaryOperationsInPlace in class MatrixBlockpublic void incrementalAggregate(AggregateOperator aggOp, MatrixValue correction, MatrixValue newWithCorrection, boolean deep)
incrementalAggregate in class MatrixBlockpublic void incrementalAggregate(AggregateOperator aggOp, MatrixValue newWithCorrection)
incrementalAggregate in class MatrixBlockpublic void permutationMatrixMultOperations(MatrixValue m2Val, MatrixValue out1Val, MatrixValue out2Val, int k)
permutationMatrixMultOperations in class MatrixBlockpublic MatrixBlock leftIndexingOperations(MatrixBlock rhsMatrix, int rl, int ru, int cl, int cu, MatrixBlock ret, MatrixObject.UpdateType update)
leftIndexingOperations in class MatrixBlockpublic MatrixBlock leftIndexingOperations(ScalarObject scalar, int rl, int cl, MatrixBlock ret, MatrixObject.UpdateType update)
MatrixBlockleftIndexingOperations in class MatrixBlockscalar - scalar objectrl - row lowercl - column lowerret - ?update - ?public MatrixBlock zeroOutOperations(MatrixValue result, IndexRange range, boolean complementary)
zeroOutOperations in class MatrixBlockpublic CM_COV_Object cmOperations(CMOperator op)
cmOperations in class MatrixBlockpublic CM_COV_Object cmOperations(CMOperator op, MatrixBlock weights)
cmOperations in class MatrixBlockpublic CM_COV_Object covOperations(COVOperator op, MatrixBlock that)
covOperations in class MatrixBlockpublic CM_COV_Object covOperations(COVOperator op, MatrixBlock that, MatrixBlock weights)
covOperations in class MatrixBlockpublic MatrixBlock sortOperations(MatrixValue weights, MatrixBlock result)
sortOperations in class MatrixBlockpublic MatrixBlock aggregateTernaryOperations(MatrixBlock m1, MatrixBlock m2, MatrixBlock m3, MatrixBlock ret, AggregateTernaryOperator op, boolean inCP)
aggregateTernaryOperations in class MatrixBlockpublic MatrixBlock uaggouterchainOperations(MatrixBlock mbLeft, MatrixBlock mbRight, MatrixBlock mbOut, BinaryOperator bOp, AggregateUnaryOperator uaggOp)
uaggouterchainOperations in class MatrixBlockpublic MatrixBlock groupedAggOperations(MatrixValue tgt, MatrixValue wghts, MatrixValue ret, int ngroups, Operator op, int k)
groupedAggOperations in class MatrixBlockpublic MatrixBlock removeEmptyOperations(MatrixBlock ret, boolean rows, boolean emptyReturn, MatrixBlock select)
removeEmptyOperations in class MatrixBlockpublic void ctableOperations(Operator op, double scalar, MatrixValue that, CTableMap resultMap, MatrixBlock resultBlock)
MatrixBlockctableOperations in class MatrixBlockpublic void ctableOperations(Operator op, double scalar, double scalar2, CTableMap resultMap, MatrixBlock resultBlock)
MatrixBlockctableOperations in class MatrixBlockpublic void ctableOperations(Operator op, MatrixIndexes ix1, double scalar, boolean left, int brlen, CTableMap resultMap, MatrixBlock resultBlock)
MatrixBlockctableOperations in class MatrixBlockpublic void ctableOperations(Operator op, MatrixValue that, double scalar, boolean ignoreZeros, CTableMap resultMap, MatrixBlock resultBlock)
MatrixBlockctableOperations in class MatrixBlockpublic MatrixBlock ctableSeqOperations(MatrixValue thatMatrix, double thatScalar, MatrixBlock resultBlock, boolean updateClen)
ctableSeqOperations in class MatrixBlockthatMatrix - matrix valuethatScalar - scalar doubleresultBlock - result matrix blockupdateClen - when this matrix already has the desired number of columns updateClen can be set to falsepublic void ctableOperations(Operator op, MatrixValue that, MatrixValue that2, CTableMap resultMap, MatrixBlock resultBlock)
ctableOperations in class MatrixBlockpublic MatrixBlock ternaryOperations(TernaryOperator op, MatrixBlock m2, MatrixBlock m3, MatrixBlock ret)
ternaryOperations in class MatrixBlockpublic MatrixBlock quaternaryOperations(QuaternaryOperator qop, MatrixBlock um, MatrixBlock vm, MatrixBlock wm, MatrixBlock out, int k)
quaternaryOperations in class MatrixBlockpublic MatrixBlock randOperationsInPlace(RandomMatrixGenerator rgen, org.apache.commons.math3.random.Well1024a bigrand, long bSeed)
MatrixBlockbigrand is passed so that block-level
 seeds are generated internally. In case of MR, it generates a single
 block for given block-level seed bSeed.
 
 When pdf="uniform", cell values are drawn from uniform distribution in
 range [min,max].
 
 When pdf="normal", cell values are drawn from standard normal
 distribution N(0,1). The range of generated values will always be
 (-Inf,+Inf).randOperationsInPlace in class MatrixBlockrgen - random matrix generatorbigrand - ?bSeed - seed valuepublic MatrixBlock randOperationsInPlace(RandomMatrixGenerator rgen, org.apache.commons.math3.random.Well1024a bigrand, long bSeed, int k)
MatrixBlockbigrand is passed so that block-level
 seeds are generated internally. In case of MR, it generates a single
 block for given block-level seed bSeed.
 
 When pdf="uniform", cell values are drawn from uniform distribution in
 range [min,max].
 
 When pdf="normal", cell values are drawn from standard normal
 distribution N(0,1). The range of generated values will always be
 (-Inf,+Inf).randOperationsInPlace in class MatrixBlockrgen - random matrix generatorbigrand - ?bSeed - seed valuek - ?public MatrixBlock seqOperationsInPlace(double from, double to, double incr)
seqOperationsInPlace in class MatrixBlockpublic static MatrixBlock getUncompressed(MatrixValue mVal)
public static MatrixBlock getUncompressed(MatrixValue mVal, String message)
public MatrixBlock getUncompressed()
public MatrixBlock getUncompressed(String operation)
public boolean isShallowSerialize(boolean inclConvert)
CacheBlockisShallowSerialize in interface CacheBlockisShallowSerialize in class MatrixBlockinclConvert - if true report blocks as shallow serialize that are
 currently not amenable but can be brought into an amenable form
 via toShallowSerializeBlock.public void toShallowSerializeBlock()
CacheBlocktoShallowSerializeBlock in interface CacheBlocktoShallowSerializeBlock in class MatrixBlockpublic void copy(MatrixValue thatValue)
MatrixValuecopy in class MatrixBlockthatValue - object to copy the values into.public void copy(MatrixValue thatValue, boolean sp)
MatrixValuecopy in class MatrixBlockthatValue - object to copy the values into.sp - boolean specifying if output should be forced sparse or dense. (only applicable if the 'that' is a MatrixBlock)public MatrixBlock copyShallow(MatrixBlock that)
copyShallow in class MatrixBlockpublic void copy(int rl,
                 int ru,
                 int cl,
                 int cu,
                 MatrixBlock src,
                 boolean awareDestNZ)
MatrixBlockcopy in class MatrixBlockrl - row lower index, 0-basedru - row upper index, 0-based, inclusivecl - column lower index, 0-basedcu - column upper index, 0-based, inclusivesrc - matrix blockawareDestNZ - true, forces (1) to remove existing non-zeros in the index range of the 
                 destination if not present in src and (2) to internally maintain nnz
           false, assume empty index range in destination and do not maintain nnz
                  (the invoker is responsible to recompute nnz after all copies are done)public SoftReference<MatrixBlock> getSoftReferenceToDecompressed()
public void clearSoftReferenceToDecompressed()
public DenseBlock getDenseBlock()
getDenseBlock in class MatrixBlockpublic void setDenseBlock(DenseBlock dblock)
setDenseBlock in class MatrixBlockpublic double[] getDenseBlockValues()
getDenseBlockValues in class MatrixBlockpublic SparseBlock getSparseBlock()
getSparseBlock in class MatrixBlockpublic void setSparseBlock(SparseBlock sblock)
setSparseBlock in class MatrixBlockpublic Iterator<IJV> getSparseBlockIterator()
getSparseBlockIterator in class MatrixBlockpublic Iterator<IJV> getSparseBlockIterator(int rl, int ru)
getSparseBlockIterator in class MatrixBlockpublic void quickSetValue(int r,
                          int c,
                          double v)
quickSetValue in class MatrixBlockpublic double quickGetValueThreadSafe(int r,
                                      int c)
quickGetValueThreadSafe in class MatrixBlockpublic double getValueDenseUnsafe(int r,
                                  int c)
getValueDenseUnsafe in class MatrixBlockpublic void appendValue(int r,
                        int c,
                        double v)
MatrixBlockappendValue in class MatrixBlockr - rowc - columnv - valuepublic void appendValuePlain(int r,
                             int c,
                             double v)
appendValuePlain in class MatrixBlockpublic void appendRow(int r,
                      SparseRow row,
                      boolean deep)
appendRow in class MatrixBlockpublic void appendToSparse(MatrixBlock that, int rowoffset, int coloffset, boolean deep)
appendToSparse in class MatrixBlockpublic void appendRowToSparse(SparseBlock dest, MatrixBlock src, int i, int rowoffset, int coloffset, boolean deep)
appendRowToSparse in class MatrixBlockpublic void sortSparseRows()
MatrixBlocksortSparseRows in class MatrixBlockpublic void sortSparseRows(int rl,
                           int ru)
MatrixBlocksortSparseRows in class MatrixBlockrl - row lower bound, inclusiveru - row upper bound, exclusivepublic double minNonZero()
MatrixBlockminNonZero in class MatrixBlockpublic boolean isInSparseFormat()
MatrixBlockisInSparseFormat in class MatrixBlockpublic boolean isUltraSparse()
isUltraSparse in class MatrixBlockpublic boolean isUltraSparse(boolean checkNnz)
isUltraSparse in class MatrixBlockpublic boolean isSparsePermutationMatrix()
isSparsePermutationMatrix in class MatrixBlockpublic boolean evalSparseFormatInMemory()
MatrixBlockevalSparseFormatInMemory in class MatrixBlockpublic boolean evalSparseFormatOnDisk()
MatrixBlockevalSparseFormatOnDisk in class MatrixBlockpublic void examSparsity(boolean allowCSR)
MatrixBlockexamSparsity in class MatrixBlockallowCSR - allow CSR format on dense to sparse conversionpublic void sparseToDense()
sparseToDense in class MatrixBlockpublic void merge(MatrixBlock that, boolean appendOnly, boolean par, boolean deep)
merge in class MatrixBlockpublic void compactEmptyBlock()
CacheBlockcompactEmptyBlock in interface CacheBlockcompactEmptyBlock in class MatrixBlockpublic void dropLastRowsOrColumns(Types.CorrectionLocationType correctionLocation)
dropLastRowsOrColumns in class MatrixBlockpublic double interQuartileMean()
interQuartileMean in class MatrixBlockpublic MatrixBlock pickValues(MatrixValue quantiles, MatrixValue ret)
pickValues in class MatrixBlockpublic double pickValue(double quantile,
                        boolean average)
pickValue in class MatrixBlockpublic double sumWeightForQuantile()
MatrixBlocksumWeightForQuantile in class MatrixBlockpublic MatrixBlock extractTriangular(MatrixBlock ret, boolean lower, boolean diag, boolean values)
extractTriangular in class MatrixBlockpublic boolean isThreadSafe()
MatrixBlockisThreadSafe in class MatrixBlockpublic void checkNaN()
MatrixBlockcheckNaN in class MatrixBlockpublic void init(double[][] arr,
                 int r,
                 int c)
MatrixBlockinit in class MatrixBlockarr - 2d double array matrixr - number of rowsc - number of columnspublic void init(double[] arr,
                 int r,
                 int c)
MatrixBlockinit in class MatrixBlockarr - double array matrixr - number of rowsc - number of columnspublic boolean isAllocated()
isAllocated in class MatrixBlockpublic Future<MatrixBlock> allocateBlockAsync()
allocateBlockAsync in class MatrixBlockpublic boolean allocateDenseBlock(boolean clearNNZ)
allocateDenseBlock in class MatrixBlockpublic boolean allocateSparseRowsBlock(boolean clearNNZ)
allocateSparseRowsBlock in class MatrixBlockpublic void allocateAndResetSparseBlock(boolean clearNNZ,
                                        SparseBlock.Type stype)
allocateAndResetSparseBlock in class MatrixBlockCopyright © 2021 The Apache Software Foundation. All rights reserved.