Clover coverage report -
Coverage timestamp: jeu. sept. 29 2005 23:57:39 CEST
file stats: LOC: 115   Methods: 10
NCLOC: 60   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AbstractDataStructureFactory.java 100% 76,9% 70% 76%
coverage coverage
 1    /*
 2    * Created on 13 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 java.io.Serializable;
 10    import java.math.BigInteger;
 11   
 12    import org.sat4j.core.Vec;
 13    import org.sat4j.minisat.constraints.cnf.Lits;
 14    import org.sat4j.minisat.constraints.cnf.WLClause;
 15    import org.sat4j.minisat.core.Constr;
 16    import org.sat4j.minisat.core.DataStructureFactory;
 17    import org.sat4j.minisat.core.ILits;
 18    import org.sat4j.minisat.core.Learner;
 19    import org.sat4j.minisat.core.Propagatable;
 20    import org.sat4j.minisat.core.UnitPropagationListener;
 21    import org.sat4j.specs.ContradictionException;
 22    import org.sat4j.specs.IVec;
 23    import org.sat4j.specs.IVecInt;
 24   
 25    /**
 26    * @author leberre To change the template for this generated type comment go to
 27    * Window>Preferences>Java>Code Generation>Code and Comments
 28    */
 29    public abstract class AbstractDataStructureFactory implements
 30    DataStructureFactory, Serializable {
 31   
 32    /*
 33    * (non-Javadoc)
 34    *
 35    * @see org.sat4j.minisat.core.DataStructureFactory#conflictDetectedInWatchesFor(int)
 36    */
 37  87931153 public void conflictDetectedInWatchesFor(int p, int i) {
 38  87931153 for (int j = i + 1; j < tmp.size(); j++) {
 39  294311363 lits.watch(p, tmp.get(j));
 40    }
 41    }
 42   
 43    /*
 44    * (non-Javadoc)
 45    *
 46    * @see org.sat4j.minisat.core.DataStructureFactory#getWatchesFor(int)
 47    */
 48  1939353630 public IVec<Propagatable> getWatchesFor(int p) {
 49  1939353630 tmp.clear();
 50  1939353630 lits.watches(p).moveTo(tmp);
 51  1939353630 return tmp;
 52    }
 53   
 54    protected ILits lits = new Lits();
 55   
 56    private final IVec<Propagatable> tmp = new Vec<Propagatable>();
 57   
 58    /*
 59    * (non-Javadoc)
 60    *
 61    * @see org.sat4j.minisat.DataStructureFactory#createVocabulary()
 62    */
 63  171411370 public ILits getVocabulary() {
 64  171411370 return lits;
 65    }
 66   
 67    protected UnitPropagationListener solver;
 68   
 69    protected Learner learner;
 70   
 71  2031 public void setUnitPropagationListener(UnitPropagationListener s) {
 72  2031 solver = s;
 73    }
 74   
 75  2031 public void setLearner(Learner learner) {
 76  2031 this.learner = learner;
 77    }
 78   
 79  1334 public void reset() {
 80  1334 WLClause.resetIds();
 81    }
 82   
 83  18353541 public void learnConstraint(Constr constr) {
 84  18353541 learner.learn(constr);
 85    }
 86   
 87    /*
 88    * (non-Javadoc)
 89    *
 90    * @see org.sat4j.minisat.core.DataStructureFactory#createCardinalityConstraint(org.sat4j.specs.VecInt,
 91    * int)
 92    */
 93  0 public Constr createCardinalityConstraint(IVecInt literals, int degree)
 94    throws ContradictionException {
 95  0 throw new UnsupportedOperationException();
 96    }
 97   
 98    /*
 99    * (non-Javadoc)
 100    *
 101    * @see org.sat4j.minisat.DataStructureFactory#createPseudoBooleanConstraint(org.sat4j.datatype.VecInt,
 102    * org.sat4j.datatype.VecInt, int)
 103    */
 104  0 public Constr createPseudoBooleanConstraint(IVecInt literals,
 105    IVec<BigInteger> coefs, boolean moreThan, BigInteger degree)
 106    throws ContradictionException {
 107  0 throw new UnsupportedOperationException();
 108    }
 109   
 110  0 public Constr createUnregisteredPseudoBooleanConstraint(IVecInt literals,
 111    IVec<BigInteger> coefs, BigInteger degree) {
 112  0 throw new UnsupportedOperationException();
 113    }
 114   
 115    }