Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Comparison: isEqual(...), isEquiv(...), ==, !=

Tests for equality between GMTL data types. More...

AABox Comparitors

template<class DATA_TYPE> bool operator== (const AABox< DATA_TYPE > &b1, const AABox< DATA_TYPE > &b2)
 Compare two AABoxes to see if they are EXACTLY the same. More...

template<class DATA_TYPE> bool operator!= (const AABox< DATA_TYPE > &b1, const AABox< DATA_TYPE > &b2)
 Compare two AABoxes to see if they are not EXACTLY the same. More...

template<class DATA_TYPE> bool isEqual (const AABox< DATA_TYPE > &b1, const AABox< DATA_TYPE > &b2, const DATA_TYPE &eps)
 Compare two AABoxes to see if they are the same within the given tolerance. More...


AxisAngle Comparitors

template<class DATA_TYPE> bool operator== (const AxisAngle< DATA_TYPE > &a1, const AxisAngle< DATA_TYPE > &a2)
 Compares 2 AxisAngles to see if they are exactly the same. More...

template<class DATA_TYPE> bool operator!= (const AxisAngle< DATA_TYPE > &a1, const AxisAngle< DATA_TYPE > &a2)
 Compares 2 AxisAngles to see if they are NOT exactly the same. More...

template<class DATA_TYPE> bool isEqual (const AxisAngle< DATA_TYPE > &a1, const AxisAngle< DATA_TYPE > &a2, const DATA_TYPE &eps=(DATA_TYPE) 0)
 Compares a1 and a2 to see if they are the same within the given epsilon tolerance. More...


Coord Comparitors

template<typename POS_TYPE, typename ROT_TYPE> bool operator== (const Coord< POS_TYPE, ROT_TYPE > &c1, const Coord< POS_TYPE, ROT_TYPE > &c2)
 Compare two coordinate frames for equality. More...

template<typename POS_TYPE, typename ROT_TYPE> bool operator!= (const Coord< POS_TYPE, ROT_TYPE > &c1, const Coord< POS_TYPE, ROT_TYPE > &c2)
 Compare two coordinate frames for not-equality. More...

template<typename POS_TYPE, typename ROT_TYPE> bool isEqual (const Coord< POS_TYPE, ROT_TYPE > &c1, const Coord< POS_TYPE, ROT_TYPE > &c2, typename Coord< POS_TYPE, ROT_TYPE >::DataType tol=(typename Coord< POS_TYPE, ROT_TYPE >::DataType) 0.0)
 Compare two coordinate frames for equality with a given tolerance. More...


EulerAngle Comparitors

template<class DATA_TYPE, typename ROT_ORDER> bool operator== (const EulerAngle< DATA_TYPE, ROT_ORDER > &e1, const EulerAngle< DATA_TYPE, ROT_ORDER > &e2)
 Compares 2 EulerAngles (component-wise) to see if they are exactly the same. More...

template<class DATA_TYPE, typename ROT_ORDER> bool operator!= (const EulerAngle< DATA_TYPE, ROT_ORDER > &e1, const EulerAngle< DATA_TYPE, ROT_ORDER > &e2)
 Compares e1 and e2 (component-wise) to see if they are NOT exactly the same. More...

template<class DATA_TYPE, typename ROT_ORDER> bool isEqual (const EulerAngle< DATA_TYPE, ROT_ORDER > &e1, const EulerAngle< DATA_TYPE, ROT_ORDER > &e2, const DATA_TYPE &eps=(DATA_TYPE) 0)
 Compares e1 and e2 (component-wise) to see if they are the same within a given tolerance. More...


Matrix Comparitors

template<typename DATA_TYPE, unsigned ROWS, unsigned COLS> bool operator== (const Matrix< DATA_TYPE, ROWS, COLS > &lhs, const Matrix< DATA_TYPE, ROWS, COLS > &rhs)
 Tests 2 matrices for equality. More...

template<typename DATA_TYPE, unsigned ROWS, unsigned COLS> bool operator!= (const Matrix< DATA_TYPE, ROWS, COLS > &lhs, const Matrix< DATA_TYPE, ROWS, COLS > &rhs)
 Tests 2 matrices for inequality. More...

