Question: I need to compute the Drazin inverse $A^D$ of a singular M-matrix $A$, i.e., a matrix in the form $A=\lambda I -P$, where $P$ has nonnegative entries and $\lambda$ is the spectral radius (Perron value) of $P$. I already know the right and left eigenvectors $v$ and $u^T$ of $P$ with eigenvalue $\lambda$ (that is, the vectors in the left and right kernel of $A$).

1) Is there a Matlab subroutine around for computing Drazin inverses? I can't seem to find any, so I had to create my own (which is probably very inefficient)

2) Is there a way to exploit the knowledge of the two nullspaces (and the fact that they are 1-dimensional) to speed up this computation?

Answer: 
If you have access to Matlab, and the matrix is not gigantic 
you can use the following to calculate the Drazin inverse:

1. Determine the index of $A$, i.e, does $\mathrm{rank}(A^k) = \mathrm{rank}(A^{k+1})$
2. Solve the linear system $A^{k+1} X = A^k$
3. Use the fact that $A^D$, the Drazin inverse, is given by

$$A^D = A^k X^{k+1}$$

Jim Shoaf, N. C. Central University
This one might have some pertinent leads:

<http://www.sciencedirect.com/science/article/pii/0024379585902356>