-
Notifications
You must be signed in to change notification settings - Fork 1
/
make_graph.h
81 lines (69 loc) · 3.24 KB
/
make_graph.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* Copyright (C) 2009-2010 The Trustees of Indiana University. */
/* */
/* Use, modification and distribution is subject to the Boost Software */
/* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */
/* http://www.boost.org/LICENSE_1_0.txt) */
/* */
/* Authors: Jeremiah Willcock */
/* Andrew Lumsdaine */
#ifndef MAKE_GRAPH_H
#define MAKE_GRAPH_H
#include <stdint.h>
#include "graph_generator.h"
#ifdef _GRAPPA
/* Simplified interface for users; implemented in different ways on different
* platforms. */
void make_graph(
/* in */ int log_numverts /* log_2 of vertex count */,
/* in */ int64_t desired_nedges /* Target number of edges */,
/* in */ uint64_t userseed1 /* Arbitrary 64-bit seed value */,
/* in */ uint64_t userseed2 /* Arbitrary 64-bit seed value */,
/* out */ int64_t* nedges /* Number of generated edges */,
/* out */ GlobalAddress<packed_edge>* result /* Array of edges; allocated by
make_graph() but must be freed using
free() by user */
/* See functions in graph_generator.h for the definition of and how to
* manipulate packed_edge objects (functions are write_edge,
* get_v0_from_edge, get_v1_from_edge). */
);
void load_tuple_graph( std::string path, std::string format, int64_t* nedges_ptr_in, GlobalAddress<packed_edge> * result_ptr_in);
#else
#ifdef __cplusplus
extern "C" {
#endif
/* Simplified interface for users; implemented in different ways on different
* platforms. */
void make_graph(
/* in */ int log_numverts /* log_2 of vertex count */,
/* in */ int64_t desired_nedges /* Target number of edges */,
/* in */ uint64_t userseed1 /* Arbitrary 64-bit seed value */,
/* in */ uint64_t userseed2 /* Arbitrary 64-bit seed value */,
/* out */ int64_t* nedges /* Number of generated edges */,
/* out */ packed_edge** result /* Array of edges; allocated by
make_graph() but must be freed using
free() by user */
/* See functions in graph_generator.h for the definition of and how to
* manipulate packed_edge objects (functions are write_edge,
* get_v0_from_edge, get_v1_from_edge). */
);
#ifdef __cplusplus
}
#endif
#endif // _GRAPPA
#ifdef __cplusplus
extern "C" {
#endif
/* PRNG interface for implementations; takes seed in same format as given by
* users, and creates a vector of doubles in a reproducible (and
* random-access) way. */
void make_random_numbers(
/* in */ int64_t nvalues /* Number of values to generate */,
/* in */ uint64_t userseed1 /* Arbitrary 64-bit seed value */,
/* in */ uint64_t userseed2 /* Arbitrary 64-bit seed value */,
/* in */ int64_t position /* Start index in random number stream */,
/* out */ double* result /* Returned array of values */
);
#ifdef __cplusplus
}
#endif
#endif /* MAKE_GRAPH_H */