template<typename DATA_TYPE, unsigned ROWS, unsigned COLS> bool isEqual (const Matrix< DATA_TYPE, ROWS, COLS > &lhs, const Matrix< DATA_TYPE, ROWS, COLS > &rhs, const DATA_TYPE &eps=(DATA_TYPE) 0)
 Tests 2 matrices for equality within a tolerance. More...


Plane Comparitors

template<class DATA_TYPE> bool operator== (const Plane< DATA_TYPE > &p1, const Plane< DATA_TYPE > &p2)
 Compare two planes to see if they are EXACTLY the same. More...

template<class DATA_TYPE> bool operator!= (const Plane< DATA_TYPE > &p1, const Plane< DATA_TYPE > &p2)
 Compare two planes to see if they are not EXACTLY the same. More...

template<class DATA_TYPE> bool isEqual (const Plane< DATA_TYPE > &p1, const Plane< DATA_TYPE > &p2, const DATA_TYPE &eps)
 Compare two planes to see if they are the same within the given tolerance. More...


Quat Comparisons

template<typename DATA_TYPE> bool operator== (const Quat< DATA_TYPE > &q1, const Quat< DATA_TYPE > &q2)
 Compare two quaternions for equality. More...

template<typename DATA_TYPE> bool operator!= (const Quat< DATA_TYPE > &q1, const Quat< DATA_TYPE > &q2)
 Compare two quaternions for not-equality. More...

template<typename DATA_TYPE> bool isEqual (const Quat< DATA_TYPE > &q1, const Quat< DATA_TYPE > &q2, DATA_TYPE tol=0.0)
 Compare two quaternions for equality with tolerance. More...

template<typename DATA_TYPE> bool isEquiv (const Quat< DATA_TYPE > &q1, const Quat< DATA_TYPE > &q2, DATA_TYPE tol=0.0)
 Compare two quaternions for geometric equivelence (with tolerance). More...


Sphere Comparitors

template<class DATA_TYPE> bool operator== (const Sphere< DATA_TYPE > &s1, const Sphere< DATA_TYPE > &s2)
 Compare two spheres to see if they are EXACTLY the same. More...

template<class DATA_TYPE> bool operator!= (const Sphere< DATA_TYPE > &s1, const Sphere< DATA_TYPE > &s2)
 Compare two spheres to see if they are not EXACTLY the same. More...

template<class DATA_TYPE> bool isEqual (const Sphere< DATA_TYPE > &s1, const Sphere< DATA_TYPE > &s2, const DATA_TYPE &eps)
 Compare two spheres to see if they are the same within the given tolerance. More...


Triangle Comparitors

template<class DATA_TYPE> bool operator== (const Tri< DATA_TYPE > &tri1, const Tri< DATA_TYPE > &tri2)
 Compare two triangles to see if they are EXACTLY the same. More...

template<class DATA_TYPE> bool operator!= (const Tri< DATA_TYPE > &tri1, const Tri< DATA_TYPE > &tri2)
 Compare two triangle to see if they are not EXACTLY the same. More...

template<class DATA_TYPE> bool isEqual (const Tri< DATA_TYPE > &tri1, const Tri< DATA_TYPE > &tri2, const DATA_TYPE &eps)
 Compare two triangles to see if they are the same within the given tolerance. More...


Vector Comparitors

template<class DATA_TYPE, unsigned SIZE> bool operator== (const VecBase< DATA_TYPE, SIZE > &v1, const VecBase< DATA_TYPE, SIZE > &v2)
 Compares v1 and v2 to see if they are exactly the same. More...

template<class DATA_TYPE, unsigned SIZE> bool operator!= (const VecBase< DATA_TYPE, SIZE > &v1, const VecBase< DATA_TYPE, SIZE > &v2)
 Compares v1 and v2 to see if they are NOT exactly the same with zero tolerance. More...

template<class DATA_TYPE, unsigned SIZE> bool isEqual (const VecBase< DATA_TYPE, SIZE > &v1, const VecBase< DATA_TYPE, SIZE > &v2, const DATA_TYPE &eps)
 Compares v1 and v2 to see if they are the same within the given epsilon tolerance. More...


Detailed Description

