def _pack_simple_periodic(R, L, n, rng): dim = L.shape[0] r = np.empty([n, dim]) while True: for i_dim in range(dim): r[:, i_dim] = rng.uniform(-L[i_dim] / 2.0, L[i_dim] / 2.0, size=(n,)) if not np.any(pdist_sq_periodic(r, L) < (2.0 * R) ** 2): return r, R
def __init__(self, r_0, L_0, R, dr_max, dL_max, rng=None): super(MetroRCPPeriodic, self).__init__(r_0, L_0, R, dr_max, dL_max, rng) self.sep_sq = pdist_sq_periodic(r_0, self.L)