Question: Assume real matrix

Hello,

I would like to assume a matrix to have only real components.

I have seen that the function assume has some features to assume properties for matrix. But, I didn't find the one that I want : "assume a matrix to have only real components".

This assumation should allow me to suppress this kind of choice in my code :

if A::{complexcons, undefined} then
evalf(1/A);
elif A::rtable and ArrayTools:-NumElems(A) = 1 then
Vector([evalf(1/A(1))]);
else
evalf(LinearAlgebra:-MatrixInverse(A));
end if;

Do you have some ideas ?

P.S: The matrix should be also a square matrix. So, the first code line will probably be : assume(a, 'SquareMatrix')

Thanks a lot for your help.

Please Wait...