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;
- Compares the matrix m1 and m2, and returns true if they are equal; otherwise, it returns false.
- Compares the matrix m1 and m2, and returns true if they are not equal; otherwise, it returns false.
- Returns true if the matrix is a square matrix;
otherwise, it returns false.
- Returns true if the matrix is singular; otherwise, it returns false
- Returns true if the matrix is diagonal; otherwise, it returns false
- Returns true if the matrix is a scalar matrix; otherwise, it returns false
- Returns true if the matrix is a unit matrix; otherwise, it returns false
- Returns true if the matrix is a null matrix; otherwise, it returns false
- Returns true if the matrix is symmetric; otherwise, it returns false
- Returns true if the matrix is skew-symmetric; otherwise, it returns false
- Returns true if the matrix is upper triangular; otherwise, it returns false
- Returns true if the matrix is lower triangular; otherwise, it returns false
- Returns true if the matrix is row orthogonal; otherwise, it returns false
- 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();