public class TransfVec extends WrappedVec
The mapping is defined by a simple hash map composed of two arrays.
The first array contains values. Index of values is index into the second array _indexes
which contains final value (i.e., index to domain array).
If _indexes
array is null, then index of found value is used directly.
To avoid virtual calls or additional null check for _indexes
the vector
returns two implementation of underlying chunk (TransfChunk
when _indexes
is not null
,
and FlatTransfChunk
when _indexes
is null
.
Vec.CollectDomain, Vec.VectorGroup, Vec.Writer
_domain, _espc, _key, _time, KEY_PREFIX_LEN, LOG_CHK, MAX_ENUM_SIZE
Constructor and Description |
---|
TransfVec(int[][] mapping,
Key masterVecKey,
Key key,
long[] espc) |
TransfVec(int[][] mapping,
java.lang.String[] domain,
Key masterVecKey,
Key key,
long[] espc) |
TransfVec(int[] values,
int[] indexes,
java.lang.String[] domain,
Key masterVecKey,
Key key,
long[] espc) |
Modifier and Type | Method and Description |
---|---|
Chunk |
chunkForChunkIdx(int cidx)
The Chunk for a chunk#.
|
Vec |
compose(int[][] transfMap,
java.lang.String[] domain)
Compose this vector with given transformation.
|
static Vec |
compose(TransfVec origVec,
int[][] transfMap,
java.lang.String[] domain,
boolean keepOrig)
Compose given origVector with given transformation.
|
masterVec
align, at, at8, byteSize, cardinality, checkMissing, chunk2StartElem, chunkForRow, chunkIdx, chunkKey, chunkLen, domain, domain, equals, getVecKey, group, groupKey, hash, hashCode, isBad, isByteVec, isConst, isEnum, isFloat, isInt, isNA, isTime, length, make1Elem, make1Elem, makeCon, makeCon, makeCon, makeCons, makeConSeq, makeNewCons, makeSeq, makeTransf, makeZero, makeZero, makeZeros, makeZeros, max, mean, min, naCnt, nChunks, newKey, open, postWrite, readable, remove, rollupStats, rollupStats, set, set, set, setNA, sigma, timeMode, timeParse, toEnum, toString, writable
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
public TransfVec(int[][] mapping, java.lang.String[] domain, Key masterVecKey, Key key, long[] espc)
public Chunk chunkForChunkIdx(int cidx)
Vec
chunkForChunkIdx
in class WrappedVec
public Vec compose(int[][] transfMap, java.lang.String[] domain)
public static Vec compose(TransfVec origVec, int[][] transfMap, java.lang.String[] domain, boolean keepOrig)
origVec
- transfMap
- keepOrig
- TransfVec
composing transformation of origVector and tranfsMap