32.2 IsVector

IsVector( obj )

IsVector returns true if obj, which may be an object of arbitrary type, is a vector and false else. A vector is a list without holes, whose elements all come from a common field.

    gap> IsVector( [ 0, -3, -2, 0, 6 ] );
    true
    gap> IsVector( [ Z(3^4)^3, Z(3^2)^5, Z(3^4)^13 ] );
    true
    gap> IsVector( [ 0, Z(2^3)^3, Z(2^3) ] );
    false    # integers are not finite field elements
    gap> IsVector( [ , 2, 3,, 5,, 7 ] );
    false    # list that have holes are not vectors
    gap> IsVector( 0 );
    false    # not even a list 

Previous Up Top Next
Index

GAP 3.4.4
April 1997