Skip to content

Commit f37f15c

Browse files
committed
src/sage/stats/distributions/discrete_gaussian_lattice.py: more long time
Add "# long time" to two _normalisation_factor_zz() examples. These take ~30s on one of my machines, and ~50s on another. Although they run fast enough on the CI, I think it is reasonable to mark them as taking a long time -- they are the two slowest examples in this file for me.
1 parent ec31f54 commit f37f15c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sage/stats/distributions/discrete_gaussian_lattice.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def _normalisation_factor_zz(self, tau=None, prec=None):
254254
255255
sage: Sigma = Matrix(ZZ, [[5, -2, 4], [-2, 10, -5], [4, -5, 5]])
256256
sage: D = DGL(ZZ^3, Sigma, [7, 2, 5])
257-
sage: D._normalisation_factor_zz()
257+
sage: D._normalisation_factor_zz() # long time
258258
78.6804...
259259
260260
sage: M = Matrix(ZZ, [[1, 3, 0], [-2, 5, 1]])
@@ -489,14 +489,15 @@ def __init__(self, B, sigma=1, c=0, r=None, precision=None, sigma_basis=False):
489489
sage: c = vector(ZZ, [7, 2, 5])
490490
sage: D = distributions.DiscreteGaussianDistributionLatticeSampler(ZZ^n, Sigma, c)
491491
sage: f = D.f
492-
sage: nf = D._normalisation_factor_zz(); nf # This has not been properly implemented
492+
sage: # This has not been properly implemented...
493+
sage: nf = D._normalisation_factor_zz(); nf # long time
493494
78.6804...
494495
495496
We can compute the expected number of samples before sampling a vector::
496497
497498
sage: v = vector(ZZ, n, (11, 4, 8))
498499
sage: v.set_immutable()
499-
sage: 1 / (f(v) / nf)
500+
sage: 1 / (f(v) / nf) # long time
500501
2553.9461...
501502
502503
sage: counter = defaultdict(Integer); m = 0

0 commit comments

Comments
 (0)