Adjoint matrix and Characteristic Polynomial
adjoint(A) charpoly(A)
A | a square matrix |
---|
adjoint
returns the adjoint matrix of A
charpoly
returns the coefficients of the characteristic polynomial of A
as a vector.
These functions compute the adjoint matrix and characteristic polynomial of A by the Fedeew-Leverrier algorithm.
If A has integer elements and the computations are performed with integer arithmetic the result is exact.
edges <- parse.digraph(c( "E *-> D", "D *-> C", "C -> E", "E *-> B", "B *-> A", "A -> E", "D -> B")) edges <- enforce.limitation(edges) A <- adjacency.matrix(edges,labels=TRUE) adjoint(A)#> [,1] [,2] [,3] [,4] [,5] #> A 5 2 2 1 3 #> B 1 2 2 1 3 #> C 2 0 4 2 2 #> D 2 0 0 2 2 #> E 4 0 4 0 4