1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
package org.sat4j.minisat.orders; |
27 |
|
|
28 |
|
import java.util.ArrayList; |
29 |
|
import java.util.Collections; |
30 |
|
import java.util.List; |
31 |
|
|
32 |
|
import org.sat4j.minisat.core.ILits2; |
33 |
|
|
34 |
|
|
35 |
|
@author |
36 |
|
|
37 |
|
|
|
|
| 90,9% |
Uncovered Elements: 2 (22) |
Complexity: 3 |
Complexity Density: 0,33 |
|
38 |
|
public class MyOrder extends VarOrder<ILits2> { |
39 |
|
|
40 |
|
private static final long serialVersionUID = 1L; |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
@see |
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
47 |
1
|
@Override... |
48 |
|
public void setLits(ILits2 lits) { |
49 |
1
|
super.setLits(lits); |
50 |
|
} |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
@see |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 3 |
Complexity Density: 0,23 |
|
57 |
1
|
@Override... |
58 |
|
public void init() { |
59 |
1
|
super.init(); |
60 |
1
|
List<ValuedLit> v = new ArrayList<ValuedLit>(order.length); |
61 |
1
|
int id; |
62 |
91
|
for (int i = 1; i < order.length; i++) { |
63 |
90
|
id = order[i]; |
64 |
90
|
v.add(new ValuedLit(id,lits.nBinaryClauses(id) + lits.nBinaryClauses(id ^ 1))); |
65 |
|
} |
66 |
1
|
Collections.sort(v); |
67 |
|
|
68 |
91
|
for (int i = 0; i < v.size(); i++) { |
69 |
90
|
ValuedLit t = v.get(i); |
70 |
90
|
order[i + 1] = t.id; |
71 |
90
|
int index = t.id >> 1; |
72 |
90
|
varpos[index] = i + 1; |
73 |
|
} |
74 |
1
|
lastVar = 1; |
75 |
|
} |
76 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
0
|
@Override... |
78 |
|
public String toString() { |
79 |
0
|
return "Init VSIDS order with binary clause occurrences."; |
80 |
|
} |
81 |
|
} |