Prev | Up | Next

Boolean Operations

The following boolean operators and methods are available in the matrix class.

1. bool operator== (const matrix<T>& m1, const matrix<T>& m2);
2. bool operator!= (const matrix<T>& m1, const matrix<T>& m2);

3. bool isSquare () const;
4. bool isSingular () const;
5. bool isDiagonal () const;
6. bool isScalar () const;
7. bool isUnit () const;
8. bool isNull () const;
9. bool isSymmetric () const;
10. bool isSkewSymmetric () const;
11. bool isUpperTriangular () const;
12. bool isLowerTriangular () const;
13. bool isRowOrthogonal () const;
14. bool isColOrthogonal () const;

  1. Compares the matrix m1 and m2, and returns true if they are equal; otherwise, it returns false.


  2. Compares the matrix m1 and m2, and returns true if they are not equal; otherwise, it returns false.


  3. Returns true if the matrix is a square matrix; otherwise, it returns false.


  4. Returns true if the matrix is singular; otherwise, it returns false


  5. Returns true if the matrix is diagonal; otherwise, it returns false


  6. Returns true if the matrix is a scalar matrix; otherwise, it returns false


  7. Returns true if the matrix is a unit matrix; otherwise, it returns false


  8. Returns true if the matrix is a null matrix; otherwise, it returns false


  9. Returns true if the matrix is symmetric; otherwise, it returns false


  10. Returns true if the matrix is skew-symmetric; otherwise, it returns false


  11. Returns true if the matrix is upper triangular; otherwise, it returns false


  12. Returns true if the matrix is lower triangular; otherwise, it returns false


  13. Returns true if the matrix is row orthogonal; otherwise, it returns false


  14. Returns true if the matrix is column orthogonal; otherwise, it returns false


Examples
typedef techsoft::matrix<double> Matrix;

Matrix A(5,5);

A.rand();
const Matrix B = A;

bool bVal = A == B;

bVal = B.isSingular(); 
bVal = B.isSymmetric();
bVal = B.isLowerTriangular();
bVal = B.isRowOrthogonal();