EMMA Coverage Report (generated Sat Aug 20 11:00:51 CDT 2011)
[all classes][tuffy.ground.partition]

COVERAGE SUMMARY FOR SOURCE FILE [Partition.java]

nameclass, %method, %block, %line, %
Partition.java100% (1/1)60%  (3/5)29%  (31/106)48%  (10/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Partition100% (1/1)60%  (3/5)29%  (31/106)48%  (10/21)
compareTo (Partition): int 0%   (0/1)0%   (0/10)0%   (0/2)
showStats (): void 0%   (0/1)0%   (0/65)0%   (0/9)
Partition (): void 100% (1/1)100% (18/18)100% (6/6)
discard (): void 100% (1/1)100% (10/10)100% (3/3)
size (): double 100% (1/1)100% (3/3)100% (1/1)

1package tuffy.ground.partition;
2 
3import tuffy.infer.MRF;
4import tuffy.util.UIMan;
5 
6/**
7 * A partition is a subgraph of an MRF component.
8 */
9public class Partition implements Comparable<Partition>{
10        public int id; // ID of this partition
11        public int numAtoms = 0;
12        public int numIncidentClauses = 0;
13        public double ramSize = 0;
14 
15        public Component parentComponent = null;
16 
17        public MRF mrf = null;
18 
19        
20        public int compareTo(Partition c){
21                double d = c.size() - size();
22                return (int)(Math.signum(d));
23        }
24 
25        /**
26         * Get the estimated RAM size of this partition.
27         */
28        public double size(){
29                return ramSize;
30        }
31 
32        /**
33         * Discard all data structures to facilitate GC. (Does it really work?)
34         */
35        public void discard() {
36                if(mrf != null) mrf.discard();
37                mrf = null;
38        }
39        
40 
41        /**
42         * Show basic stats about this partition.
43         */
44        public void showStats(){
45                String s = "[Partition #" + id + "]" +
46                "\tRAM = " + ramSize +
47                "\t#atoms = " + numAtoms +
48                "\t#incident_clauses = " + numIncidentClauses;
49                if(mrf != null){
50                        s += "\t#core_atoms = " + mrf.getCoreAtoms().size();
51                        s += "\t#core_clauses = " + mrf.clauses.size();
52                }
53                UIMan.println(s);
54        }
55 
56}

[all classes][tuffy.ground.partition]
EMMA 2.0.5312 EclEmma Fix 2 (C) Vladimir Roubtsov