Tests for equality between GMTL data types.


Function Documentation

template<class DATA_TYPE, unsigned SIZE>
bool isEqual const VecBase< DATA_TYPE, SIZE > &    v1,
const VecBase< DATA_TYPE, SIZE > &    v2,
const DATA_TYPE &    eps
[inline]
 

Compares v1 and v2 to see if they are the same within the given epsilon tolerance.

Precondition:
eps must be >= 0
Parameters:
v1  the first vector
v2  the second vector
eps  the epsilon tolerance value
Returns:
true if v1 equals v2 within the tolerance; false if they differ

Definition at line 517 of file VecOps.h.

00519 {
00520    gmtlASSERT(eps >= 0);
00521 
00522    for(unsigned i=0;i<SIZE;++i)
00523    {
00524       if (fabs(v1[i] - v2[i]) > eps)
00525       {
00526          return false;
00527       }
00528    }
00529    return true;
00530 }

template<class DATA_TYPE>
bool isEqual const Tri< DATA_TYPE > &    tri1,
const Tri< DATA_TYPE > &    tri2,
const DATA_TYPE &    eps
 

Compare two triangles to see if they are the same within the given tolerance.

Parameters:
tri1  the first triangle to compare
tri2  the second triangle to compare
eps  the tolerance value to use
Precondition:
eps must be >= 0
Returns:
true if they are equal within the tolerance, false otherwise

Definition at line 124 of file TriOps.h.

00126 {
00127    gmtlASSERT( eps >= 0 );
00128    return ( isEqual(tri1[0], tri2[0], eps) &&
00129             isEqual(tri1[1], tri2[1], eps) &&
00130             isEqual(tri1[2], tri2[2], eps) );
00131 }

template<class DATA_TYPE>
bool isEqual const Sphere< DATA_TYPE > &    s1,
const Sphere< DATA_TYPE > &    s2,
const DATA_TYPE &    eps
[inline]
 

Compare two spheres to see if they are the same within the given tolerance.

Parameters:
s1  the first sphere to compare
s2  the second sphere to compare
eps  the tolerance value to use
Precondition:
eps must be >= 0
Returns:
true if they are equal within a tolerance, false otherwise

Definition at line 89 of file SphereOps.h.

00090 {
00091    gmtlASSERT( eps >= 0 );
00092    return ( (isEqual(s1.mCenter, s2.mCenter, eps)) &&
00093             (Math::isEqual(s1.mRadius, s2.mRadius, eps)) );
00094 }

template<typename DATA_TYPE>
bool isEqual const Quat< DATA_TYPE > &    q1,
const Quat< DATA_TYPE > &    q2,
DATA_TYPE    tol = 0.0
 

Compare two quaternions for equality with tolerance.

Definition at line 648 of file QuatOps.h.

00649    {
00650       return bool( Math::isEqual( q1[0], q2[0], tol ) &&
00651                    Math::isEqual( q1[1], q2[1], tol ) &&
00652                    Math::isEqual( q1[2], q2[2], tol ) &&
00653                    Math::isEqual( q1[3], q2[3], tol )    );
00654    }

template<class DATA_TYPE>
bool isEqual const Plane< DATA_TYPE > &    p1,
const Plane< DATA_TYPE > &    p2,
const DATA_TYPE &    eps
[inline]
 

Compare two planes to see if they are the same within the given tolerance.

Parameters:
p1  the first plane to compare
p2  the second plane to compare
eps  the tolerance value to use
Precondition:
eps must be >= 0
Returns:
true if they are equal within a tolerance, false otherwise

Definition at line 186 of file PlaneOps.h.

00188 {
00189    gmtlASSERT( eps >= 0 );
00190    return ( (isEqual(p1.mNorm, p2.mNorm, eps)) &&
00191             (Math::isEqual(p1.mOffset, p2.mOffset, eps)) );
00192 }

template<typename DATA_TYPE, unsigned ROWS, unsigned COLS>
bool isEqual const Matrix< DATA_TYPE, ROWS, COLS > &    lhs,
const Matrix< DATA_TYPE, ROWS, COLS > &    rhs,
const DATA_TYPE &    eps = (DATA_TYPE)0
[inline]
 

