| 263 | } |
| 264 | |
| 265 | public static final class SumReducer extends Reducer<Text,DoubleWritable,Text,DoubleWritable> { // TODO: check if there is a standard summer we could use here |
| 266 | @Override |
| 267 | public void reduce(final Text key, final Iterable<DoubleWritable> values, final Context context) throws IOException, InterruptedException { |
| 268 | double total = 0.0; |
| 269 | for(final DoubleWritable vi: values) { |
| 270 | total += vi.get(); |
| 271 | } |
| 272 | if(total!=0.0) { |
| 273 | context.write(new Text(key.toString()),new DoubleWritable(total)); |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | @Override |
| 279 | public VEval eval(final double[] x, final boolean wantGrad, final boolean wantHessian) { |
nothing calls this directly
no outgoing calls
no test coverage detected