private void updateError(double[] xy, int compX, int compY) { if (errX == compX && errY == compY && errXY != null) { bool equal = true; for (int i = 0; i < xy.Length; i++) { if (i == compX || i == compY) { continue; } if (xy[i] != errXY[i]) { equal = false; break; } } if (equal) { return; } } int id; grid.ToIndex(xy, out id); int[] counter = new int[N]; grid.ToCounter(id, counter); counter[compX] = 0; counter[compY] = 0; int errID; grid.ToIndex(counter, out errID); errXY = (double[])xy.Clone(); errX = compX; errY = compY; errmin = double.PositiveInfinity; errmax = 0; for (int i = 0; i < grid.count[errX]; i++) { for (int j = 0; j < grid.count[errY]; j++) { double err = error[errID + grid.rount[errX] * i + grid.rount[errY] * j]; if (errmin > err) { errmin = err; } if (errmax < err) { errmax = err; } } } }