-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathc_api.h
109 lines (85 loc) · 2.06 KB
/
c_api.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//
// Created by Bryn Keller on 11/16/17.
//
#ifndef RIVET_CONSOLE_C_API_H
#define RIVET_CONSOLE_C_API_H
#include <cstdlib>
extern "C" {
//typedef struct {
// unsigned dimensions;
// double max_distance;
// double * data;
// char * param1_name;
// char * param2_name;
//} PointCloud;
//
typedef struct {
void* input_params;
void* template_points;
void* arrangement;
} Computed;
typedef struct {
double birth;
double death;
unsigned multiplicity;
} Bar;
typedef struct {
Bar* bars;
size_t length;
double angle;
double offset;
} BarCode;
typedef struct {
BarCode* barcodes;
size_t length;
char * error;
size_t error_length;
} BarCodesResult;
typedef struct {
double x_low;
double y_low;
double x_high;
double y_high;
} ArrangementBounds;
struct rivet_comp;
typedef rivet_comp RivetComputation;
typedef struct {
RivetComputation* computation;
char* error;
size_t error_length;
} RivetComputationResult;
RivetComputationResult read_rivet_computation(const char* bytes, size_t length);
//Computed* compute_arrangement_from_point_cloud(PointCloud);
BarCodesResult barcodes_from_computation(RivetComputation* rivet_computation,
double* offsets,
double* angles,
size_t query_length);
ArrangementBounds bounds_from_computation(RivetComputation* rivet_computation);
void free_rivet_computation_result(RivetComputationResult rivet_computation);
void free_barcodes_result(BarCodesResult result);
typedef struct {
int64_t nom;
int64_t denom;
} Ratio;
typedef struct {
Ratio *x_grades;
size_t x_length;
Ratio *y_grades;
size_t y_length;
} ExactGrades;
typedef struct {
unsigned x;
unsigned y;
unsigned betti_0;
unsigned betti_1;
unsigned betti_2;
} StructurePoint;
typedef struct {
ExactGrades *grades;
StructurePoint *points;
size_t length;
} StructurePoints;
StructurePoints * structure_from_computation(RivetComputation* rivet_computation);
void free_structure_points(StructurePoints *points);
}
#endif //RIVET_CONSOLE_C_API_H