Tests 2 matrices for equality within a tolerance.

Parameters:
lhs  The first matrix
rhs  The second matrix
eps  The tolerance value
Precondition:
Both matrices must be of the same size.
Returns:
true if the matrices' elements are within the tolerance value of each other; false otherwise

Definition at line 485 of file MatrixOps.h.

00486    {
00487       gmtlASSERT( eps >= (DATA_TYPE)0 );
00488 
00489       for (unsigned int i = 0; i < ROWS*COLS; ++i)
00490       {
00491          if (!Math::isEqual( lhs.mData[i], rhs.mData[i], eps ))
00492             return false;
00493       }
00494       return true;
00495    }

template<class DATA_TYPE, typename ROT_ORDER>
bool isEqual const EulerAngle< DATA_TYPE, ROT_ORDER > &    e1,
const EulerAngle< DATA_TYPE, ROT_ORDER > &    e2,
const DATA_TYPE &    eps = (DATA_TYPE)0
[inline]
 

Compares e1 and e2 (component-wise) to see if they are the same within a given tolerance.

Precondition:
eps must be >= 0
Parameters:
e1  the first EulerAngle
e2  the second EulerAngle
eps  the epsilon tolerance value, in radians
Returns:
true if e1 is within the tolerance of e2; false if not

Definition at line 95 of file EulerAngleOps.h.

00098 {
00099    gmtlASSERT(eps >= (DATA_TYPE)0);
00100    
00101    // @todo metaprogramming.
00102    if (!Math::isEqual( e1[0], e2[0], eps )) return false;
00103    if (!Math::isEqual( e1[1], e2[1], eps )) return false;
00104    if (!Math::isEqual( e1[2], e2[2], eps )) return false;
00105    return true;
00106 }

template<typename POS_TYPE, typename ROT_TYPE>
bool isEqual const Coord< POS_TYPE, ROT_TYPE > &    c1,
const Coord< POS_TYPE, ROT_TYPE > &    c2,
typename Coord< POS_TYPE, ROT_TYPE >::DataType    tol = (typename Coord<POS_TYPE, ROT_TYPE>::DataType)0.0
 

Compare two coordinate frames for equality with a given tolerance.

Parameters:
c1  the first Coord
c2  the second Coord
tol  the tolerance coordinate frame of the same type as c1 and c2
Returns:
true if c1 is equal within a tolerance of c2, false otherwise

Definition at line 79 of file CoordOps.h.

00083    {
00084       return bool( isEqual( c1.getPos(), c2.getPos(), tol ) &&
00085                    isEqual( c1.getRot(), c2.getRot(), tol )     );
00086    }

template<class DATA_TYPE>
bool isEqual const AxisAngle< DATA_TYPE > &    a1,
const AxisAngle< DATA_TYPE > &    a2,
const DATA_TYPE &    eps = (DATA_TYPE)0
[inline]
 

Compares a1 and a2 to see if they are the same within the given epsilon tolerance.

Precondition:
eps must be >= 0
Parameters:
a1  the first vector
a2  the second vector
eps  the epsilon tolerance value
Returns:
true if a1 equals a2 within tolerance; false if they differ

Definition at line 96 of file AxisAngleOps.h.

00099 {
00100    gmtlASSERT( eps >= (DATA_TYPE)0 );
00101    
00102    // @todo metaprogramming.
00103    if (!Math::isEqual( a1[0], a2[0], eps )) return false;
00104    if (!Math::isEqual( a1[1], a2[1], eps )) return false;
00105    if (!Math::isEqual( a1[2], a2[2], eps )) return false;
00106    if (!Math::isEqual( a1[3], a2[3], eps )) return false;
00107    return true;
00108 }

template<class DATA_TYPE>
bool isEqual const AABox< DATA_TYPE > &    b1,
const AABox< DATA_TYPE > &    b2,
const DATA_TYPE &    eps
[inline]
 

Compare two AABoxes to see if they are the same within the given tolerance.

Parameters:
b1  the first box to compare
b2  the second box to compare
eps  the tolerance value to use
Precondition:
eps must be >= 0
Returns:
true if their points are within the given tolerance of each other, false otherwise

Definition at line 93 of file AABoxOps.h.

