'Store the stationary distributions in self._stationary_distributions.'

def _compute_stationary(self):

    if self.is_irreducible:
        if (not self.is_sparse):
            stationary_dists = gth_solve(self.P).reshape(1, self.n)
        else:
            stationary_dists = gth_solve(self.P.toarray(), overwrite=True).reshape(1, self.n)
    else:
        rec_classes = self.recurrent_classes_indices
        stationary_dists = np.zeros((len(rec_classes), self.n))
        for (i, rec_class) in enumerate(rec_classes):
            if (not self.is_sparse):
                stationary_dists[(i, rec_class)] = gth_solve(self.P[rec_class, :][:, rec_class])
            else:
                stationary_dists[(i, rec_class)] = gth_solve(self.P[rec_class, :][:, rec_class].toarray(), overwrite=True)
    self._stationary_dists = stationary_dists
