Ask Your Question
1

Testing if an object is a Matrix or a Vector

asked 0 years ago

Thierry Dumont gravatar image

updated 0 years ago

For a long time I used :

is_Matrix(A)
is_Vector(B)

but it is now deprecated. So I tried, like in https://ask.sagemath.org/question/975..., isinstance(A,sage.matrix.matrix.Matrix) which does not work.

What can I do ?

Preview: (hide)

Comments

Does this one work?: isinstance(A,sage.structure.element.Matrix)

tolga gravatar imagetolga ( 0 years ago )

Yes it works ! And also isinstance(B,sage.structure.element..Vector) works. Thhanks a lot !

Thierry Dumont gravatar imageThierry Dumont ( 0 years ago )
1

@tolga : for the benefit of future ask.sagemath.org (per-)users, please make a formal response from your comment...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 0 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 0 years ago

tolga gravatar image

This command does the job:

isinstance(A,sage.structure.element.Matrix)
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 0 years ago

Seen: 74 times

Last updated: Apr 19