00094 {
00095    gmtlASSERT( eps >= 0 );
00096    return (b1.isEmpty() == b2.isEmpty()) &&
00097           isEqual( b1.getMin(), b2.getMin(), eps ) &&
00098           isEqual( b1.getMax(), b2.getMax(), eps );
00099 }

template<typename DATA_TYPE>
bool isEquiv const Quat< DATA_TYPE > &    q1,
const Quat< DATA_TYPE > &    q2,
DATA_TYPE    tol = 0.0
 

Compare two quaternions for geometric equivelence (with tolerance).

there exist 2 quats for every possible rotation: the original, and its negative. the negative of a rotation quaternion is geometrically equivelent to the original.

Definition at line 662 of file QuatOps.h.

00663    {
00664       return bool( isEqual( q1, q2, tol ) || isEqual( q1, -q2, tol ) );
00665    }

template<class DATA_TYPE, unsigned SIZE>
bool operator!= const VecBase< DATA_TYPE, SIZE > &    v1,
const VecBase< DATA_TYPE, SIZE > &    v2
[inline]
 

Compares v1 and v2 to see if they are NOT exactly the same with zero tolerance.

Parameters:
v1  the first vector
v2  the second vector
Returns:
true if v1 does not equal v2; false if they are equal

Definition at line 498 of file VecOps.h.

00500 {
00501    return(! (v1 == v2));
00502 }

template<class DATA_TYPE>
bool operator!= const Tri< DATA_TYPE > &    tri1,
const Tri< DATA_TYPE > &    tri2
 

Compare two triangle to see if they are not EXACTLY the same.

Parameters:
tri1  the first triangle to compare
tri2  the second triangle to compare
Returns:
true if they are not equal, false otherwise

Definition at line 107 of file TriOps.h.

00108 {
00109    return (! (tri1 == tri2));
00110 }

template<class DATA_TYPE>
bool operator!= const Sphere< DATA_TYPE > &    s1,
const Sphere< DATA_TYPE > &    s2
[inline]
 

Compare two spheres to see if they are not EXACTLY the same.

Parameters:
s1  the first sphere to compare
s2  the second sphere to compare
Returns:
true if they are not equal, false otherwise

Definition at line 72 of file SphereOps.h.

00073 {
00074    return (! (s1 == s2));
00075 }

template<typename DATA_TYPE>
bool operator!= const Quat< DATA_TYPE > &    q1,
const Quat< DATA_TYPE > &    q2
[inline]
 

Compare two quaternions for not-equality.

See also:
isEqual( Quat, Quat )

Definition at line 640 of file QuatOps.h.

00641    {
00642       return !operator==( q1, q2 );
00643    }

template<class DATA_TYPE>
bool operator!= const Plane< DATA_TYPE > &    p1,
const Plane< DATA_TYPE > &    p2
[inline]
 

Compare two planes to see if they are not EXACTLY the same.

In other words, this comparison is done with zero tolerance.

Parameters:
p1  the first plane to compare
p2  the second plane to compare
Returns:
true if they are not equal, false otherwise

Definition at line 169 of file PlaneOps.h.

00170 {
00171    return (! (p1 == p2));
00172 }

template<typename DATA_TYPE, unsigned ROWS, unsigned COLS>
bool operator!= const Matrix< DATA_TYPE, ROWS, COLS > &    lhs,
const Matrix< DATA_TYPE, ROWS, COLS > &    rhs
[inline]
 

Tests 2 matrices for inequality.

Parameters:
lhs  The first matrix
rhs  The second matrix
Precondition:
Both matrices must be of the same size.
Returns:
false if the matrices differ on any element value; true otherwise

Definition at line 472 of file MatrixOps.h.

00473    {
00474       return bool( !(lhs == rhs) );
00475    }

template<class DATA_TYPE, typename ROT_ORDER>
bool operator!= const EulerAngle< DATA_TYPE, ROT_ORDER > &    e1,
const EulerAngle< DATA_TYPE, ROT_ORDER > &    e2
[inline]
 

Compares e1 and e2 (component-wise) to see if they are NOT exactly the same.

Parameters:
e1  the first EulerAngle
e2  the second EulerAngle
Returns:
true if e1 does not equal e2; false if they are equal

