Linear and Affine Algebra 277
Finally, the class implements the standard six comparison operators to
support sorted container classes; see Listing 6.19.
template <int NumRows , int NumCols , typename Real>
class Matrix
{
public :
// comparisons for sorted containers and geometric ordering
bool operator== ( M a t r i x const&mat) const ;
bool operator!= ( M atrix const&mat) const ;
bool operator< (Matrix const&mat) const ;
bool operator<=(Matrix const&mat) const ;
bool operator> (Matrix const&mat) const ;
bool operator>=(Matrix const&mat) const ;
} ;
LISTING 6.19: Comparison operators for the matrix class.
A large number of functions are defined outside the class, a practice sug-
gested in [55, Rule 44]. Included are unary operators so that you can write
expressions ...