Clover coverage report -
Coverage timestamp: jeu. juin 15 2006 08:24:33 CEST
file stats: LOC: 82   Methods: 7
NCLOC: 41   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
WLClausePB.java 83,3% 93,3% 85,7% 89,3%
coverage coverage
 1    package org.sat4j.minisat.constraints.pb;
 2   
 3    import java.math.BigInteger;
 4   
 5    import org.sat4j.minisat.constraints.cnf.WLClause;
 6    import org.sat4j.minisat.core.ILits;
 7    import org.sat4j.minisat.core.UnitPropagationListener;
 8    import org.sat4j.specs.IVecInt;
 9   
 10    public class WLClausePB extends WLClause implements PBConstr {
 11   
 12    /**
 13    *
 14    */
 15    private static final long serialVersionUID = 1L;
 16   
 17  598075 public WLClausePB(IVecInt ps, ILits voc) {
 18  598075 super(ps, voc);
 19    // TODO Auto-generated constructor stub
 20    }
 21   
 22    /*
 23    * (non-Javadoc)
 24    *
 25    * @see org.sat4j.minisat.constraints.pb.PBConstr#getCoefficient(int)
 26    */
 27  18796517 public BigInteger getCoef(int literal) {
 28  18796517 return BigInteger.ONE;
 29    }
 30   
 31    /*
 32    * (non-Javadoc)
 33    *
 34    * @see org.sat4j.minisat.constraints.pb.PBConstr#getDegree()
 35    */
 36  1648321 public BigInteger getDegree() {
 37  1648321 return BigInteger.ONE;
 38    }
 39   
 40  239387 public BigInteger[] getCoefs() {
 41  239387 BigInteger[] tmp = new BigInteger[size()];
 42  239387 for (int i = 0; i < tmp.length; i++)
 43  4674854 tmp[i] = BigInteger.ONE;
 44  239387 return tmp;
 45    }
 46   
 47    /**
 48    * Creates a brand new clause, presumably from external data. Performs all
 49    * sanity checks.
 50    *
 51    * @param s
 52    * the object responsible for unit propagation
 53    * @param voc
 54    * the vocabulary
 55    * @param literals
 56    * the literals to store in the clause
 57    * @return the created clause or null if the clause should be ignored
 58    * (tautology for example)
 59    */
 60  369775 public static WLClausePB brandNewClause(UnitPropagationListener s,
 61    ILits voc, IVecInt literals) {
 62  369775 WLClausePB c = new WLClausePB(literals, voc);
 63  369775 c.register();
 64  369775 return c;
 65    }
 66   
 67  228300 public void assertConstraint(UnitPropagationListener s) {
 68  3130790 for (int i = 0; i < size(); i++)
 69  3130790 if (getVocabulary().isUnassigned(get(i))) {
 70  228300 boolean ret = s.enqueue(get(i), this);
 71    assert ret;
 72  228300 break;
 73    }
 74    }
 75   
 76  0 public IVecInt computeAnImpliedClause() {
 77  0 return null;
 78    }
 79   
 80   
 81   
 82    }