public final class SparseRowScalar extends SparseRow implements Serializable
Constructor and Description |
---|
SparseRowScalar() |
SparseRowScalar(int ix,
double val) |
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.
|
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()
SparseRow
public boolean isEmpty()
SparseRow
public double[] values()
SparseRow
public int[] indexes()
SparseRow
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 void sort()
SparseRow
Copyright © 2018 The Apache Software Foundation. All rights reserved.