[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-math] Writing packages
From: |
Ralf Hemmecke |
Subject: |
Re: [Axiom-math] Writing packages |
Date: |
Fri, 12 May 2006 23:33:12 +0200 |
User-agent: |
Thunderbird 1.5.0.2 (X11/20060420) |
BTW, I also have another question on this topic: if I compute the
characteristic polynomial of a matrix and then I evaluate the polynomial
at the matrix, I would expect to have the zero matrix as result. This
does not happens: try
m:=matrix([[1,2],[3,4]])
p:=characteristicPolynomial(m)
p(m)
Why?
Because Axiom is not smart enough to figure out all the types for you.
Does this make you happier?
M := SquareMatrix(2,Integer)
m:M:=matrix([[1,2],[3,4]])
P:=SUP(M)
p:P := characteristicPolynomial(m)::P
x := first variables p
eval(p, x, m)
There is no function apply: (P, M) -> M. So how have to browse through
hyperdoc a bit. And not that the P given above is much more appropriate
than Polynomial Integer. Actually, SUP(Integer) should do, but then
there is no way to evaluate such a polynomial at a matrix.
Ralf