public abstract class Chunk extends Iced implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected Chunk |
_chk2 |
int |
_len |
long |
_start |
Vec |
_vec |
Constructor and Description |
---|
Chunk() |
Modifier and Type | Method and Description |
---|---|
double |
at_slow(long i)
Slightly slower than 'at0' inside a chunk; goes (very) slow outside the
chunk instead of throwing.
|
double |
at(long i)
Load a double value.
|
double |
at0(int i)
The zero-based API.
|
protected abstract long |
at8_impl(int idx) |
long |
at8_slow(long i) |
long |
at8(long i)
Load a long value.
|
long |
at80(int i) |
protected abstract double |
atd_impl(int idx)
Chunk-specific readers.
|
long |
byteSize() |
int |
cidx() |
Chunk |
clone() |
void |
close(int cidx,
Futures fs)
After writing we must call close() to register the bulk changes
|
byte[] |
getBytes() |
protected abstract boolean |
isNA_impl(int idx) |
boolean |
isNA_slow(long i) |
boolean |
isNA(long i)
Fetch the missing-status the slow way.
|
boolean |
isNA0(int i) |
boolean |
isSparse() |
int |
nextNZ(int rid) |
int[] |
nonzeros()
Get chunk-relative indeces of values (nonzeros for sparse, all for dense) stored in this chunk.
|
int |
nonzeros(int[] res)
Get chunk-relative indexes of values (nonzeros for sparse, all for dense) stored in this chunk.
|
int |
pformat_len() |
protected int |
pformat_len0() |
protected int |
pformat_len0(double scale,
int lg) |
java.lang.String |
pformat() |
protected java.lang.String |
pformat0() |
abstract Chunk |
read(AutoBuffer bb)
Deserialize from the AutoBuffer into a pre-existing 'this' object.
|
boolean |
readable() |
double |
set(long i,
double d)
Write element the slow way, as a double.
|
float |
set(long i,
float f)
Write element the slow way, as a float.
|
long |
set(long i,
long l)
Write element the slow way, as a long.
|
double |
set0(int idx,
double d)
Set a double element in a chunk given a 0-based chunk local index.
|
float |
set0(int idx,
float f)
Set a floating element in a chunk given a 0-based chunk local index.
|
long |
set0(int idx,
long l)
Set a long element in a chunk given a 0-based chunk local index.
|
boolean |
setNA(long i)
Set the element as missing the slow way.
|
boolean |
setNA0(int idx)
Set the element in a chunk as missing given a 0-based chunk local index.
|
int |
sparseLen() |
java.lang.String |
toString() |
boolean |
writable() |
abstract AutoBuffer |
write(AutoBuffer bb)
Chunk-specific implementations of read and write
|
frozenType, init, newInstance, toDocField, writeJSON, writeJSONFields
public long _start
public int _len
protected Chunk _chk2
public Vec _vec
public final boolean readable()
public final boolean writable()
public final byte[] getBytes()
public final long at8(long i)
Loads from the 1-entry chunk cache, or misses-out. This version uses absolute element numbers, but must convert them to chunk-relative indices - requiring a load from an aliasing local var, leading to lower quality JIT'd code (similar issue to using iterator objects).
Slightly slower than 'at0' since it range checks within a chunk.
public final double at(long i)
Loads from the 1-entry chunk cache, or misses-out. This version uses absolute element numbers, but must convert them to chunk-relative indices - requiring a load from an aliasing local var, leading to lower quality JIT'd code (similar issue to using iterator objects).
Slightly slower than 'at80' since it range checks within a chunk.
public final boolean isNA(long i)
public final double at0(int i)
public final long at80(int i)
public final boolean isNA0(int i)
public final double at_slow(long i)
public final long at8_slow(long i)
public final boolean isNA_slow(long i)
public final long set(long i, long l)
public final double set(long i, double d)
public final float set(long i, float f)
public final boolean setNA(long i)
public final long set0(int idx, long l)
public final double set0(int idx, double d)
public final float set0(int idx, float f)
public final boolean setNA0(int idx)
public void close(int cidx, Futures fs)
public int cidx()
protected abstract double atd_impl(int idx)
protected abstract long at8_impl(int idx)
protected abstract boolean isNA_impl(int idx)
public int nextNZ(int rid)
public boolean isSparse()
public int sparseLen()
public int nonzeros(int[] res)
public final int[] nonzeros()
public abstract AutoBuffer write(AutoBuffer bb)
public abstract Chunk read(AutoBuffer bb)
Freezable
public java.lang.String pformat()
public int pformat_len()
protected java.lang.String pformat0()
protected int pformat_len0()
protected int pformat_len0(double scale, int lg)
public java.lang.String toString()
toString
in class java.lang.Object
public long byteSize()