Definition at line 76 of file EulerAngleOps.h.

00078 {
00079    return(! (e1 == e2));
00080 }

template<typename POS_TYPE, typename ROT_TYPE>
bool operator!= const Coord< POS_TYPE, ROT_TYPE > &    c1,
const Coord< POS_TYPE, ROT_TYPE > &    c2
[inline]
 

Compare two coordinate frames for not-equality.

Parameters:
c1  the first Coord
c2  the second Coord
Returns:
true if c1 is different from c2, false otherwise

Definition at line 66 of file CoordOps.h.

00068    {
00069       return !operator==( c1, c2 );
00070    }

template<class DATA_TYPE>
bool operator!= const AxisAngle< DATA_TYPE > &    a1,
const AxisAngle< DATA_TYPE > &    a2
[inline]
 

Compares 2 AxisAngles to see if they are NOT exactly the same.

Parameters:
a1  the first AxisAngle
a2  the second AxisAngle
Returns:
true if a1 does not equal a2; false if they are equal

Definition at line 77 of file AxisAngleOps.h.

00079 {
00080    return !(a1 == a2);
00081 }

template<class DATA_TYPE>
bool operator!= const AABox< DATA_TYPE > &    b1,
const AABox< DATA_TYPE > &    b2
[inline]
 

Compare two AABoxes to see if they are not EXACTLY the same.

In other words, this comparison is done with zero tolerance.

Parameters:
b1  the first box to compare
b2  the second box to compare
Returns:
true if they are not equal, false otherwise

Definition at line 76 of file AABoxOps.h.

00077 {
00078    return (! (b1 == b2));
00079 }

template<class DATA_TYPE, unsigned SIZE>
bool operator== const VecBase< DATA_TYPE, SIZE > &    v1,
const VecBase< DATA_TYPE, SIZE > &    v2
[inline]
 

Compares v1 and v2 to see if they are exactly the same.

Parameters:
v1  the first vector
v2  the second vector
Returns:
true if v1 equals v2; false if they differ

Definition at line 468 of file VecOps.h.

00470 {
00471    for(unsigned i=0;i<SIZE;++i)
00472    {
00473       if(v1[i] != v2[i])
00474       {
00475          return false;
00476       }
00477    }
00478 
00479    return true;
00480 
00481    /*  Would like this
00482    return(vec[0] == _v[0] &&
00483           vec[1] == _v[1] &&
00484           vec[2] == _v[2]);
00485           */
00486 }

template<class DATA_TYPE>
bool operator== const Tri< DATA_TYPE > &    tri1,
const Tri< DATA_TYPE > &    tri2
 

Compare two triangles to see if they are EXACTLY the same.

Parameters:
tri1  the first triangle to compare
tri2  the second triangle to compare
Returns:
true if they are equal, false otherwise

Definition at line 91 of file TriOps.h.

00092 {
00093    return ( (tri1[0] == tri2[0]) &&
00094             (tri1[1] == tri2[1]) &&
00095             (tri1[2] == tri2[2]) );
00096 }

template<class DATA_TYPE>
bool operator== const Sphere< DATA_TYPE > &    s1,
const Sphere< DATA_TYPE > &    s2
[inline]
 

Compare two spheres to see if they are EXACTLY the same.

Parameters:
s1  the first sphere to compare
s2  the second sphere to compare
Returns:
true if they are equal, false otherwise

Definition at line 58 of file SphereOps.h.

00059 {
00060    return ( (s1.mCenter == s2.mCenter) && (s1.mRadius == s2.mRadius) );
00061 }

template<typename DATA_TYPE>
bool operator== const Quat< DATA_TYPE > &    q1,
const Quat< DATA_TYPE > &    q2
[inline]
 

Compare two quaternions for equality.

See also:
isEqual( Quat, Quat )

Definition at line 628 of file QuatOps.h.

00629    {
00630       return bool( q1[0] == q2[0] &&
00631                    q1[1] == q2[1] &&
00632                    q1[2] == q2[2] &&
00633                    q1[3] == q2[3]  );
00634    }

template<class DATA_TYPE>
bool operator== const Plane< DATA_TYPE > &    p1,
const Plane< DATA_TYPE > &    p2
[inline]
 

