Percolation/Mean cluster density: Difference between revisions

m
Line 257:
racket/unsafe/ops)
; these aren't in racket/unsafe/ops
(only-in racket/fixnum for/fxvector in-fxvector fxvector-copy))
 
; ...(but less safe). if in doubt use this rather than the one above
Line 337:
(t 10)
(for ((n (in-list '(4000 1000 750 500 400 300 200 100 15))))
(experiment 1/2 n (t))))
(display-sample-clustering 1/2))
 
(module+ test
(define grd (build-random-grid 1/2 1000 1000))
(/ (for/sum ((g (in-fxvector grd)) #:when (zero? g)) 1) (fxvector-length grd))
(display-sample-clustering 1/2))</lang>
 
569

edits