Clover coverage report -
Coverage timestamp: jeu. sept. 29 2005 23:57:39 CEST
file stats: LOC: 72   Methods: 3
NCLOC: 38   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
MixedDataStructureWithBinary.java 100% 100% 100% 100%
coverage
 1    /*
 2    * Created on 1 juin 2004
 3    *
 4    * To change the template for this generated file go to
 5    * Window>Preferences>Java>Code Generation>Code and Comments
 6    */
 7    package org.sat4j.minisat.constraints;
 8   
 9    import org.sat4j.minisat.constraints.cnf.Lits2;
 10    import org.sat4j.minisat.constraints.cnf.WLClause;
 11    import org.sat4j.minisat.core.Constr;
 12    import org.sat4j.minisat.core.ILits;
 13    import org.sat4j.minisat.core.ILits2;
 14    import org.sat4j.specs.ContradictionException;
 15    import org.sat4j.specs.IVecInt;
 16   
 17    /**
 18    * @author leberre To change the template for this generated type comment go to
 19    * Window>Preferences>Java>Code Generation>Code and Comments
 20    */
 21    public class MixedDataStructureWithBinary extends MixedDataStructureDaniel {
 22   
 23    private static final long serialVersionUID = 1L;
 24   
 25    private final ILits2 mlits = new Lits2();
 26   
 27    {
 28  207 lits = mlits;
 29    }
 30   
 31    /*
 32    * (non-Javadoc)
 33    *
 34    * @see org.sat4j.minisat.DataStructureFactory#createVocabulary()
 35    */
 36  17758984 @Override
 37    public ILits getVocabulary() {
 38  17758984 return lits;
 39    }
 40   
 41    /*
 42    * (non-Javadoc)
 43    *
 44    * @see org.sat4j.minisat.DataStructureFactory#createClause(org.sat4j.datatype.VecInt)
 45    */
 46  500607 @Override
 47    public Constr createClause(IVecInt literals) throws ContradictionException {
 48  500607 IVecInt v = WLClause.sanityCheck(literals, lits, solver);
 49  500607 if (v == null)
 50  26 return null;
 51  500581 if (v.size() == 2) {
 52  391125 mlits.binaryClauses(v.get(0), v.get(1));
 53  391125 return null;
 54    }
 55  109456 return WLClause.brandNewClause(solver, lits, v);
 56    }
 57   
 58    /*
 59    * (non-Javadoc)
 60    *
 61    * @see org.sat4j.minisat.DataStructureFactory#learnContraint(org.sat4j.minisat.Constr)
 62    */
 63  3449437 @Override
 64    public void learnConstraint(Constr constr) {
 65  3449437 if (constr.size() == 2) {
 66  487 mlits.binaryClauses(constr.get(0), constr.get(1));
 67    // solver.getStats().learnedbinaryclauses++;
 68    } else {
 69  3448950 super.learnConstraint(constr);
 70    }
 71    }
 72    }