int[] idxs1 = new int[] { 0, 1, 3 };
double[] vals1 = new double[]{ 2.0, 4.0, 8.0 };
TableFactor ptl1 = new TableFactor (vars);
ptl1.setValues (new SparseMatrixn (szs, idxs1, vals1));
TableFactor ans = new TableFactor (vars[0], new double[] { 6, 8 });
Factor ptl2 = ptl1.marginalize (vars[0]);