@Override public void reduce(DRemoteTask rt) { KMeansScore kms = (KMeansScore) rt; if (_rows == null) { _rows = kms._rows; _dist = kms._dist; } else { Utils.add(_rows, kms._rows); Utils.add(_dist, kms._dist); } }
@Override public void reduce(CM cm) { if (_cm != null && cm._cm != null) { Utils.add(_cm, cm._cm); } else { assert (_mse != Double.NaN && cm._mse != Double.NaN); assert (_cm == null && cm._cm == null); _mse += cm._mse; _count += cm._count; } }
@Override public void reduce(GammaPass gp) { Utils.add(_gss, gp._gss); Utils.add(_rss, gp._rss); }
@Override public void reduce(ClassDist that) { Utils.add(_ys, that._ys); }
public static float[][] add(float[][] a, float[][] b) { for(int i = 0; i < a.length; i++ ) add(a[i],b[i]); return a; }
public static long[][] add(long[][] a, long[][] b) { for(int i = 0; i < a.length; i++ ) add(a[i],b[i]); return a; }