Clover coverage report -
Coverage timestamp: jeu. juin 15 2006 08:24:33 CEST
file stats: LOC: 115   Methods: 10
NCLOC: 59   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AbstractDataStructureFactory.java 100% 75% 70% 75%
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  131078363 public void conflictDetectedInWatchesFor(int p, int i) {
 38  131078363 for (int j = i + 1; j < tmp.size(); j++) {
 39  1138298091 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    public IVec<Propagatable> getWatchesFor(int p) {
 49    tmp.clear();
 50    lits.watches(p).moveTo(tmp);
 51    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  267080417 public ILits getVocabulary() {
 64  267080417 return lits;
 65    }
 66   
 67    protected UnitPropagationListener solver;
 68   
 69    protected Learner learner;
 70   
 71  2506 public void setUnitPropagationListener(UnitPropagationListener s) {
 72  2506 solver = s;
 73    }
 74   
 75  2506 public void setLearner(Learner learner) {
 76  2506 this.learner = learner;
 77    }
 78   
 79  2490 public void reset() {
 80    }
 81   
 82  3685182 public void learnConstraint(Constr constr) {
 83  3685182 learner.learn(constr);
 84    }
 85   
 86    /*
 87    * (non-Javadoc)
 88    *
 89    * @see org.sat4j.minisat.core.DataStructureFactory#createCardinalityConstraint(org.sat4j.specs.VecInt,
 90    * int)
 91    */
 92  0 public Constr createCardinalityConstraint(IVecInt literals, int degree)
 93    throws ContradictionException {
 94  0 throw new UnsupportedOperationException();
 95    }
 96   
 97    /*
 98    * (non-Javadoc)
 99    *
 100    * @see org.sat4j.minisat.DataStructureFactory#createPseudoBooleanConstraint(org.sat4j.datatype.VecInt,
 101    * org.sat4j.datatype.VecInt, int)
 102    */
 103  0 public Constr createPseudoBooleanConstraint(IVecInt literals,
 104    IVec<BigInteger> coefs, boolean moreThan, BigInteger degree)
 105    throws ContradictionException {
 106  0 throw new UnsupportedOperationException();
 107    }
 108   
 109  0 public Constr createUnregisteredPseudoBooleanConstraint(IVecInt literals,
 110    IVec<BigInteger> coefs, BigInteger degree) {
 111  0 throw new UnsupportedOperationException();
 112    }
 113   
 114   
 115    }