Computing invariant subspaces of a regular linear pencil of matrices