Search code examples
maple

How to check if a list of matrix contains a given matrix in Maple


I have some problems in Maple.

If I have a matrix:

Matrix1 := Matrix(2, 2, {(1, 1) = 31, (1, 2) = -80, (2, 1) = -50, (2, 2) = 43});

I want to decide if it is in the below list:

MatrixList := [Matrix(2, 2, {(1, 1) = 31, (1, 2) = -80, (2, 1) = -50, (2, 2) = 43}), Matrix(2, 2, {(1, 1) = -61, (1, 2) = 77, (2, 1) = -48, (2, 2) = 9})];

I did the following:

evalb(Matrix1 in MatrixList);

but got "false".

Why? And how do I then make a program that decide if a matrix is contained in a list of matrices.


Solution

  • Here's a much cheaper way than DrC's

    ormap(LinearAlgebra:-Equal, MatrixList, Matrix1)