  We study the Smith forms of matrices of the form $f(C_g)$ where $f(t),g(t)\in
R[t]$, $C_g$ is the companion matrix of the (monic) polynomial $g(t)$, and $R$
is an elementary divisor domain. Prominent examples of such matrices are
circulant matrices, skew-circulant matrices, and triangular Toeplitz matrices.
In particular, we reduce the calculation of the Smith form of the matrix
$f(C_g)$ to that of the matrix $F(C_G)$, where $F,G$ are quotients of
$f(t),g(t)$ by some common divisor. This allows us to express the last non-zero
determinantal divisor of $f(C_g)$ as a resultant. A key tool is the observation
that a matrix ring generated by $C_g$ -- the companion ring of $g(t)$ -- is
isomorphic to the polynomial ring $Q_g=R[t]/<g(t)>$. We relate several features
of the Smith form of $f(C_g)$ to the properties of the polynomial $g(t)$ and
the equivalence classes $[f(t)]\in Q_g$. As an application we let $f(t)$ be the
Alexander polynomial of a torus knot and $g(t)=t^n-1$, and calculate the Smith
form of the circulant matrix $f(C_g)$. By appealing to results concerning
cyclic branched covers of knots and cyclically presented groups, this provides
the homology of all Brieskorn manifolds $M(r,s,n)$ where $r,s$ are coprime.
