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
|
#include <gudhi/Alpha_complex_3d.h>
#include <iostream>
#include <string>
#include <vector>
#include <limits> // for numeric limits
void usage(int nbArgs, char * const progName) {
std::cerr << "Error: Number of arguments (" << nbArgs << ") is not correct\n";
std::cerr << "Usage: " << progName << " [alpha_square_max_value]\n";
std::cerr << " i.e.: " << progName << " 60.0\n";
exit(-1); // ----- >>
}
int main(int argc, char **argv) {
//if ((argc != 1) && (argc != 2)) usage(argc, (argv[0] - 1));
using Alpha_shapes_3d = Gudhi::alpha_complex::Alpha_shapes_3d;
std::vector<Alpha_shapes_3d::Point_3> points;
points.push_back(Alpha_shapes_3d::Point_3(1., 2., 3.));
points.push_back(Alpha_shapes_3d::Point_3(6., 5., 4.));
Gudhi::alpha_complex::Alpha_complex_3d<Alpha_shapes_3d> alpha_complex(points);
using Weighted_alpha_shapes_3d = Gudhi::alpha_complex::Weighted_alpha_shapes_3d;
std::vector<Weighted_alpha_shapes_3d::Point_3> w_points;
w_points.push_back(Weighted_alpha_shapes_3d::Point_3(1., 2., 3.));
w_points.push_back(Weighted_alpha_shapes_3d::Point_3(6., 5., 4.));
std::vector<double> weights = {0.01, 0.005};
Gudhi::alpha_complex::Alpha_complex_3d<Weighted_alpha_shapes_3d> weighted_alpha_complex(points, weights);
using Periodic_alpha_shapes_3d = Gudhi::alpha_complex::Periodic_alpha_shapes_3d;
std::vector<Periodic_alpha_shapes_3d::Point_3> p_points;
p_points.push_back(Periodic_alpha_shapes_3d::Point_3(1., 2., 3.));
p_points.push_back(Periodic_alpha_shapes_3d::Point_3(6., 5., 4.));
Gudhi::alpha_complex::Alpha_complex_3d<Periodic_alpha_shapes_3d> periodic_alpha_complex(points,
0., 0., 0.,
1., 1., 1.);
using Weighted_periodic_alpha_shapes_3d = Gudhi::alpha_complex::Weighted_periodic_alpha_shapes_3d;
std::vector<Weighted_periodic_alpha_shapes_3d::Point_3> wp_points;
wp_points.push_back(Weighted_periodic_alpha_shapes_3d::Point_3(0.1, 0.2, 0.3));
wp_points.push_back(Weighted_periodic_alpha_shapes_3d::Point_3(0.6, 0.5, 0.4));
Gudhi::alpha_complex::Alpha_complex_3d<Weighted_periodic_alpha_shapes_3d>
weighted_periodic_alpha_complex(points, weights,
0., 0., 0.,
1., 1., 1.);
return 0;
}
|