1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.datamodel; |
22 |
|
|
|
|
| 72% |
Uncovered Elements: 14 (50) |
Complexity: 20 |
Complexity Density: 0.71 |
|
23 |
|
public class FloatContactMatrix extends GroupSetHolder |
24 |
|
implements ContactMatrixI |
25 |
|
{ |
26 |
|
|
27 |
|
int maxrow = 0, maxcol = 0; |
28 |
|
|
29 |
|
float[][] elements; |
30 |
|
|
31 |
|
float maxscore; |
32 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 3 |
Complexity Density: 0.3 |
|
33 |
18 |
public FloatContactMatrix(float[][] matrix)... |
34 |
|
{ |
35 |
18 |
maxcol = 0; |
36 |
18 |
for (float[] row : matrix) |
37 |
|
{ |
38 |
4672 |
if (row.length > maxcol) |
39 |
|
{ |
40 |
18 |
maxcol = row.length; |
41 |
|
} |
42 |
4672 |
maxscore = row[0]; |
43 |
4672 |
for (float f : row) |
44 |
|
{ |
45 |
3373058 |
if (maxscore < f) |
46 |
|
{ |
47 |
8876 |
maxscore = f; |
48 |
|
} |
49 |
|
} |
50 |
|
} |
51 |
18 |
maxrow = matrix.length; |
52 |
18 |
elements = matrix; |
53 |
|
} |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
55 |
1 |
public FloatContactMatrix(float[][] elements2, GroupSet grps2)... |
56 |
|
{ |
57 |
1 |
this(elements2); |
58 |
1 |
setGroupSet(grps2); |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
65 |
1785 |
@Override... |
66 |
|
public ContactListI getContactList(final int column) |
67 |
|
{ |
68 |
1785 |
if (column < 0 || column >= elements.length) |
69 |
|
{ |
70 |
0 |
return null; |
71 |
|
} |
72 |
|
|
73 |
1785 |
return new ContactListImpl(new ContactListProviderI() |
74 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
0 |
@Override... |
76 |
|
public int getPosition() |
77 |
|
{ |
78 |
0 |
return column; |
79 |
|
} |
80 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
0 |
@Override... |
82 |
|
public int getContactHeight() |
83 |
|
{ |
84 |
0 |
return maxcol - 1; |
85 |
|
} |
86 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
87 |
208842 |
@Override... |
88 |
|
public double getContactAt(int mcolumn) |
89 |
|
{ |
90 |
208842 |
if (mcolumn < 0 || mcolumn >= elements[column].length) |
91 |
|
{ |
92 |
0 |
return -1; |
93 |
|
} |
94 |
208842 |
return elements[column][mcolumn]; |
95 |
|
} |
96 |
|
}); |
97 |
|
} |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
103 |
47 |
@Override... |
104 |
|
public double getElementAt(int _column, int i) |
105 |
|
{ |
106 |
47 |
return elements[_column][i]; |
107 |
|
} |
108 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
32 |
@Override... |
110 |
|
public float getMin() |
111 |
|
{ |
112 |
32 |
return 0; |
113 |
|
} |
114 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
37 |
@Override... |
116 |
|
public float getMax() |
117 |
|
{ |
118 |
37 |
return maxscore; |
119 |
|
} |
120 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
121 |
0 |
@Override... |
122 |
|
public String getAnnotDescr() |
123 |
|
{ |
124 |
|
|
125 |
0 |
return null; |
126 |
|
} |
127 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
128 |
0 |
@Override... |
129 |
|
public String getAnnotLabel() |
130 |
|
{ |
131 |
|
|
132 |
0 |
return null; |
133 |
|
} |
134 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
135 |
0 |
@Override... |
136 |
|
public String getType() |
137 |
|
{ |
138 |
0 |
return null; |
139 |
|
} |
140 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
141 |
74 |
@Override... |
142 |
|
public int getWidth() |
143 |
|
{ |
144 |
74 |
return maxcol; |
145 |
|
} |
146 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
147 |
102730 |
@Override... |
148 |
|
public int getHeight() |
149 |
|
{ |
150 |
102730 |
return maxrow; |
151 |
|
} |
152 |
|
} |