Clover coverage report -
Coverage timestamp: jeu. sept. 29 2005 23:57:39 CEST
file stats: LOC: 63   Methods: 4
NCLOC: 32   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Lits2.java 100% 100% 100% 100%
coverage
 1    /*
 2    * Created on 15 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.cnf;
 8   
 9    import org.sat4j.minisat.core.ILits2;
 10   
 11    /**
 12    * @author leberre To change the template for this generated type comment go to
 13    * Window - Preferences - Java - Code Generation - Code and Comments
 14    */
 15    public class Lits2 extends Lits implements ILits2 {
 16   
 17    private static final long serialVersionUID = 1L;
 18   
 19    private BinaryClauses[] binclauses = null;
 20   
 21    /**
 22    *
 23    */
 24  313 public Lits2() {
 25  313 super();
 26    // TODO Auto-generated constructor stub
 27    }
 28   
 29    /**
 30    * To know the number of binary clauses in which the literal occurs. Please
 31    * note that this method should only be used in conjunction with the
 32    * BinaryClauses data structure.
 33    *
 34    * @param p
 35    * @return the number of binary clauses in which the literal occurs.
 36    */
 37  951557326 public int nBinaryClauses(int p) {
 38  951557326 if (binclauses == null) {
 39  2390 return 0;
 40    }
 41  951554936 if (binclauses[p] == null) {
 42  475762957 return 0;
 43    }
 44  475791979 return binclauses[p].size();
 45    }
 46   
 47  588365 public void binaryClauses(int lit1, int lit2) {
 48  588365 register(lit1, lit2);
 49  588365 register(lit2, lit1);
 50    }
 51   
 52  1176730 private void register(int p, int q) {
 53  1176730 if (binclauses == null) {
 54  313 binclauses = new BinaryClauses[2 * nVars() + 2];
 55    }
 56  1176730 if (binclauses[p] == null) {
 57  74305 binclauses[p] = new BinaryClauses(this, p);
 58  74305 watches[p ^ 1].insertFirstWithShifting(binclauses[p]);
 59    }
 60  1176730 binclauses[p].addBinaryClause(q);
 61    }
 62   
 63    }