public abstract class DenseBlock extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
DenseBlock.Type |
Constructor and Description |
---|
DenseBlock() |
Modifier and Type | Method and Description |
---|---|
abstract int |
blockSize()
Get the number of rows per block, except last one.
|
abstract int |
blockSize(int bix)
Get the number of rows of the given block.
|
abstract long |
capacity()
Get the total length of allocated blocks.
|
abstract long |
countNonZeros()
Compute the number of non-zero values, which potentially
makes a full pass over the underlying blocks.
|
abstract int |
countNonZeros(int r)
Compute the number of non-zero values for the given row,
which potentially makes a full pass over the underlying row.
|
abstract long |
countNonZeros(int rl,
int ru,
int cl,
int cu)
Compute the number of non-zero values, which potentially
makes a full pass over the underlying blocks in the row range.
|
abstract double |
get(int r,
int c)
Get the value for a given row and column.
|
abstract void |
incr(int r,
int c)
Increments the given value for a given row and column.
|
abstract void |
incr(int r,
int c,
double delta)
Increments the given value for a given row and column
by delta.
|
abstract int |
index(int r)
Get the block index for a given row.
|
abstract boolean |
isContiguous()
Indicates if the dense block has a single
underlying block, i.e., if numBlocks==1.
|
abstract boolean |
isContiguous(int rl,
int ru)
Indicates if the dense block has a single
underlying block for the given row range.
|
abstract int |
numBlocks()
Get the number of allocated blocks.
|
abstract int |
numRows()
Get the number of rows.
|
abstract int |
pos(int r)
Get the position for a given row within
its associated block.
|
abstract int |
pos(int r,
int c)
Get the position for a given row and column
within the associated block.
|
abstract void |
reset()
Resets the dense block by deleting non-zero values.
|
abstract void |
reset(int rlen,
int clen)
Resets the dense block by deleting non-zero values.
|
abstract void |
reset(int rlen,
int clen,
double v)
Resets the dense block by setting the given value.
|
abstract DenseBlock |
set(DenseBlock db)
Copy the given dense block.
|
abstract DenseBlock |
set(double v)
Set the given value for the entire dense block (fill).
|
abstract DenseBlock |
set(int r,
double[] v)
Copy the given vector into the given row.
|
abstract DenseBlock |
set(int r,
int c,
double v)
Set the given value for a given row and column.
|
abstract DenseBlock |
set(int rl,
int ru,
int cl,
int cu,
DenseBlock db)
Copy the given dense block into the specified
index range.
|
abstract DenseBlock |
set(int rl,
int ru,
int cl,
int cu,
double v)
Set the given value for an entire index range of the
dense block (fill).
|
DenseBlock |
set(int r,
org.apache.sysml.runtime.instructions.cp.KahanObject kbuff)
Copy the given kahan object sum and correction
into the given row.
|
DenseBlock |
set(org.apache.sysml.runtime.instructions.cp.KahanObject kbuff)
Copy the given kahan object sum and correction.
|
abstract long |
size()
Get the length of the dense block as the product
of row and column dimensions.
|
abstract int |
size(int bix)
Get the length of the given block.
|
abstract String |
toString() |
abstract double[][] |
values()
Get the allocated blocks.
|
abstract double[] |
values(int r)
Get the allocated block for the given row.
|
abstract double[] |
valuesAt(int bix)
Get an allocated block.
|
public abstract void reset()
public abstract void reset(int rlen, int clen)
rlen
- number of rowsclen
- number of columnspublic abstract void reset(int rlen, int clen, double v)
rlen
- number of rowsclen
- number of columnsv
- valuepublic abstract int numRows()
public abstract int numBlocks()
public abstract int blockSize()
public abstract int blockSize(int bix)
bix
- block indexpublic abstract boolean isContiguous()
public abstract boolean isContiguous(int rl, int ru)
rl
- row lower indexru
- row upper index (inclusive)public abstract long size()
public abstract int size(int bix)
bix
- block indexpublic abstract long capacity()
public abstract long countNonZeros()
public abstract int countNonZeros(int r)
r
- row indexpublic abstract long countNonZeros(int rl, int ru, int cl, int cu)
rl
- row lower indexru
- row upper index (exclusive)cl
- column lower indexcu
- column upper index (exclusive)public abstract double[][] values()
public abstract double[] values(int r)
r
- row indexpublic abstract double[] valuesAt(int bix)
bix
- block indexpublic abstract int index(int r)
r
- row indexpublic abstract int pos(int r)
r
- row indexpublic abstract int pos(int r, int c)
r
- row indexc
- column indexpublic abstract void incr(int r, int c)
r
- row indexc
- column indexpublic abstract void incr(int r, int c, double delta)
r
- row indexc
- column indexdelta
- increment valuepublic abstract DenseBlock set(double v)
v
- valuepublic abstract DenseBlock set(int rl, int ru, int cl, int cu, double v)
rl
- row lower indexru
- row upper index (exclusive)cl
- column lower indexcu
- column upper index (exclusive)v
- valuepublic abstract DenseBlock set(int r, int c, double v)
r
- row indexc
- column indexv
- valuepublic abstract DenseBlock set(int r, double[] v)
r
- row indexv
- value vectorpublic abstract DenseBlock set(DenseBlock db)
db
- dense blockpublic abstract DenseBlock set(int rl, int ru, int cl, int cu, DenseBlock db)
rl
- row lower indexru
- row upper index (exclusive)cl
- column lower indexcu
- column upper index (exclusive)db
- dense blockpublic DenseBlock set(org.apache.sysml.runtime.instructions.cp.KahanObject kbuff)
kbuff
- kahan objectpublic DenseBlock set(int r, org.apache.sysml.runtime.instructions.cp.KahanObject kbuff)
r
- row indexkbuff
- kahan objectpublic abstract double get(int r, int c)
r
- row indexc
- column indexCopyright © 2018 The Apache Software Foundation. All rights reserved.