Vector.Equal Method

Overload List

#SignatureDescription
1function Equal(const Vec: TMtxVec; Tolerance: Double): Boolean;Compares vector elements and returns true if vectors are equal.
2function Equal(const Vec: TMtxVec; Tolerance: Double; Compare: TCompare): Boolean;Optionally it is also possible to specify the Compare method.

Overload 1: function Equal(const Vec: TMtxVec; Tolerance: Double): Boolean;

Compares vector elements and returns true if vectors are equal.

#NameTypeDescription
1VecTMtxVec
2ToleranceDoublescalar

Returns: Boolean

Remarks:

Compares vector elements and returns true if vectors are equal, that is if all elements match in position and value. The Tolerance parameter defines the comparison tolerance. The maximum difference between elements may not exceed: +/-Tolerance.

Examples
var A,B: Matrix;
    c: boolean;
begin
    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 exact match
end;
See Also: Vector.Find

Overload 2: function Equal(const Vec: TMtxVec; Tolerance: Double; Compare: TCompare): Boolean;

Optionally it is also possible to specify the Compare method.

#NameTypeDescription
1VecTMtxVec
2ToleranceDoublescalar
3CompareTCompare

Returns: Boolean