/** * Copy constructor. */ public AbstractTableFactor (AbstractTableFactor in) { //xxx Could be dangerous! But these should never be modified vars = in.vars; numVars = in.numVars; if (in.projectionCache == null) in.initializeProjectionCache (); projectionCache = in.projectionCache; }
/** * Copy constructor. */ public AbstractTableFactor (AbstractTableFactor in) { //xxx Could be dangerous! But these should never be modified vars = in.vars; numVars = in.numVars; if (in.projectionCache == null) in.initializeProjectionCache (); projectionCache = in.projectionCache; }
/** * Copy constructor. */ public AbstractTableFactor (AbstractTableFactor in) { //xxx Could be dangerous! But these should never be modified vars = in.vars; numVars = in.numVars; if (in.projectionCache == null) in.initializeProjectionCache (); projectionCache = in.projectionCache; }
int[] largeIdxToSmall (DiscreteFactor smallPotential) // private int cachedlargeIdxToSmall (int largeIdx, MultinomialPotential smallPotential) { if (projectionCache == null) initializeProjectionCache (); // Special case where smallPtl has only one variable. Here // since ordering is not a problem, we can use a set-based // hash key. return cachedLargeIdxToSmall (smallPotential); // if (smallPotential.varSet ().size () == 1) { // return cachedLargeIdxToSmall (smallPotential); // } else { // return computeLargeIdxToSmall (smallPotential); // } }
int[] largeIdxToSmall (DiscreteFactor smallPotential) // private int cachedlargeIdxToSmall (int largeIdx, MultinomialPotential smallPotential) { if (projectionCache == null) initializeProjectionCache (); // Special case where smallPtl has only one variable. Here // since ordering is not a problem, we can use a set-based // hash key. return cachedLargeIdxToSmall (smallPotential); // if (smallPotential.varSet ().size () == 1) { // return cachedLargeIdxToSmall (smallPotential); // } else { // return computeLargeIdxToSmall (smallPotential); // } }
int[] largeIdxToSmall (DiscreteFactor smallPotential) // private int cachedlargeIdxToSmall (int largeIdx, MultinomialPotential smallPotential) { if (projectionCache == null) initializeProjectionCache (); // Special case where smallPtl has only one variable. Here // since ordering is not a problem, we can use a set-based // hash key. return cachedLargeIdxToSmall (smallPotential); // if (smallPotential.varSet ().size () == 1) { // return cachedLargeIdxToSmall (smallPotential); // } else { // return computeLargeIdxToSmall (smallPotential); // } }
private void expandToContain (DiscreteFactor pot) { // if so, expand this potential. this is not pretty if (needsToExpand (varSet (), pot.varSet ())) { VarSet newVarSet = new HashVarSet (varSet ()); newVarSet.addAll (pot.varSet ()); AbstractTableFactor newPtl = createBlankSubset (newVarSet); newPtl.multiplyByInternal (this); vars = newPtl.vars; probs = newPtl.probs; numVars = newPtl.numVars; initializeProjectionCache (); } }
private void expandToContain (DiscreteFactor pot) { // if so, expand this potential. this is not pretty if (needsToExpand (varSet (), pot.varSet ())) { VarSet newVarSet = new HashVarSet (varSet ()); newVarSet.addAll (pot.varSet ()); AbstractTableFactor newPtl = createBlankSubset (newVarSet); newPtl.multiplyByInternal (this); vars = newPtl.vars; probs = newPtl.probs; numVars = newPtl.numVars; initializeProjectionCache (); } }
private void expandToContain (DiscreteFactor pot) { // if so, expand this potential. this is not pretty if (needsToExpand (varSet (), pot.varSet ())) { VarSet newVarSet = new HashVarSet (varSet ()); newVarSet.addAll (pot.varSet ()); AbstractTableFactor newPtl = createBlankSubset (newVarSet); newPtl.multiplyByInternal (this); vars = newPtl.vars; probs = newPtl.probs; numVars = newPtl.numVars; initializeProjectionCache (); } }