-
Notifications
You must be signed in to change notification settings - Fork 1
/
read_mmap.h
35 lines (29 loc) · 1.03 KB
/
read_mmap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* Defines the format of data storage memory maps, and provides
accessor functions for reading them. Memory maps are composed of
"items" (pages, users), which are feature vectors, or simply a list
of features (page controversy scores).*/
#ifndef __read_mmap_h__
#define __read_mmap_h__
#include <stdint.h>
struct mmap_header {
int64_t data_offset;
int64_t item_count;
};
struct mmap_item {
int64_t id;
double sum_or_norm;
int64_t count_features;
int64_t features_offset;
// With count_features mmap_feature structs at features_offset
};
struct mmap_feature {
int64_t feature_number;
double feature_value;
};
const struct mmap_item* get_items(const char* mfile, int64_t* num_items);
const struct mmap_feature* get_features(const char* mfile,
const struct mmap_item* item);
const struct mmap_feature* get_top_level_features(const char* mfile,
int64_t* num_features);
const char *open_mmap_read(const char *file_name, int *mmapfd);
#endif