public class ConcatVectorTable extends NDArray<java.util.function.Supplier<ConcatVector>>
This is basically a type specific wrapper over NDArray
Constructor and Description |
---|
ConcatVectorTable(int[] dimensions)
Constructor takes a list of neighbor variables to use for this factor.
|
Modifier and Type | Method and Description |
---|---|
void |
cacheVectors()
This is an optimization that will fault all the ConcatVectors into memory, and future .get() on the Supplier objs
will result in a very fast return by reference.
|
ConcatVectorTable |
cloneTable()
Clones the table, but keeps the values by reference.
|
ConcatVectorTableProto.ConcatVectorTable.Builder |
getProtoBuilder()
Returns the proto builder object for this feature factor.
|
static ConcatVectorTable |
readFromProto(ConcatVectorTableProto.ConcatVectorTable proto)
Creates a new in-memory feature factor from a proto serialization,
|
static ConcatVectorTable |
readFromStream(java.io.InputStream stream)
Convenience function to read a factor (assumed serialized with proto) directly from a stream.
|
void |
releaseCache()
This will release references to the cached ConcatVectors created by cacheVectors(), so that they can be cleaned
up by the GC.
|
boolean |
valueEquals(ConcatVectorTable other,
double tolerance)
Deep comparison for equality of value, plus tolerance, for every concatvector in the table, plus dimensional
arrangement.
|
void |
writeToStream(java.io.OutputStream stream)
Convenience function to write this factor directly to a stream, encoded as proto.
|
cloneArray, combinatorialNeighborStatesCount, fastPassByReferenceIterator, getAssignmentValue, getDimensions, iterator, setAssignmentValue
public ConcatVectorTable(int[] dimensions)
dimensions
- list of neighbor variables assignment range sizespublic void writeToStream(java.io.OutputStream stream) throws java.io.IOException
stream
- the stream to write to. does not flush automaticallyjava.io.IOException
- passed through from the streampublic static ConcatVectorTable readFromStream(java.io.InputStream stream) throws java.io.IOException
stream
- the stream to be read fromjava.io.IOException
- passed through from the streampublic ConcatVectorTableProto.ConcatVectorTable.Builder getProtoBuilder()
public static ConcatVectorTable readFromProto(ConcatVectorTableProto.ConcatVectorTable proto)
proto
- the proto object to be turned into an in-memory feature factorpublic boolean valueEquals(ConcatVectorTable other, double tolerance)
other
- the vector table to compare againsttolerance
- the tolerance to use in value comparisonspublic void cacheVectors()
public void releaseCache()
public ConcatVectorTable cloneTable()