Package org.apache.sysds.runtime.data
Class DenseBlockFP64DEDUP
- java.lang.Object
 - 
- org.apache.sysds.runtime.data.DenseBlock
 - 
- org.apache.sysds.runtime.data.DenseBlockDRB
 - 
- org.apache.sysds.runtime.data.DenseBlockFP64DEDUP
 
 
 
 
- 
- All Implemented Interfaces:
 Serializable,Block
public class DenseBlockFP64DEDUP extends DenseBlockDRB
- See Also:
 - Serialized Form
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class org.apache.sysds.runtime.data.DenseBlock
DenseBlock.Type 
 - 
 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intblockSize()Get the number of rows per block, except last one.intblockSize(int bix)Get the number of rows of the given block.longcapacity()Get the total length of allocated blocks.longcountNonZeros()Compute the number of non-zero values, which potentially makes a full pass over the underlying blocks.intcountNonZeros(int r)Compute the number of non-zero values for the given row, which potentially makes a full pass over the underlying row.longcountNonZeros(int rl, int ru, int ol, int ou)Compute the number of non-zero values, which potentially makes a full pass over the underlying blocks in the row range.voidcreateDeepCopyOfEmbedding(int pos)longestimateMemory()static longestimateMemory(int rows, int cols, int duplicates)static longestimateMemory(long rows, long cols, long duplicates)voidfillBlock(int bix, int fromIndex, int toIndex, double v)Fill a certain range of elements of a block.voidfillRow(int r, double v)Fill the DenseBlock row index with the value specified.doubleget(int[] ix)Get the value of a given celldoubleget(int r, int c)Get the value for a given row and column.double[]getDedupDirectly(int pos)intgetEmbSize()longgetLong(int[] ix)Get the value of a given cell as longintgetNrDistinctRows()intgetNrEmbsPerRow()StringgetString(int[] ix)Get the value of a given cell as a Stringvoidincr(int r, int c)Increments the given value for a given row and column.voidincr(int r, int c, double delta)Increments the given value for a given row and column by delta.intindex(int r)Get the block index for a given row.booleanisContiguous()Indicates if the dense block has a single underlying block, i.e., if numBlocks==1.booleanisContiguous(int rl, int ru)Indicates if the dense block has a single underlying block for the given row range.booleanisNumeric()Indicates if the dense block is numeric.booleanisNumeric(Types.ValueType vt)Indicates if the dense block is a specific numeric value type.intnumBlocks()Get the number of allocated blocks.intpos(int r)Get the position for a given row within its associated block.intpos(int[] ix)Get the position for a given cell within the associated block.intpos(int r, int c)Get the position for a given row and column within the associated block.voidreset(int rlen, int[] odims, double v)Resets the dense block by setting the given value.voidresetNoFill(int rlen, int[] odims)voidresetNoFillDedup(int rlen, int embsPerRow)DenseBlockset(int[] ix, double v)Set the specified cell to the given value.DenseBlockset(int[] ix, long v)Set the specified cell to the given value.DenseBlockset(int[] ix, String v)Set the specified cell to the given value.DenseBlockset(int r, double[] v)Copy the given vector into the given row.DenseBlockset(int r, int c, double v)Set the given value for a given row and column.DenseBlockset(int rl, int ru, int ol, int ou, DenseBlock db)Copy the given dense block into the specified index range.DenseBlockset(DenseBlock db)Copy the given dense block.DenseBlocksetDedupDirectly(int r, double[] v)voidsetDistinct(int d)voidsetEmbeddingSize(int s)intsize(int bix)Get the length of the given block.double[]values(int r)Get the allocated block for the given row.double[]valuesAt(int bix)Get an allocated block.- 
Methods inherited from class org.apache.sysds.runtime.data.DenseBlockDRB
set, set 
 - 
 
 - 
 
- 
- 
Method Detail
- 
setDistinct
public void setDistinct(int d)
 
- 
setEmbeddingSize
public void setEmbeddingSize(int s)
 
- 
getNrDistinctRows
public int getNrDistinctRows()
 
- 
getNrEmbsPerRow
public int getNrEmbsPerRow()
 
- 
getEmbSize
public int getEmbSize()
 
- 
reset
public void reset(int rlen, int[] odims, double v)Description copied from class:DenseBlockResets the dense block by setting the given value.- Overrides:
 resetin classDenseBlockDRB- Parameters:
 rlen- number of rowsodims- other dimensionsv- value
 
- 
resetNoFill
public void resetNoFill(int rlen, int[] odims)- Specified by:
 resetNoFillin classDenseBlock
 
