The number of loci can easily overflow an int. Change reduce type to a Long.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1233 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
5bf7647498
commit
12b5d9c70c
|
|
@ -13,14 +13,14 @@ import java.util.List;
|
||||||
* Time: 3:22:14 PM
|
* Time: 3:22:14 PM
|
||||||
* To change this template use File | Settings | File Templates.
|
* To change this template use File | Settings | File Templates.
|
||||||
*/
|
*/
|
||||||
public class CountLociWalker extends LocusWalker<Integer, Integer> implements TreeReducible<Integer> {
|
public class CountLociWalker extends LocusWalker<Integer, Long> implements TreeReducible<Long> {
|
||||||
public Integer map(RefMetaDataTracker tracker, char ref, LocusContext context) {
|
public Integer map(RefMetaDataTracker tracker, char ref, LocusContext context) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer reduceInit() { return 0; }
|
public Long reduceInit() { return 0l; }
|
||||||
|
|
||||||
public Integer reduce(Integer value, Integer sum) {
|
public Long reduce(Integer value, Long sum) {
|
||||||
return value + sum;
|
return value + sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class CountLociWalker extends LocusWalker<Integer, Integer> implements Tr
|
||||||
* Reduces two subtrees together. In this case, the implementation of the tree reduce
|
* Reduces two subtrees together. In this case, the implementation of the tree reduce
|
||||||
* is exactly the same as the implementation of the single reduce.
|
* is exactly the same as the implementation of the single reduce.
|
||||||
*/
|
*/
|
||||||
public Integer treeReduce(Integer lhs, Integer rhs) {
|
public Long treeReduce(Long lhs, Long rhs) {
|
||||||
return lhs + rhs;
|
return lhs + rhs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue