linbox
examples/omp_smithvalence.C

Valence of sparse matrix over Z or Zp.