- 
resetNoFillDedup
public void resetNoFillDedup(int rlen, int embsPerRow) 
- 
isNumeric
public boolean isNumeric()
Description copied from class:DenseBlockIndicates if the dense block is numeric.- Specified by:
 isNumericin classDenseBlock- Returns:
 - true if numeric (FP, INT, BOOLEAN)
 
 
- 
isNumeric
public boolean isNumeric(Types.ValueType vt)
Description copied from class:DenseBlockIndicates if the dense block is a specific numeric value type.- Specified by:
 isNumericin classDenseBlock- Parameters:
 vt- value type to check- Returns:
 - true if numeric and of value type vt
 
 
- 
capacity
public long capacity()
Description copied from class:DenseBlockGet the total length of allocated blocks.- Specified by:
 capacityin classDenseBlock- Returns:
 - capacity
 
 
- 
countNonZeros
public long countNonZeros()
Description copied from class:DenseBlockCompute the number of non-zero values, which potentially makes a full pass over the underlying blocks.- Overrides:
 countNonZerosin classDenseBlockDRB- Returns:
 - number of non-zeros
 
 
- 
countNonZeros
public int countNonZeros(int r)
Description copied from class:DenseBlockCompute the number of non-zero values for the given row, which potentially makes a full pass over the underlying row.- Overrides:
 countNonZerosin classDenseBlockDRB- Parameters:
 r- row index- Returns:
 - number of non-zeros
 
 
- 
countNonZeros
public long countNonZeros(int rl, int ru, int ol, int ou)Description copied from class:DenseBlockCompute the number of non-zero values, which potentially makes a full pass over the underlying blocks in the row range.- Overrides:
 countNonZerosin classDenseBlockDRB- Parameters:
 rl- row lower indexru- row upper index (exclusive)ol- column lower indexou- column upper index (exclusive)- Returns:
 - number of non-zeros
 
 
- 
numBlocks
public int numBlocks()
Description copied from class:DenseBlockGet the number of allocated blocks.- Overrides:
 numBlocksin classDenseBlockDRB- Returns:
 - number of blocks
 
 
- 
blockSize
public int blockSize()
Description copied from class:DenseBlockGet the number of rows per block, except last one.- Overrides:
 blockSizein classDenseBlockDRB- Returns:
 - number of rows in block
 
 
- 
blockSize
public int blockSize(int bix)
Description copied from class:DenseBlockGet the number of rows of the given block.- Overrides:
 blockSizein classDenseBlockDRB- Parameters:
 bix- block index- Returns:
 - number of rows in block
 
 
- 
isContiguous
public boolean isContiguous()
Description copied from class:DenseBlockIndicates if the dense block has a single underlying block, i.e., if numBlocks==1.- Overrides:
 isContiguousin classDenseBlockDRB- Returns:
 - true if single block
 
 
- 
isContiguous
public boolean isContiguous(int rl, int ru)Description copied from class:DenseBlockIndicates if the dense block has a single underlying block for the given row range.- Overrides:
 isContiguousin classDenseBlockDRB- Parameters:
 rl- row lower indexru- row upper index (inclusive)- Returns:
 - true if single block in row range
 
 
- 
pos
public int pos(int r)
Description copied from class:DenseBlockGet the position for a given row within its associated block.- Overrides:
 posin classDenseBlockDRB- Parameters:
 r- row index- Returns:
 - block position
 
 
- 
pos
public int pos(int r, int c)Description copied from class:DenseBlockGet the position for a given row and column within the associated block.- Overrides:
 posin classDenseBlockDRB- Parameters:
 r- row indexc- column index- Returns:
 - block position
 
 
- 
pos
public int pos(int[] ix)
Description copied from class:DenseBlockGet the position for a given cell within the associated block.- Overrides:
 posin classDenseBlockDRB- Parameters:
 ix- cell indexes- Returns:
 - block position
 
 
- 
values
public double[] values(int r)
Description copied from class:DenseBlockGet the allocated block for the given row. This call is equivalent to valuesAt(indexes(r)).- Specified by:
 valuesin classDenseBlock- Parameters:
 r- row index- Returns:
 - block
 
 
- 
valuesAt
public double[] valuesAt(int bix)
Description copied from class:DenseBlockGet an allocated block.- Specified by:
 valuesAtin classDenseBlock- Parameters:
 bix- block index- Returns:
 - block
 
 
- 
index
public int index(int r)
Description copied from class:DenseBlockGet the block index for a given row.- Specified by:
 indexin classDenseBlock- Parameters:
 r- row index- Returns:
 - block index
 
 
