34.2 IsMat

IsMat( obj )

IsMat return true if obj, which can be an object of arbitrary type, is a matrix and false otherwise. Will cause an error if obj is an unbound variable.

    gap> IsMat( [ [ 1, 0 ], [ 0, 1 ] ] );
    true    # a matrix is a list of vectors
    gap> IsMat( [ [ 1, 2, 3, 4, 5 ] ] );
    true
    gap> IsMat( [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ] ] );
    true
    gap> IsMat( [ [ Z(2)^0, 0 ], [ 0, Z(2)^0 ] ] );
    false    # 'Z(2)\^0' and '0' do not lie in a common field
    gap> IsMat( [ 1, 0 ] );
    false    # a vector is not a matrix
    gap> IsMat( 1 );
    false    # neither is a scalar 

Previous Up Top Next
Index

GAP 3.4.4
April 1997