}
public static LogTableFactor makeFromMatrix (Variable[] vars, SparseMatrixn values)
{
SparseMatrixn logValues = (SparseMatrixn) values.cloneMatrix ();
for (int i = 0; i < logValues.numLocations (); i++) {
logValues.setValueAtLocation (i, Math.log (logValues.valueAtLocation (i)));
}
Flops.log (logValues.numLocations ());
return new LogTableFactor (vars, logValues);
}