Package org.apache.sysds.runtime.data
Class DenseBlockLString
java.lang.Object
org.apache.sysds.runtime.data.DenseBlock
org.apache.sysds.runtime.data.DenseBlockLDRB
org.apache.sysds.runtime.data.DenseBlockLString
- All Implemented Interfaces:
Serializable,Block
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sysds.runtime.data.DenseBlock
DenseBlock.Type -
Field Summary
Fields inherited from class org.apache.sysds.runtime.data.DenseBlockLDRB
MAX_ALLOC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcapacity()Get the total length of allocated blocks.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.longgetLong(int[] ix) Get the value of a given cell as longgetString(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.booleanIndicates if the dense block has a single underlying block, i.e., if numBlocks==1.booleanIndicates if the dense block is numeric.booleanIndicates if the dense block is a specific numeric value type.intGet the number of allocated blocks.set(int[] ix, double v) Set the specified cell to the given value.set(int[] ix, long v) Set the specified cell to the given value.Set the specified cell to the given value.set(int r, int c, double v) Set the given value for a given row and column.Set the given string for the entire dense block (fill).set(DenseBlock db) Copy the given dense 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.DenseBlockLDRB
blockSize, blockSize, countNonZeros, countNonZeros, countNonZeros, index, isContiguous, pos, pos, pos, reset, resetNoFill, set, set, set, size
-
Constructor Details
-
DenseBlockLString
public DenseBlockLString(int[] dims)
-
-
Method Details
-
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
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
-
isContiguous
public boolean isContiguous()Description copied from class:DenseBlockIndicates if the dense block has a single underlying block, i.e., if numBlocks==1.- Specified by:
isContiguousin classDenseBlock- Returns:
- true if single block
-
numBlocks
public int numBlocks()Description copied from class:DenseBlockGet the number of allocated blocks.- Specified by:
numBlocksin classDenseBlock- Returns:
- number of blocks
-
capacity
public long capacity()Description copied from class:DenseBlockGet the total length of allocated blocks.- Specified by:
capacityin classDenseBlock- Returns:
- capacity
-
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
-
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
-
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
Description copied from class:DenseBlockSet the given string for the entire dense block (fill). Generally the string will be parsed, except for string DenseBlock.- Overrides:
setin classDenseBlock- Parameters:
s- string- Returns:
- self
-
set
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
Description copied from class:DenseBlockCopy the given dense block.- Overrides:
setin classDenseBlockLDRB- Parameters:
db- dense block- Returns:
- self
-
set
Description copied from class:DenseBlockSet the specified cell to the given value.- Specified by:
setin classDenseBlock- Parameters:
ix- cell indexesv- value- Returns:
- self
-
set
Description copied from class:DenseBlockSet the specified cell to the given value.- Specified by:
setin classDenseBlock- Parameters:
ix- cell indexesv- value- Returns:
- self
-
set
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
-
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
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
-