public Matrix(double[][] A) { m = A.Length; n = A[0].Length; for (int i = 0; i < m; i++) { if (A[i].Length != n) { throw new ArgumentOutOfRangeException( "All rows must have the same length."); } } this.A = A; }