Build up matrix types.