Compare two planes to see if they are EXACTLY the same.

In other words, this comparison is done with zero tolerance.

Parameters:
p1  the first plane to compare
p2  the second plane to compare
Returns:
true if they are equal, false otherwise

Definition at line 154 of file PlaneOps.h.

00155 {
00156    return ( (p1.mNorm == p2.mNorm) && (p1.mOffset == p2.mOffset) );
00157 }

template<typename DATA_TYPE, unsigned ROWS, unsigned COLS>
bool operator== const Matrix< DATA_TYPE, ROWS, COLS > &    lhs,
const Matrix< DATA_TYPE, ROWS, COLS > &    rhs
[inline]
 

Tests 2 matrices for equality.

Parameters:
lhs  The first matrix
rhs  The second matrix
Precondition:
Both matrices must be of the same size.
Returns:
true if the matrices have the same element values; false otherwise

Definition at line 446 of file MatrixOps.h.

00447    {
00448       for (unsigned int i = 0; i < ROWS*COLS; ++i)
00449       {
00450          if (lhs.mData[i] != rhs.mData[i])
00451          {
00452             return false;
00453          }
00454       }
00455 
00456       return true;
00457 
00458       /*  Would like this
00459       return( lhs[0] == rhs[0] &&
00460               lhs[1] == rhs[1] &&
00461               lhs[2] == rhs[2] );
00462       */
00463    }

template<class DATA_TYPE, typename ROT_ORDER>
bool operator== const EulerAngle< DATA_TYPE, ROT_ORDER > &    e1,
const EulerAngle< DATA_TYPE, ROT_ORDER > &    e2
[inline]
 

Compares 2 EulerAngles (component-wise) to see if they are exactly the same.

Parameters:
e1  the first EulerAngle
e2  the second EulerAngle
Returns:
true if e1 equals e2; false if they differ

Definition at line 57 of file EulerAngleOps.h.

00059 {
00060    // @todo metaprogramming.
00061    if (e1[0] != e2[0]) return false;
00062    if (e1[1] != e2[1]) return false;
00063    if (e1[2] != e2[2]) return false;
00064    return true;
00065 }

template<typename POS_TYPE, typename ROT_TYPE>
bool operator== const Coord< POS_TYPE, ROT_TYPE > &    c1,
const Coord< POS_TYPE, ROT_TYPE > &    c2
[inline]
 

Compare two coordinate frames for equality.

Parameters:
c1  the first Coord
c2  the second Coord
Returns:
true if c1 is the same as c2, false otherwise

Definition at line 53 of file CoordOps.h.

00055    {
00056       return bool( c1.getPos() == c2.getPos() &&
00057                    c1.getRot() == c2.getRot() );
00058    }

template<class DATA_TYPE>
bool operator== const AxisAngle< DATA_TYPE > &    a1,
const AxisAngle< DATA_TYPE > &    a2
[inline]
 

Compares 2 AxisAngles to see if they are exactly the same.

Parameters:
a1  the first AxisAngle
a2  the second AxisAngle
Returns:
true if a1 equals a2; false if they differ

Definition at line 57 of file AxisAngleOps.h.

00059 {
00060    // @todo metaprogramming.
00061    if (a1[0] != a2[0]) return false;
00062    if (a1[1] != a2[1]) return false;
00063    if (a1[2] != a2[2]) return false;
00064    if (a1[3] != a2[3]) return false;
00065    return true;
00066 }

template<class DATA_TYPE>
bool operator== const AABox< DATA_TYPE > &    b1,
const AABox< DATA_TYPE > &    b2
[inline]
 

Compare two AABoxes to see if they are EXACTLY the same.

In other words, this comparison is done with zero tolerance.

Parameters:
b1  the first box to compare
b2  the second box to compare
Returns:
true if they are equal, false otherwise

Definition at line 59 of file AABoxOps.h.

00060 {
00061    return ( (b1.isEmpty() == b2.isEmpty()) &&
00062             (b1.getMin() == b2.getMin()) &&
00063             (b1.getMax() == b2.getMax()) );
00064 }


Generated on Mon Apr 7 15:29:24 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002