TMtx.Equal Method

Overload List

#SignatureDescription
1Boolean Equal(TMtx Mtx, Double Tolerance)Compares two matrices.
2Boolean Equal(TMtx Mtx, Double Tolerance, TCompare Compare)Allows to specify the comparison method via the Compare parameter.

Overload 1: Boolean Equal(TMtx Mtx, Double Tolerance)

Compares two matrices.

#NameTypeDescription
1MtxTMtxsource TMtx
2ToleranceDoublescalar

Returns: Boolean

Remarks:

Compares Mtx with the calling matrix and returns true if the matrices are equal (if all elements match in position and value). Tolerance defines the comparison tolerance. The maximum difference between elements may not exceed: +/-Tolerance. If Tolerance is omitted, a direct comparison algorithm is used.

Examples
TMtx A;
TMtx B;
boolean c;
MtxVec.CreateIt(out A, out B);
try
    {
        A.SetIt(2,2,false,[1,2,
        2,4]);  // 2x2, real matrix
        B.SetIt(2,2,false,[1,2,
        2,4]);  // 2x2, real matrix
        c = A.Equal(B,1e-8); // Check for differences bigger than 0.00000001
        c = A.Equal(B); // Check for an exact match
    }
finally
    {
        MtxVec.FreeIt(ref A, ref B);
    }

Overload 2: Boolean Equal(TMtx Mtx, Double Tolerance, TCompare Compare)

Allows to specify the comparison method via the Compare parameter.

#NameTypeDescription
1MtxTMtxsource TMtx
2ToleranceDoublescalar
3CompareTCompare

Returns: Boolean