View Javadoc

1   package org.sat4j.pb.constraints.pb;
2   
3   import java.math.BigInteger;
4   
5   import org.sat4j.minisat.constraints.cnf.UnitClause;
6   import org.sat4j.minisat.core.ILits;
7   import org.sat4j.specs.IVecInt;
8   
9   public class UnitClausePB extends UnitClause implements PBConstr {
10  
11  	private final ILits voc;
12  
13  	public UnitClausePB(int value, ILits voc) {
14  		super(value);
15  		this.voc = voc;
16  	}
17  
18  	/**
19       * 
20       */
21  	private static final long serialVersionUID = 1L;
22  
23  	public IVecInt computeAnImpliedClause() {
24  		return null;
25  	}
26  
27  	public BigInteger getCoef(int literal) {
28  		return BigInteger.ONE;
29  	}
30  
31  	public BigInteger[] getCoefs() {
32  		BigInteger[] tmp = { BigInteger.ONE };
33  		return tmp;
34  	}
35  
36  	public BigInteger getDegree() {
37  		return BigInteger.ONE;
38  	}
39  
40  	public int[] getLits() {
41  		int[] tmp = { literal };
42  		return tmp;
43  	}
44  
45  	public ILits getVocabulary() {
46  		return voc;
47  	}
48  
49  }