I am trying to write a generic matrix valued function in a package, of the form:
f[matrix_] := Module[...]
My problem is that I want to accept any matrix, but always assume that the functions/variables contained within the matrix are real. I realise that I can set assumptions when doing calculations, but for this it seems that I need to know the functions or variables before hand in order to set the assumptions up. How can I tell mathematica that any element of the matrix should be assumed to be real?
For clarification, lets say I do f[{{x,x^2},{h[x],S[y]^2}}]
. I want mathematica to assume that x, x^2, h[x] and S[y]
are all functions only involving real numbers, so I don't get Conjugate(S[y]^2)
type answers in the output of my function.
real[m : {{__Real} ..}] := m * 10
$\endgroup$