I am looking for an easy way of calculating the number of similarity classes of complex matrices that satisfy some polynomial $p(t)$.
As an example consider $p(t)=(t-1)^3(t+1)^4$ and $5\times 5$ matrices. How do we calculate the number of similarity classes that are zeroes of $p(t)$? The method i found is long and i am not happy with it so I hope there is a better way.
Step 1. Find all polynomials that divide $p(t)$ and have order less than 5.
Step 2. Each of these are now minimal polynomials and you find how many similarity classes satisfy that minimal polynomial using JCF.
For example if $m(t)=(t-1)^2$ we have $5=2+2+1=2+1+1+1$ so two similarity classes as we can have 2 big blocks or 1 big block. We do that for all the polynomials and sum up what we got.
This takes a while and I feel like there must be a slicker way.
Any hints would be appreciated.