Use the HDFStore to store the matrix together with its context and target indices.