Fix compile error
This commit is contained in:
parent
a68edf0f3d
commit
fdab5318f3
@ -52,19 +52,19 @@ public class ArrayTransposeMaster extends Master {
|
|||||||
@Override
|
@Override
|
||||||
ArrayResult aggregateData() {
|
ArrayResult aggregateData() {
|
||||||
// number of rows in final result is number of rows in any of obtained results from workers
|
// number of rows in final result is number of rows in any of obtained results from workers
|
||||||
int rows = this.getAllResultData()
|
int rows = ((ArrayResult) this.getAllResultData()
|
||||||
.get(this.getAllResultData().keys().nextElement()).data.length;
|
.get(this.getAllResultData().keys().nextElement())).data.length;
|
||||||
int columns =
|
int columns =
|
||||||
0; //number of columns is sum of number of columns in all results obtained from workers
|
0; //number of columns is sum of number of columns in all results obtained from workers
|
||||||
for (Enumeration<Integer> e = this.getAllResultData().keys(); e.hasMoreElements(); ) {
|
for (Enumeration<Integer> e = this.getAllResultData().keys(); e.hasMoreElements(); ) {
|
||||||
columns += this.getAllResultData().get(e.nextElement()).data[0].length;
|
columns += ((ArrayResult) this.getAllResultData().get(e.nextElement())).data[0].length;
|
||||||
}
|
}
|
||||||
int[][] resultData = new int[rows][columns];
|
int[][] resultData = new int[rows][columns];
|
||||||
int columnsDone = 0; //columns aggregated so far
|
int columnsDone = 0; //columns aggregated so far
|
||||||
for (int i = 0; i < this.getExpectedNumResults(); i++) {
|
for (int i = 0; i < this.getExpectedNumResults(); i++) {
|
||||||
//result obtained from ith worker
|
//result obtained from ith worker
|
||||||
int[][] work =
|
int[][] work =
|
||||||
this.getAllResultData().get(this.getWorkers().get(i).getWorkerId()).data;
|
((ArrayResult) this.getAllResultData().get(this.getWorkers().get(i).getWorkerId())).data;
|
||||||
for (int m = 0; m < work.length; m++) {
|
for (int m = 0; m < work.length; m++) {
|
||||||
//m = row number, n = columns number
|
//m = row number, n = columns number
|
||||||
for (int n = 0; n < work[0].length; n++) {
|
for (int n = 0; n < work[0].length; n++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user