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 1919
2020(: unweighted-samples->hash (All (A) ((Sequenceof A) -> (HashTable A Positive-Integer))))
2121(define (unweighted-samples->hash xs)
22- (define: h : (HashTable A Positive-Integer) (make-hash))
22+ (define: h : (Mutable- HashTable A Positive-Integer) (make-hash))
2323 (for: ([x : A xs])
2424 (hash-set! h x (unsafe-fx+ 1 (hash-ref h x (λ () 0 )))))
2525 h)
2828 -> (HashTable A Nonnegative-Real))))
2929(define (weighted-samples->hash xs ws)
3030 (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))
3232 (for: ([x : A xs] [w : Nonnegative-Real ws])
3333 (hash-set! h x (+ w (hash-ref h x (λ () 0 )))))
3434 h))
You can’t perform that action at this time.
0 commit comments