Clover coverage report -
Coverage timestamp: jeu. juin 15 2006 08:24:33 CEST
file stats: LOC: 57   Methods: 4
NCLOC: 37   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SATRaceDecorator.java 50% 50% 100% 59,1%
coverage coverage
 1    /*
 2    * Created on 1 juin 2006
 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.tools;
 8   
 9    import org.sat4j.minisat.constraints.MixedDataStructureWithBinary;
 10    import org.sat4j.minisat.core.Solver;
 11    import org.sat4j.minisat.orders.VarOrder;
 12    import org.sat4j.specs.ISolver;
 13    import org.sat4j.specs.TimeoutException;
 14   
 15    public class SATRaceDecorator extends SolverDecorator {
 16   
 17    private boolean configChanged;
 18    private int nbvars;
 19   
 20  1 public SATRaceDecorator(ISolver solver) {
 21  1 super(solver);
 22    }
 23   
 24  1 @Override
 25    public int newVar(int howmany) {
 26  1 nbvars = howmany;
 27  1 return super.newVar(howmany);
 28    }
 29   
 30   
 31  1 @Override
 32    public void setExpectedNumberOfClauses(int nb) {
 33  1 if (nbvars>800000||nb>2000000) {
 34    // Use specific binary clauses representation
 35  0 System.err.println("CHANGING DATA STRUCTURES");
 36  0 Solver solver = (Solver) decorated();
 37    // solver.setOrder(new VarOrder());
 38  0 solver.setDataStructureFactory(new MixedDataStructureWithBinary());
 39    // disable solver simplification
 40  0 solver.setSimplifier(Solver.NO_SIMPLIFICATION);
 41  0 configChanged = true;
 42  0 super.newVar(nbvars);
 43    }
 44   
 45  1 super.setExpectedNumberOfClauses(nb);
 46    }
 47   
 48  1 @Override
 49    public boolean isSatisfiable() throws TimeoutException {
 50  1 if (configChanged) {
 51  0 System.out.println("c WARNING: used specific Binary Clause representation and disabled reason Simplification to save memory!");
 52    }
 53  1 return super.isSatisfiable();
 54    }
 55   
 56   
 57    }