public final class SparseRowScalar extends SparseRow implements Serializable
| Constructor and Description |
|---|
SparseRowScalar() |
SparseRowScalar(int ix,
double val) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(int col,
double v)
Appends a value to the end of the sparse row.
|
void |
compact()
In-place compaction of non-zero-entries; removes zero entries
and shifts non-zero entries to the left if necessary.
|
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.
|
boolean |
set(int col,
double v)
Sets the value of a specified column with awareness of
potential overwrites or deletes (set to value zero).
|
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 SparseRowScalar()
public SparseRowScalar(int ix,
double val)
public int size()
SparseRowpublic boolean isEmpty()
SparseRowpublic double[] values()
SparseRowpublic int[] indexes()
SparseRowpublic void reset(int estnns,
int maxnns)
SparseRowpublic boolean set(int col,
double v)
SparseRowpublic void append(int col,
double v)
SparseRowpublic double get(int col)
SparseRowpublic void sort()
SparseRowCopyright © 2017 The Apache Software Foundation. All rights reserved.