public override double MatrixNorm(Norm norm, int rows, int columns, double[] matrix) { if (matrix == null) { throw new ArgumentNullException("matrix"); } if (rows <= 0) { throw new ArgumentException(Resources.ArgumentMustBePositive, "rows"); } if (columns <= 0) { throw new ArgumentException(Resources.ArgumentMustBePositive, "columns"); } if (matrix.Length < rows * columns) { throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix"); } var work = new double[rows]; return(SafeNativeMethods.d_matrix_norm((byte)norm, rows, columns, matrix, work)); }
public override double MatrixNorm(Norm norm, int rows, int columns, double[] matrix) { if (matrix == null) { throw new ArgumentNullException(nameof(matrix)); } if (rows <= 0) { throw new ArgumentException("Value must be positive.", nameof(rows)); } if (columns <= 0) { throw new ArgumentException("Value must be positive.", nameof(columns)); } if (matrix.Length < rows * columns) { throw new ArgumentException($"The given array is too small. It must be at least {rows * columns} long.", nameof(matrix)); } return(SafeNativeMethods.d_matrix_norm((byte)norm, rows, columns, matrix)); }