13
13
14
14
public class Utilities {
15
15
16
+
17
+ /**
18
+ * @param spectrum1 first spectrum (possible subspectrum)
19
+ * @param spectrum2 second spectrum
20
+ * @param dim1 dim in first spectrum
21
+ * @param dim2 dim in second spectrum
22
+ * @param shiftTolerance shift tolerance
23
+ * @param checkMultiplicity whether to check multiplicity
24
+ * @param checkEquivalencesCount whether to check equivalences
25
+ * @param allowLowerEquivalencesCount whether to allow lower equivalences
26
+ *
27
+ * @return
28
+ */
16
29
public static List <Distance > buildDistanceList (final Spectrum spectrum1 , final Spectrum spectrum2 , final int dim1 ,
17
30
final int dim2 , final double shiftTolerance ,
18
31
final boolean checkMultiplicity ,
@@ -74,7 +87,22 @@ public static Double getDistanceValue(final Signal signal1, final Signal signal2
74
87
? null
75
88
: distanceValue ;
76
89
}
77
-
90
+
91
+ /**
92
+ * @param spectrum1 first spectrum (possible subspectrum)
93
+ * @param spectrum2 second spectrum
94
+ * @param dim1 dim in first spectrum
95
+ * @param dim2 dim in second spectrum
96
+ * @param shiftTolerance shift tolerance
97
+ * @param checkMultiplicity whether to check multiplicity
98
+ * @param checkEquivalencesCount whether to check equivalences
99
+ * @param allowLowerEquivalencesCount whether to allow lower equivalences
100
+ * @param structure structure belonging to first spectrum
101
+ * @param assignment assignments between structure and first spectrum
102
+ * @param detections detections to use as structural filter within given structure
103
+ *
104
+ * @return
105
+ */
78
106
public static List <Distance > buildDistanceList (final Spectrum spectrum1 , final Spectrum spectrum2 , final int dim1 ,
79
107
final int dim2 , final double shiftTolerance ,
80
108
final boolean checkMultiplicity ,
@@ -90,15 +118,6 @@ public static List<Distance> buildDistanceList(final Spectrum spectrum1, final S
90
118
boolean skip ;
91
119
for (int i = 0 ; i
92
120
< spectrum1 .getSignalCount (); i ++) {
93
- forbiddenNeighbors = detections .getForbiddenNeighbors ()
94
- .get (i )
95
- .keySet ();
96
- setNeighbors = detections .getSetNeighbors ()
97
- .get (i )
98
- .keySet ();
99
- hybridizations = detections .getDetectedHybridizations ()
100
- .get (i );
101
-
102
121
for (int j = 0 ; j
103
122
< spectrum2 .getSignalCount (); j ++) {
104
123
// check spectral constraints
@@ -111,9 +130,17 @@ public static List<Distance> buildDistanceList(final Spectrum spectrum1, final S
111
130
}
112
131
skip = false ;
113
132
// check structural constraints
114
- for (int k = 0 ; k
115
- < assignment .getAssignment (0 , j ).length ; k ++) {
116
- atom = structure .getAtom (assignment .getAssignment (0 , j , k ));
133
+ forbiddenNeighbors = detections .getForbiddenNeighbors ()
134
+ .get (j )
135
+ .keySet ();
136
+ setNeighbors = detections .getSetNeighbors ()
137
+ .get (j )
138
+ .keySet ();
139
+ hybridizations = detections .getDetectedHybridizations ()
140
+ .get (j );
141
+ for (int equiv = 0 ; equiv
142
+ < assignment .getAssignment (0 , i ).length ; equiv ++) {
143
+ atom = structure .getAtom (assignment .getAssignment (0 , i , equiv ));
117
144
// if certain hybridizations are given and the atom's hybridization is known
118
145
if (!hybridizations .isEmpty ()
119
146
&& Constants .hybridizationConversionMap .containsKey (atom .getHybridization ()
0 commit comments