public final class SparseRowVector extends SparseRow implements Serializable
Modifier and Type | Field and Description |
---|---|
static int |
initialCapacity |
Constructor and Description |
---|
SparseRowVector() |
SparseRowVector(int capacity) |
SparseRowVector(int estnnz,
int maxnnz) |
SparseRowVector(SparseRow that) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int col,
double v)
Add a value to a specified column with awareness of
potential insertions.
|
void |
append(int col,
double v)
Appends a value to the end of the sparse row.
|
int |
capacity() |
void |
compact()
In-place compaction of non-zero-entries; removes zero entries
and shifts non-zero entries to the left if necessary.
|
void |
copy(SparseRow that) |
void |
deleteIndexRange(int lowerCol,
int upperCol) |
double |
get(int col)
Gets the value of a specified column.
|
int[] |
indexes()
Get the index array of non-zero entries, co-aligned
with the array of values.
|
boolean |
isEmpty()
Indicates if the sparse row is empty, i.e., if is has
size zero.
|
void |
reset(int estnns,
int maxnns)
Resets the sparse row to empty, after this call size and
isEmpty are guaranteed to return 0 and true, respectively.
|
int |
searchIndexesFirstGT(int col) |
int |
searchIndexesFirstGTE(int col) |
int |
searchIndexesFirstLTE(int col) |
boolean |
set(int col,
double v)
Sets the value of a specified column with awareness of
potential overwrites or deletes (set to value zero).
|
void |
setIndexes(int[] i) |
void |
setIndexRange(int cl,
int cu,
double[] v,
int[] vix,
int vpos,
int vlen) |
void |
setIndexRange(int cl,
int cu,
double[] v,
int vix,
int vlen) |
void |
setSize(int newsize) |
void |
setValues(double[] d) |
int |
size()
Get the number of non-zero values of the sparse row.
|
void |
sort()
In-place sort of column-index value pairs in order to allow binary search
after constant-time append was used for reading unordered sparse rows.
|
double[] |
values()
Get the value array of non-zero entries, co-aligned
with the array of indexes.
|
public static final int initialCapacity
public SparseRowVector()
public SparseRowVector(int capacity)
public SparseRowVector(int estnnz, int maxnnz)
public SparseRowVector(SparseRow that)
public int size()
SparseRow
public void setSize(int newsize)
public boolean isEmpty()
SparseRow
public double[] values()
SparseRow
public int[] indexes()
SparseRow
public void setValues(double[] d)
public void setIndexes(int[] i)
public int capacity()
public void copy(SparseRow that)
public void reset(int estnns, int maxnns)
SparseRow
public boolean set(int col, double v)
SparseRow
public boolean add(int col, double v)
SparseRow
public void append(int col, double v)
SparseRow
public double get(int col)
SparseRow
public int searchIndexesFirstLTE(int col)
public int searchIndexesFirstGTE(int col)
public int searchIndexesFirstGT(int col)
public void deleteIndexRange(int lowerCol, int upperCol)
public void setIndexRange(int cl, int cu, double[] v, int vix, int vlen)
public void setIndexRange(int cl, int cu, double[] v, int[] vix, int vpos, int vlen)
public void sort()
SparseRow
Copyright © 2018 The Apache Software Foundation. All rights reserved.