private static unsafe void makepositive(double[,] value) { int length = value.Length; fixed (double* ptr = value) { double* p = ptr; for (int i = 0; i < length; i++, p++) { if (*p < 0) *p = 0; } } } }