Package org.apache.sysds.runtime.data
Class DenseBlockBool
- java.lang.Object
-
- org.apache.sysds.runtime.data.DenseBlock
-
- org.apache.sysds.runtime.data.DenseBlockDRB
-
- org.apache.sysds.runtime.data.DenseBlockBool
-
- All Implemented Interfaces:
Serializable
public class DenseBlockBool extends DenseBlockDRB
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.sysds.runtime.data.DenseBlock
DenseBlock.Type
-
-
Constructor Summary
Constructors Constructor Description DenseBlockBool(int[] dims)
DenseBlockBool(int[] dims, boolean[] data)
DenseBlockBool(int[] dims, BitSet data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
capacity()
Get the total length of allocated blocks.double
get(int[] ix)
Get the value of a given celldouble
get(int r, int c)
Get the value for a given row and column.BitSet
getData()
long
getLong(int[] ix)
Get the value of a given cell as longString
getString(int[] ix)
Get the value of a given cell as a Stringvoid
incr(int r, int c)
Increments the given value for a given row and column.void
incr(int r, int c, double delta)
Increments the given value for a given row and column by delta.int
index(int r)
Get the block index for a given row.boolean
isNumeric()
Indicates if the dense block is numeric.boolean
isNumeric(Types.ValueType vt)
Indicates if the dense block is a specific numeric value type.void
reset(int rlen, int[] odims, double v)
Resets the dense block by setting the given value.DenseBlock
set(int[] ix, double v)
Set the specified cell to the given value.DenseBlock
set(int[] ix, long v)
Set the specified cell to the given value.DenseBlock
set(int[] ix, String v)
Set the specified cell to the given value.DenseBlock
set(int r, double[] v)
Copy the given vector into the given row.DenseBlock
set(int r, int c, double v)
Set the given value for a given row and column.DenseBlock
set(int rl, int ru, int cl, int cu, DenseBlock db)
Copy the given dense block into the specified index range.DenseBlock
set(String s)
Set the given string for the entire dense block (fill).DenseBlock
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.DenseBlockDRB
blockSize, blockSize, countNonZeros, countNonZeros, countNonZeros, isContiguous, isContiguous, numBlocks, pos, pos, pos, set, set, size
-
Methods inherited from class org.apache.sysds.runtime.data.DenseBlock
estimateMemory, getCumODims, getDim, getNextIndexes, numDims, numRows, reset, reset, reset, reset, reset, reset, set, set, setDims, size, toString
-
-
-
-
Constructor Detail
-
DenseBlockBool
public DenseBlockBool(int[] dims)
-
DenseBlockBool
public DenseBlockBool(int[] dims, BitSet data)
-
DenseBlockBool
public DenseBlockBool(int[] dims, boolean[] data)
-
-
Method Detail
-
getData
public BitSet getData()
-
isNumeric
public boolean isNumeric()
Description copied from class:DenseBlock
Indicates if the dense block is numeric.- Specified by:
isNumeric
in classDenseBlock
- Returns:
- true if numeric (FP, INT, BOOLEAN)
-
isNumeric
public boolean isNumeric(Types.ValueType vt)
Description copied from class:DenseBlock
Indicates if the dense block is a specific numeric value type.- Specified by:
isNumeric
in classDenseBlock
- Parameters:
vt
- value type to check- Returns:
- true if numeric and of value type vt
-
reset
public void reset(int rlen, int[] odims, double v)
Description copied from class:DenseBlock
Resets the dense block by setting the given value.- Overrides:
reset
in classDenseBlockDRB
- Parameters:
rlen
- number of rowsodims
- other dimensionsv
- value
-
capacity
public long capacity()
Description copied from class:DenseBlock
Get the total length of allocated blocks.- Specified by:
capacity
in classDenseBlock
- Returns:
- capacity
-
values
public double[] values(int r)
Description copied from class:DenseBlock
Get the allocated block for the given row. This call is equivalent to valuesAt(indexes(r)).- Specified by:
values
in classDenseBlock
- Parameters:
r
- row index- Returns:
- block
-
valuesAt
public double[] valuesAt(int bix)
Description copied from class:DenseBlock
Get an allocated block.- Specified by:
valuesAt
in classDenseBlock
- Parameters:
bix
- block index- Returns:
- block
-
index
public int index(int r)
Description copied from class:DenseBlock
Get the block index for a given row.- Specified by:
index
in classDenseBlock
- Parameters:
r
- row index- Returns:
- block index
-
incr
public void incr(int r, int c)
Description copied from class:DenseBlock
Increments the given value for a given row and column.- Specified by:
incr
in classDenseBlock
- Parameters:
r
- row indexc
- column index
-
incr
public void incr(int r, int c, double delta)
Description copied from class:DenseBlock
Increments the given value for a given row and column by delta.- Specified by:
incr
in classDenseBlock
- Parameters:
r
- row indexc
- column indexdelta
- increment value
-
set
public DenseBlock set(String s)
Description copied from class:DenseBlock
Set the given string for the entire dense block (fill). Generally the string will be parsed, except for string DenseBlock.- Overrides:
set
in classDenseBlock
- Parameters:
s
- string- Returns:
- self
-
set
public DenseBlock set(int r, int c, double v)
Description copied from class:DenseBlock
Set the given value for a given row and column.- Specified by:
set
in classDenseBlock
- Parameters:
r
- row indexc
- column indexv
- value- Returns:
- self
-
set
public DenseBlock set(DenseBlock db)
Description copied from class:DenseBlock
Copy the given dense block.- Specified by:
set
in classDenseBlock
- Parameters:
db
- dense block- Returns:
- self
-
set
public DenseBlock set(int rl, int ru, int cl, int cu, DenseBlock db)
Description copied from class:DenseBlock
Copy the given dense block into the specified index range.- Overrides:
set
in classDenseBlock
- Parameters:
rl
- row lower indexru
- row upper index (exclusive)cl
- column lower indexcu
- column upper index (exclusive)db
- dense block- Returns:
- self
-
set
public DenseBlock set(int r, double[] v)
Description copied from class:DenseBlock
Copy the given vector into the given row.- Specified by:
set
in classDenseBlock
- Parameters:
r
- row indexv
- value vector- Returns:
- self
-
set
public DenseBlock set(int[] ix, double v)
Description copied from class:DenseBlock
Set the specified cell to the given value.- Specified by:
set
in classDenseBlock
- Parameters:
ix
- cell indexesv
- value- Returns:
- self
-
set
public DenseBlock set(int[] ix, long v)
Description copied from class:DenseBlock
Set the specified cell to the given value.- Specified by:
set
in classDenseBlock
- Parameters:
ix
- cell indexesv
- value- Returns:
- self
-
set
public DenseBlock set(int[] ix, String v)
Description copied from class:DenseBlock
Set the specified cell to the given value.- Specified by:
set
in classDenseBlock
- Parameters:
ix
- cell indexesv
- value as String- Returns:
- self
-
get
public double get(int r, int c)
Description copied from class:DenseBlock
Get the value for a given row and column.- Specified by:
get
in classDenseBlock
- Parameters:
r
- row indexc
- column index- Returns:
- value
-
get
public double get(int[] ix)
Description copied from class:DenseBlock
Get the value of a given cell- Specified by:
get
in classDenseBlock
- Parameters:
ix
- cell indexes- Returns:
- value
-
getString
public String getString(int[] ix)
Description copied from class:DenseBlock
Get the value of a given cell as a String- Specified by:
getString
in classDenseBlock
- Parameters:
ix
- cell indexes- Returns:
- value as String
-
getLong
public long getLong(int[] ix)
Description copied from class:DenseBlock
Get the value of a given cell as long- Specified by:
getLong
in classDenseBlock
- Parameters:
ix
- cell indexes- Returns:
- value as long
-
-