Linear-scaling computation of ground state with time-domain localized-density-matrix method