9#include "../include/minisketch.h"
15 for (
int i = 3000; i < 3010; ++i) {
20 assert(sersize == 12 * 4 / 8);
21 unsigned char *buffer_a = malloc(sersize);
26 for (
int i = 3002; i < 3012; ++i) {
39 uint64_t differences[4];
43 if (num_differences < 0) {
44 printf(
"More than 4 differences!\n");
47 for (i = 0; i < num_differences; ++i) {
48 printf(
"%u is in only one of the two sets\n", (
unsigned)differences[i]);
MINISKETCH_API void minisketch_serialize(const minisketch *sketch, unsigned char *output)
Serialize a sketch to bytes.
MINISKETCH_API ssize_t minisketch_decode(const minisketch *sketch, size_t max_elements, uint64_t *output)
Decode a sketch.
MINISKETCH_API size_t minisketch_merge(minisketch *sketch, const minisketch *other_sketch)
Merge the elements of another sketch into this sketch.
MINISKETCH_API size_t minisketch_serialized_size(const minisketch *sketch)
Compute the size in bytes for serializing a given sketch.
MINISKETCH_API minisketch * minisketch_create(uint32_t bits, uint32_t implementation, size_t capacity)
Construct a sketch for a given element size, implementation and capacity.
MINISKETCH_API void minisketch_add_uint64(minisketch *sketch, uint64_t element)
Add an element to a sketch.
MINISKETCH_API void minisketch_deserialize(minisketch *sketch, const unsigned char *input)
Deserialize a sketch from bytes.
MINISKETCH_API void minisketch_destroy(minisketch *sketch)
Destroy a sketch.
struct minisketch minisketch
Opaque type for decoded sketches.