Let $P$ be a monic irreducible integral polynomial. Let $K=\mathbf Q[X]/(P)$ be the associated number field, $\mathcal O$ be its ring of integers and $R$ be the order $\mathbf Z[X]/(P)$. (In general, $\mathcal O$ and $R$ do not coincide.) Both $R$ and $\mathcal O$ have finite number of ideal classes.
My question is: how do theses these class numbers compare?
It seems to me that $\cdot \otimes_{R}\mathcal O$ gives a natural map from ideal classes in $R$ to ideal classes in $\mathcal O$ which is surjective if I am not wrong. But, for example, in the case where the class number of $\mathcal O$ is 1, can we control the class number in $R$.R$?
Also: I know how to make pari/gp compute the class number in $\mathcal O$. Is there a way to have it compute the ideal classes class number in $R$?

