File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
math-lib/math/private/statistics Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 19
19
20
20
(: unweighted-samples->hash (All (A) ((Sequenceof A) -> (HashTable A Positive-Integer))))
21
21
(define (unweighted-samples->hash xs)
22
- (define: h : (HashTable A Positive-Integer) (make-hash))
22
+ (define: h : (Mutable- HashTable A Positive-Integer) (make-hash))
23
23
(for: ([x : A xs])
24
24
(hash-set! h x (unsafe-fx+ 1 (hash-ref h x (λ () 0 )))))
25
25
h)
28
28
-> (HashTable A Nonnegative-Real))))
29
29
(define (weighted-samples->hash xs ws)
30
30
(let-values ([(xs ws) (sequences->weighted-samples 'samples->hash xs ws)])
31
- (define: h : (HashTable A Nonnegative-Real) (make-hash))
31
+ (define: h : (Mutable- HashTable A Nonnegative-Real) (make-hash))
32
32
(for: ([x : A xs] [w : Nonnegative-Real ws])
33
33
(hash-set! h x (+ w (hash-ref h x (λ () 0 )))))
34
34
h))
You can’t perform that action at this time.
0 commit comments