public class SparseFactor extends AbstractFactor
cut, dimensionIDs, dimensions, selections, values| Constructor and Description |
|---|
SparseFactor() |
| Modifier and Type | Method and Description |
|---|---|
SparseFactor |
clone() |
void |
copyValues(IArrayWrapper other) |
void |
fill(double d) |
static SparseFactor |
fromFactor(AbstractFactor f) |
int |
getOverhead() |
protected int |
getRealPosition(int virtualPosition) |
static boolean |
isSuitable(int futureLength,
AbstractFactor... multiplicationCandidates)
approximates whether creating a sparse factor will save memory compared to a dense factor
|
void |
multiplyCompatible(AbstractFactor compatible)
multiply the factors.
|
int[] |
prepareMultiplication(AbstractFactor compatible) |
void |
setDimensions(int... dimensions) |
void |
sparsify(AbstractFactor... compatible)
Prepares the factor in the sense that it's internal structures are optimized according to the zero/non-zero
structure of the factors that will be multiplied in.
|
getDimensionFromID, getDimensionIDs, getDimensions, getValue, getValues, isLogScale, marginalizeAllBut, multiplyCompatibleToLog, multiplyPrepared, resetSelections, select, setDimensionIDs, setLogScale, setValues, sumPrepared, validateCutpublic void setDimensions(int... dimensions)
setDimensions in class AbstractFactorpublic void copyValues(IArrayWrapper other)
copyValues in class AbstractFactorpublic void multiplyCompatible(AbstractFactor compatible)
AbstractFactormultiplyCompatible in class AbstractFactorcompatible - input factorpublic int[] prepareMultiplication(AbstractFactor compatible)
prepareMultiplication in class AbstractFactorpublic void sparsify(AbstractFactor... compatible)
compatible - a Factor with compatible dimensionsprotected int getRealPosition(int virtualPosition)
getRealPosition in class AbstractFactorpublic void fill(double d)
fill in class AbstractFactorpublic int getOverhead()
getOverhead in class AbstractFactorpublic SparseFactor clone()
clone in class AbstractFactorpublic static boolean isSuitable(int futureLength,
AbstractFactor... multiplicationCandidates)
futureLength - the length that the new factor's value array would have in a dense factormultiplicationCandidates - array of candidatespublic static SparseFactor fromFactor(AbstractFactor f)
Copyright © 2018. All rights reserved.