/// <summary>
 /// Determines whether the given matrix equals the current matrix.
 /// </summary>
 /// <param name="other">The matrix to compare.</param>
 /// <returns>True if the <paramref name="other"/> is equal to the current matrix, otherwise false.</returns>
 public bool Equals(AnyRectangularMatrix other)
 {
     if (Object.ReferenceEquals(other, null))
     {
         return(false);
     }
     else
     {
         return(InternalEquals(this, other));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Determines whether the given matrix equals the current matrix.
 /// </summary>
 /// <param name="other">The matrix to compare.</param>
 /// <returns>True if the <paramref name="other"/> is equal to the current matrix, otherwise false.</returns>
 public bool Equals(AnyRectangularMatrix other)
 {
     if (other == null)
     {
         return(false);
     }
     else
     {
         return(InternalEquals(this, other));
     }
 }
Exemplo n.º 3
0
        // equality operations
        // do not re-implement for concrete implementations, because people shouldn't be doing matrix equality comparisons anyway

        private static bool InternalEquals(AnyRectangularMatrix A, AnyRectangularMatrix B)
        {
            if (A.RowCount != B.RowCount)
            {
                return(false);
            }
            if (A.ColumnCount != B.ColumnCount)
            {
                return(false);
            }
            for (int r = 0; r < A.RowCount; r++)
            {
                for (int c = 0; c < A.ColumnCount; c++)
                {
                    if (A[r, c] != B[r, c])
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
        // equality operations
        // do not re-implement for concrete implementations, because people shouldn't be doing matrix equality comparisons anyway

        private static bool InternalEquals(AnyRectangularMatrix A, AnyRectangularMatrix B)
        {
            Debug.Assert(!Object.ReferenceEquals(A, null));
            Debug.Assert(!Object.ReferenceEquals(B, null));
            if (A.RowCount != B.RowCount)
            {
                return(false);
            }
            if (A.ColumnCount != B.ColumnCount)
            {
                return(false);
            }
            for (int r = 0; r < A.RowCount; r++)
            {
                for (int c = 0; c < A.ColumnCount; c++)
                {
                    if (A[r, c] != B[r, c])
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Exemplo n.º 5
0
 public AnyRectangularMatrixDebuggerTypeProxy(AnyRectangularMatrix A)
 {
     this.A = A;
 }