Computes Graves bases of matrices