- 
size
public int size(int bix)
Description copied from class:DenseBlockGet the length of the given block.- Overrides:
 sizein classDenseBlockDRB- Parameters:
 bix- block index- Returns:
 - length
 
 
- 
incr
public void incr(int r, int c)Description copied from class:DenseBlockIncrements the given value for a given row and column.- Specified by:
 incrin classDenseBlock- Parameters:
 r- row indexc- column index
 
- 
createDeepCopyOfEmbedding
public void createDeepCopyOfEmbedding(int pos)
 
- 
incr
public void incr(int r, int c, double delta)Description copied from class:DenseBlockIncrements the given value for a given row and column by delta.- Specified by:
 incrin classDenseBlock- Parameters:
 r- row indexc- column indexdelta- increment value
 
- 
fillBlock
public void fillBlock(int bix, int fromIndex, int toIndex, double v)Description copied from class:DenseBlockFill a certain range of elements of a block.- Specified by:
 fillBlockin classDenseBlock- Parameters:
 bix- index of blockfromIndex- starting index in blocktoIndex- ending index in block (exclusive)v- value
 
- 
fillRow
public void fillRow(int r, double v)Description copied from class:DenseBlockFill the DenseBlock row index with the value specified.- Specified by:
 fillRowin classDenseBlock- Parameters:
 r- The row to fillv- The value to fill it with.
 
- 
set
public DenseBlock set(int r, int c, double v)
Description copied from class:DenseBlockSet the given value for a given row and column.- Specified by:
 setin classDenseBlock- Parameters:
 r- row indexc- column indexv- value- Returns:
 - self
 
 
- 
set
public DenseBlock set(int r, double[] v)
Description copied from class:DenseBlockCopy the given vector into the given row.- Specified by:
 setin classDenseBlock- Parameters:
 r- row indexv- value vector- Returns:
 - self
 
 
- 
setDedupDirectly
public DenseBlock setDedupDirectly(int r, double[] v)
 
- 
set
public DenseBlock set(DenseBlock db)
Description copied from class:DenseBlockCopy the given dense block.- Specified by:
 setin classDenseBlock- Parameters:
 db- dense block- Returns:
 - self
 
 
- 
set
public DenseBlock set(int rl, int ru, int ol, int ou, DenseBlock db)
Description copied from class:DenseBlockCopy the given dense block into the specified index range.- Overrides:
 setin classDenseBlock- Parameters:
 rl- row lower indexru- row upper index (exclusive)ol- column lower indexou- column upper index (exclusive)db- dense block- Returns:
 - self
 
 
- 
set
public DenseBlock set(int[] ix, double v)
Description copied from class:DenseBlockSet the specified cell to the given value.- Specified by:
 setin classDenseBlock- Parameters:
 ix- cell indexesv- value- Returns:
 - self
 
 
- 
set
public DenseBlock set(int[] ix, long v)
Description copied from class:DenseBlockSet the specified cell to the given value.- Specified by:
 setin classDenseBlock- Parameters:
 ix- cell indexesv- value- Returns:
 - self
 
 
- 
set
public DenseBlock set(int[] ix, String v)
Description copied from class:DenseBlockSet the specified cell to the given value.- Specified by:
 setin classDenseBlock- Parameters:
 ix- cell indexesv- value as String- Returns:
 - self
 
 
- 
getDedupDirectly
public double[] getDedupDirectly(int pos)
 
- 
get
public double get(int r, int c)Description copied from class:DenseBlockGet the value for a given row and column.- Specified by:
 getin interfaceBlock- Specified by:
 getin classDenseBlock- Parameters:
 r- row indexc- column index- Returns:
 - value
 
 
- 
get
public double get(int[] ix)
Description copied from class:DenseBlockGet the value of a given cell- Specified by:
 getin classDenseBlock- Parameters:
 ix- cell indexes- Returns:
 - value
 
 
- 
getString
public String getString(int[] ix)
Description copied from class:DenseBlockGet the value of a given cell as a String- Specified by:
 getStringin classDenseBlock- Parameters:
 ix- cell indexes- Returns:
 - value as String
 
 
- 
getLong
public long getLong(int[] ix)
Description copied from class:DenseBlockGet the value of a given cell as long- Specified by:
 getLongin classDenseBlock- Parameters:
 ix- cell indexes- Returns:
 - value as long
 
 
- 
estimateMemory
public long estimateMemory()
 
- 
estimateMemory
public static long estimateMemory(int rows, int cols, int duplicates) 
- 
estimateMemory
public static long estimateMemory(long rows, long cols, long duplicates) 
 - 
 
 -