ATLAS Offline Software
bloom-filter.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2005-2008, Simon Howard
4 
5 Permission to use, copy, modify, and/or distribute this software
6 for any purpose with or without fee is hereby granted, provided
7 that the above copyright notice and this permission notice appear
8 in all copies.
9 
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 
19  */
20 
40 #ifndef ALGORITHM_BLOOM_FILTER_H
41 #define ALGORITHM_BLOOM_FILTER_H
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
51 typedef struct _BloomFilter BloomFilter;
52 
57 typedef void *BloomFilterValue;
58 
67 typedef unsigned long (*BloomFilterHashFunc)(BloomFilterValue data);
68 
89 BloomFilter *bloom_filter_new(unsigned int table_size,
90  BloomFilterHashFunc hash_func,
91  unsigned int num_functions);
92 
99 void bloom_filter_free(BloomFilter *bloomfilter);
100 
109 
122 
132 void bloom_filter_read(BloomFilter *bloomfilter, unsigned char *array);
133 
146 void bloom_filter_load(BloomFilter *bloomfilter, unsigned char *array);
147 
166  BloomFilter *filter2);
167 
186  BloomFilter *filter2);
187 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif /* #ifndef ALGORITHM_BLOOM_FILTER_H */
193 
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
BloomFilterHashFunc
unsigned long(* BloomFilterHashFunc)(BloomFilterValue data)
Hash function used to generate hash values for values inserted into a bloom filter.
Definition: bloom-filter.h:67
BloomFilterValue
void * BloomFilterValue
A value stored in a BloomFilter.
Definition: bloom-filter.h:57
athena.value
value
Definition: athena.py:122
bloom_filter_new
BloomFilter * bloom_filter_new(unsigned int table_size, BloomFilterHashFunc hash_func, unsigned int num_functions)
Create a new bloom filter.
bloom_filter_intersection
BloomFilter * bloom_filter_intersection(BloomFilter *filter1, BloomFilter *filter2)
Find the intersection of two bloom filters.
bloom_filter_load
void bloom_filter_load(BloomFilter *bloomfilter, unsigned char *array)
Load the contents of a bloom filter from an array.
bloom_filter_insert
void bloom_filter_insert(BloomFilter *bloomfilter, BloomFilterValue value)
Insert a value into a bloom filter.
bloom_filter_union
BloomFilter * bloom_filter_union(BloomFilter *filter1, BloomFilter *filter2)
Find the union of two bloom filters.
lumiFormat.array
array
Definition: lumiFormat.py:98
bloom_filter_read
void bloom_filter_read(BloomFilter *bloomfilter, unsigned char *array)
Read the contents of a bloom filter into an array.
bloom_filter_query
int bloom_filter_query(BloomFilter *bloomfilter, BloomFilterValue value)
Query a bloom filter for a particular value.
bloom_filter_free
void bloom_filter_free(BloomFilter *bloomfilter)
Destroy a bloom filter.
BloomFilter
struct _BloomFilter BloomFilter
A bloom filter structure.
Definition: bloom-filter.h:51