-
Notifications
You must be signed in to change notification settings - Fork 0
/
rmaxcut.h
51 lines (40 loc) · 902 Bytes
/
rmaxcut.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
#ifndef RMAXCUT_H
#define RMAXCUT_H
#define MC_VERSION "0.0.0-r33-dirty"
#include <stdint.h>
#include <stdio.h>
typedef struct {
char *name;
int32_t w[2][2];
int8_t s;
} mc_node_t;
typedef struct {
uint64_t x;
int32_t w;
} mc_edge_t;
typedef struct {
uint32_t n_node, m_node;
mc_node_t *node;
uint32_t n_edge, m_edge;
mc_edge_t *edge;
uint64_t *idx; // index to find edges
uint64_t *cc; // connected components
void *h_name;
} mc_graph_t;
typedef struct {
int32_t max_iter;
int32_t n_perturb;
double f_perturb;
uint64_t seed;
} mc_opt_t;
extern int mc_verbose;
mc_graph_t *mc_read(const char *fn);
void mc_index(mc_graph_t *g);
void mc_destroy(mc_graph_t *g);
void mc_print_cut(FILE *fp, const mc_graph_t *g);
void mc_opt_init(mc_opt_t *opt);
void mc_solve(const mc_opt_t *opt, mc_graph_t *g);
double mc_realtime(void);
double mc_cputime(void);
long mc_peakrss(void);
#endif