private static void FillDiagonal(TArray a, TData val) { long d = a.Shape.Dimensions[0].Length; a.Reshape(new NumCIL.Shape(new long[] { d }, 0, new long[] { d + 1 })).Set(val); }