File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
render-app/src/main/java/org/janelia/alignment/match Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 20
20
21
21
import java .io .Serializable ;
22
22
import java .util .ArrayList ;
23
+ import java .util .Arrays ;
23
24
import java .util .List ;
24
25
25
26
import javax .xml .bind .annotation .XmlAccessType ;
@@ -152,6 +153,19 @@ public List<RealPoint> getQList() {
152
153
return buildPointList (getQs ());
153
154
}
154
155
156
+ @ JsonIgnore
157
+ public Matches withWeight (final double w ) {
158
+ final double [][] newPs = new double [this .p .length ][];
159
+ final double [][] newQs = new double [this .q .length ][];
160
+ for (int d = 0 ; d < this .p .length ; ++d ) {
161
+ newPs [d ] = Arrays .copyOf (this .p [d ], this .p [d ].length );
162
+ newQs [d ] = Arrays .copyOf (this .q [d ], this .q [d ].length );
163
+ }
164
+ final double [] newWeights = new double [this .w .length ];
165
+ Arrays .fill (newWeights , w );
166
+ return new Matches (newPs , newQs , newWeights );
167
+ }
168
+
155
169
private static List <RealPoint > buildPointList (final double [][] locations ) {
156
170
final double [] xLocations = locations [0 ];
157
171
final double [] yLocations = locations [1 ];
You can’t perform that action at this time.
0 commit comments