Changeset 35023 in project
 Timestamp:
 01/15/18 18:10:50 (9 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

release/4/bloomfilter/trunk/bloomfilter.scm
r35022 r35023 21 21 22 22 (;export 23 ; 23 24 optimumsize 24 25 optimumk … … 28 29 desiredm 29 30 actualk 31 ; 30 32 makebloomfilter 31 33 bloomfilter? checkbloomfilter errorbloomfilter … … 145 147 (messagedigestprimitivedigestlength mdp) 146 148 (unsignednativeintegersize)) ) ) 147 ; Returns a list of hash values for the supplied object149 ;returns a list of hash values for the supplied object 148 150 (lambda (obj ls) 149 151 (messagedigestresult>integers … … 219 221 ;( p n mdps)  ( m mdps [k]) 220 222 (define (makebloomfilter m mdps #!optional desk) 221 ; Process paramter list variant223 ;processing ( m mdps [k] ) or ( p n mdps ) ? 222 224 (if (list? mdps) 223 225 (checkpositivefixnum 'makebloomfilter m 'm) … … 225 227 (p m) 226 228 (n mdps) ) 227 (checkflonum 'makebloomfilter p 'p) 228 (checkopeninterval 'makebloomfilter p 0.0 1.0 'p) 229 (checkopeninterval 'makebloomfilter (checkflonum 'makebloomfilter p 'p) 0.0 1.0 'p) 229 230 (checkpositivefixnum 'makebloomfilter n 'n) 230 231 (set! mdps desk) 231 232 (set!values (m desk) (optimumsize p n)) ) ) 233 ; 232 234 (foreach 233 235 (cut checkmessagedigestprimitive 'makebloomfilter <>) 234 236 (checklist 'makebloomfilter mdps 'mdps)) 235 ; Get the "desired" # of hash values (k)237 ;get the "desired" # of hash values (k) 236 238 (let ((actk (actualk mdps))) 237 239 (if (not desk) … … 240 242 ;FIXME tell them how ! 241 243 (error 'makebloomfilter "insufficient hash functions supplied" actk desk) ) ) ) 242 ; Bloom filter is a multihash into a bitvector244 ;bloom filter is a multihash into a bitvector 243 245 (%makebloomfilter 244 246 0 m desk
Note: See TracChangeset
for help on using the changeset viewer.