This is a special case of sparse matrices, used by coxme WWW: http://cran.r-project.org/web/packages/bdsmatrix/