NMath User's Guide

TOC | Previous | Next | Index

6.4 Logical Operations on Matrices (.NET, C#, CSharp, VB, Visual Basic, F#)

Operator == tests for equality of two matrices, and returns true if both matrices have the same dimensions and all values are equal; otherwise, false. Following the convention of the .NET Framework, if both objects are null, they test equal. The comparison of the values for DoubleMatrix and DoubleComplexMatrix is done using operator == for doubles; comparison of the values for FloatMatrix and FloatComplexMatrix is done using operator == for floats. Therefore, the values of the matrices must be exactly equal for this method to return true. Operator != returns the logical negation of ==.

The Equals() member function also tests for equality. NaNEquals() ignores values that are Not-a-Number (NaN).


Top

Top