toAdd.assign(RAW[i]);
mapper.map(new IntWritable(i), new VectorWritable(toAdd), mapContext);
}
// now perform the reduction
MatrixDiagonalizeReducer reducer = new MatrixDiagonalizeReducer();
DummyRecordWriter<NullWritable, VectorWritable> redWriter = new
DummyRecordWriter<NullWritable, VectorWritable>();
Reducer<NullWritable, IntDoublePairWritable, NullWritable, VectorWritable>.Context
redContext = DummyRecordWriter.build(reducer, conf, redWriter,
NullWritable.class, IntDoublePairWritable.class);
// only need one reduction
reducer.reduce(NullWritable.get(), mapWriter.getValue(NullWritable.get()), redContext);
// first, make sure there's only one result
List<VectorWritable> list = redWriter.getValue(NullWritable.get());
assertEquals("Only a single resulting vector", 1, list.size());
Vector v = list.get(0).get();