ILNumerics Ultimate VS

ConcreteArrayT1, LocalT, InT, OutT, RetT, StorageTEquals Method (Object)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Test if this array equals another array.

[ILNumerics Core Module]

Namespace:  ILNumerics.Core.Arrays
Assembly:  ILNumerics.Core (in ILNumerics.Core.dll) Version: (5.5.7503.3146)

public override bool Equals(
	Object obj


Type: SystemObject
The other array.

Return Value

Type: Boolean
True if the element type, all element values and dimension sizes match, false otherwise.

The comparison returns true if both arrays are of the same type, have the same shape and if all element values match.

Note, that the StorageOrder of the arrays is not considered for the comparison. This way it is perfectly legal for two arrays to return true while one array is stored in, let's say: ColumnMajor and the other array is ordered along the rows (RowMajor). However, all elements at matching sequencial positions / with matching indices in the flattened array must equal in order to return true.

Singleton dimensions are ignored. As one consequence, and Equals(Object) accept two vectors even if the orientations do not match. A row vector with the same element values than another column vector of the same lengths are considered to be equal to each other.

This function returns true for empty arrays of the same shape and element type. It always returns true when used on an array with itself as parameter obj.

Comparing ValueType of type T1 as obj returns true if this array is scalar (i.e.: it has exactly one element) and the value of the only element equals the value of the provided scalar.

For floating point element types T1 the comparison is made on the byte-level. Thus, only exact matches are considered 'equal'. Therefore, this function is not intended to compare the results of such floating point operations which are subject of rounding errors. Consider computing the absolute distance of both floating point results instead and compare this to the eps value of the floating point data type with appropriate precision and scaling.

NaN values are never equal to itself or any other value.

[ILNumerics Core Module]

See Also