summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/utilities
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-02-01 18:19:00 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-02-01 18:19:00 +0000
commit24386d494ba4b8bb19b4559f6d2b3e4ecc980571 (patch)
treef4c1034bd75d6f8a237a4ff7c5f30df6d6732803 /src/Alpha_complex/utilities
parentd3ff96460cbcd7de4d1f2d03c61e4227dd4c4767 (diff)
parente15408b4af5cba8966aa8773f6ee6884942c1d95 (diff)
Merge from trunk.
hand-merge README that moved to *.md. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/sparserips-glisse@3201 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: f1922a265c79937e507bbb963875d21fae88069e
Diffstat (limited to 'src/Alpha_complex/utilities')
-rw-r--r--src/Alpha_complex/utilities/alpha_complex_3d_helper.h2
-rw-r--r--src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp13
-rw-r--r--src/Alpha_complex/utilities/alphacomplex.md (renamed from src/Alpha_complex/utilities/README)173
-rw-r--r--src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp10
-rw-r--r--src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp13
-rw-r--r--src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp18
-rw-r--r--src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp22
7 files changed, 114 insertions, 137 deletions
diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_helper.h b/src/Alpha_complex/utilities/alpha_complex_3d_helper.h
index 3747923f..a59f0654 100644
--- a/src/Alpha_complex/utilities/alpha_complex_3d_helper.h
+++ b/src/Alpha_complex/utilities/alpha_complex_3d_helper.h
@@ -52,7 +52,7 @@ Vertex_list from_facet(const Facet& fct) {
template <class Vertex_list, class Edge_3>
Vertex_list from_edge(const Edge_3& edg) {
Vertex_list the_list;
- for (auto i : { edg.second, edg.third }) {
+ for (auto i : {edg.second, edg.third}) {
#ifdef DEBUG_TRACES
std::cout << "from edge[" << i << "]=" << edg.first->vertex(i)->point() << std::endl;
#endif // DEBUG_TRACES
diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp
index 1070d17b..8ef5ffb2 100644
--- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp
+++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp
@@ -138,16 +138,16 @@ int main(int argc, char **argv) {
std::vector<Alpha_value_type>::iterator the_alpha_value_iterator = the_alpha_values.begin();
for (auto object_iterator : the_objects) {
// Retrieve Alpha shape vertex list from object
- if (const Cell_handle* cell = CGAL::object_cast<Cell_handle>(&object_iterator)) {
+ if (const Cell_handle *cell = CGAL::object_cast<Cell_handle>(&object_iterator)) {
vertex_list = from_cell<Vertex_list, Cell_handle>(*cell);
count_cells++;
- } else if (const Facet* facet = CGAL::object_cast<Facet>(&object_iterator)) {
+ } else if (const Facet *facet = CGAL::object_cast<Facet>(&object_iterator)) {
vertex_list = from_facet<Vertex_list, Facet>(*facet);
count_facets++;
- } else if (const Edge_3* edge = CGAL::object_cast<Edge_3>(&object_iterator)) {
+ } else if (const Edge_3 *edge = CGAL::object_cast<Edge_3>(&object_iterator)) {
vertex_list = from_edge<Vertex_list, Edge_3>(*edge);
count_edges++;
- } else if (const Vertex_handle* vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) {
+ } else if (const Vertex_handle *vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) {
count_vertices++;
vertex_list = from_vertex<Vertex_list, Vertex_handle>(*vertex);
}
@@ -173,13 +173,12 @@ int main(int argc, char **argv) {
}
}
// Construction of the simplex_tree
- Filtration_value filtr = /*std::sqrt*/(*the_alpha_value_iterator);
+ Filtration_value filtr = /*std::sqrt*/ (*the_alpha_value_iterator);
#ifdef DEBUG_TRACES
std::cout << "filtration = " << filtr << std::endl;
#endif // DEBUG_TRACES
simplex_tree.insert_simplex(the_simplex, filtr);
- GUDHI_CHECK(the_alpha_value_iterator != the_alpha_values.end(),
- "CGAL provided more simplices than values");
+ GUDHI_CHECK(the_alpha_value_iterator != the_alpha_values.end(), "CGAL provided more simplices than values");
++the_alpha_value_iterator;
}
diff --git a/src/Alpha_complex/utilities/README b/src/Alpha_complex/utilities/alphacomplex.md
index 1cd2ca95..aace85d3 100644
--- a/src/Alpha_complex/utilities/README
+++ b/src/Alpha_complex/utilities/alphacomplex.md
@@ -1,14 +1,26 @@
-# Alpha_complex #
-## `alpha_complex_3d_persistence` ##
-This program computes the persistent homology with coefficient field Z/pZ of the 3D alpha complex built from a 3D point cloud. The output diagram contains one bar per line, written with the convention:
-`p dim birth death`
+# Alpha complex #
-where `dim` is the dimension of the homological feature, `birth` and `death` are respectively the birth and death of the feature, and `p` is the characteristic of the field *Z/pZ* used for homology coefficients (`p` must be a prime number).
+
+## alpha_complex_persistence ##
+
+This program computes the persistent homology with coefficient field Z/pZ of the dD alpha complex built from a dD point cloud.
+The output diagram contains one bar per line, written with the convention:
+
+```
+ p dim birth death
+```
+
+where `dim` is the dimension of the homological feature, `birth` and `death` are respectively the birth and death of the feature,
+and `p` is the characteristic of the field *Z/pZ* used for homology coefficients (`p` must be a prime number).
**Usage**
-`alpha_complex_3d_persistence [options] <input OFF file>`
+
+```
+ alpha_complex_persistence [options] <input OFF file>
+```
+
where
`<input OFF file>` is the path to the input point cloud in [nOFF ASCII format](http://www.geomview.org/docs/html/OFF.html).
@@ -16,47 +28,37 @@ where
* `-h [ --help ]` Produce help message
* `-o [ --output-file ]` Name of file in which the persistence diagram is written. Default print in standard output.
-* `-p [ --field-charac ]` (default=11) Characteristic p of the coefficient field Z/pZ for computing homology.
+* `-r [ --max-alpha-square-value ]` (default = inf) Maximal alpha square value for the Alpha complex construction.
+* `-p [ --field-charac ]` (default = 11) Characteristic p of the coefficient field Z/pZ for computing homology.
* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals.
**Example**
-`alpha_complex_3d_persistence ../../data/points/tore3D_300.off -p 2 -m 0.45`
-outputs:
```
-Simplex_tree dim: 3
-2 0 0 inf
-2 1 0.0682162 1.0001
-2 1 0.0934117 1.00003
-2 2 0.56444 1.03938
+ alpha_complex_persistence -r 32 -p 2 -m 0.45 ../../data/points/tore3D_300.off
```
-Here we retrieve expected Betti numbers on a tore 3D:
-```
-Betti numbers[0] = 1
-Betti numbers[1] = 2
-Betti numbers[2] = 1
-```
+N.B.:
-N.B.:
-* `alpha_complex_3d_persistence` only accepts OFF files in dimension 3.
* Filtration values are alpha square values.
+## alpha_complex_3d_persistence ##
+This program computes the persistent homology with coefficient field Z/pZ of the 3D alpha complex built from a 3D point cloud. The output diagram contains one bar per line, written with the convention:
-## `exact_alpha_complex_3d_persistence` ##
-Same as `alpha_complex_3d_persistence`, but using exact computation. It is slower, but it is necessary when points are on a grid for instance.
+```
+p dim birth death
+```
+where `dim` is the dimension of the homological feature, `birth` and `death` are respectively the birth and death of the feature, and `p` is the characteristic of the field *Z/pZ* used for homology coefficients (`p` must be a prime number).
+**Usage**
-## `weighted_alpha_complex_3d_persistence` ##
-Same as `alpha_complex_3d_persistence`, but using weighted points.
+```
+ alpha_complex_3d_persistence [options] <input OFF file>
+```
-**Usage**
-`weighted_alpha_complex_3d_persistence [options] <input OFF file> <weights input file>`
-where
-`<input OFF file>` is the path to the input point cloud in [nOFF ASCII format](http://www.geomview.org/docs/html/OFF.html).
-`<input weights file>` is the path to the file containing the weights of the points (one value per line).
+where `<input OFF file>` is the path to the input point cloud in [nOFF ASCII format](http://www.geomview.org/docs/html/OFF.html).
**Allowed options**
@@ -66,112 +68,91 @@ where
* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals.
**Example**
-`weighted_alpha_complex_3d_persistence ../../data/points/tore3D_300.off ../../data/points/tore3D_300.weights -p 2 -m 0.45`
-outputs:
```
-Simplex_tree dim: 3
-2 0 -1 inf
-2 1 -0.931784 0.000103311
-2 1 -0.906588 2.60165e-05
-2 2 -0.43556 0.0393798
+alpha_complex_3d_persistence ../../data/points/tore3D_300.off -p 2 -m 0.45
```
N.B.:
-* Weights values are explained on CGAL [Alpha shape](https://doc.cgal.org/latest/Alpha_shapes_3/index.html#title0)
-and [Regular triangulation](https://doc.cgal.org/latest/Triangulation_3/index.html#Triangulation3secclassRegulartriangulation) documentation.
+
+* `alpha_complex_3d_persistence` only accepts OFF files in dimension 3.
* Filtration values are alpha square values.
-## `periodic_alpha_complex_3d_persistence` ##
-Same as `alpha_complex_3d_persistence`, but using periodic alpha shape 3d.
-Refer to the [CGAL's 3D Periodic Triangulations User Manual](https://doc.cgal.org/latest/Periodic_3_triangulation_3/index.html) for more details.
+## exact_alpha_complex_3d_persistence ##
+
+Same as `alpha_complex_3d_persistence`, but using exact computation.
+It is slower, but it is necessary when points are on a grid for instance.
+
+
+
+## weighted_alpha_complex_3d_persistence ##
+
+Same as `alpha_complex_3d_persistence`, but using weighted points.
**Usage**
-`periodic_alpha_complex_3d_persistence [options] <input OFF file> <cuboid file>`
+
+```
+ weighted_alpha_complex_3d_persistence [options] <input OFF file> <weights input file>
+```
+
where
-`<input OFF file>` is the path to the input point cloud in [nOFF ASCII format](http://www.geomview.org/docs/html/OFF.html).
-`<cuboid file>` is the path to the file describing the periodic domain. It must be in the format described [here](http://gudhi.gforge.inria.fr/doc/latest/fileformats.html#FileFormatsIsoCuboid).
+
+* `<input OFF file>` is the path to the input point cloud in [nOFF ASCII format](http://www.geomview.org/docs/html/OFF.html).
+* `<input weights file>` is the path to the file containing the weights of the points (one value per line).
**Allowed options**
* `-h [ --help ]` Produce help message
* `-o [ --output-file ]` Name of file in which the persistence diagram is written. Default print in standard output.
* `-p [ --field-charac ]` (default=11) Characteristic p of the coefficient field Z/pZ for computing homology.
-* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals
-
+* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals.
**Example**
-`periodic_alpha_complex_3d_persistence ../../data/points/grid_10_10_10_in_0_1.off ../../data/points/iso_cuboid_3_in_0_1.txt -p 3 -m 1.0`
-
-outputs:
-```
-Periodic Delaunay computed.
-Simplex_tree dim: 3
-3 0 0 inf
-3 1 0.0025 inf
-3 1 0.0025 inf
-3 1 0.0025 inf
-3 2 0.005 inf
-3 2 0.005 inf
-3 2 0.005 inf
-3 3 0.0075 inf
-```
-Here we retrieve expected Betti numbers on an 3D iso-oriented cuboids:
```
-Betti numbers[0] = 1
-Betti numbers[1] = 3
-Betti numbers[2] = 3
-Betti numbers[3] = 1
+ weighted_alpha_complex_3d_persistence ../../data/points/tore3D_300.off ../../data/points/tore3D_300.weights -p 2 -m 0.45
```
-N.B.:
-* Cuboid file must be in the format described [here](http://gudhi.gforge.inria.fr/doc/latest/fileformats.html#FileFormatsIsoCuboid).
-* Filtration values are alpha square values.
+N.B.:
+* Weights values are explained on CGAL [Alpha shape](https://doc.cgal.org/latest/Alpha_shapes_3/index.html#title0)
+and [Regular triangulation](https://doc.cgal.org/latest/Triangulation_3/index.html#Triangulation3secclassRegulartriangulation) documentation.
+* Filtration values are alpha square values.
-## `alpha_complex_persistence` ##
-This program computes the persistent homology with coefficient field Z/pZ of the dD alpha complex built from a dD point cloud. The output diagram contains one bar per line, written with the convention:
+## periodic_alpha_complex_3d_persistence ##
+Same as `alpha_complex_3d_persistence`, but using periodic alpha shape 3d.
+Refer to the [CGAL's 3D Periodic Triangulations User Manual](https://doc.cgal.org/latest/Periodic_3_triangulation_3/index.html) for more details.
-`p dim birth death`
+**Usage**
-where `dim` is the dimension of the homological feature, `birth` and `death` are respectively the birth and death of the feature, and `p` is the characteristic of the field *Z/pZ* used for homology coefficients (`p` must be a prime number).
+```
+ periodic_alpha_complex_3d_persistence [options] <input OFF file> <cuboid file>
+```
-**Usage**
-`alpha_complex_persistence [options] <input OFF file>`
where
-`<input OFF file>` is the path to the input point cloud in [nOFF ASCII format](http://www.geomview.org/docs/html/OFF.html).
+
+* `<input OFF file>` is the path to the input point cloud in [nOFF ASCII format](http://www.geomview.org/docs/html/OFF.html).
+* `<cuboid file>` is the path to the file describing the periodic domain. It must be in the format described
+[here](/doc/latest/fileformats.html#FileFormatsIsoCuboid).
**Allowed options**
* `-h [ --help ]` Produce help message
* `-o [ --output-file ]` Name of file in which the persistence diagram is written. Default print in standard output.
-* `-r [ --max-alpha-square-value ]` (default = inf) Maximal alpha square value for the Alpha complex construction.
-* `-p [ --field-charac ]` (default = 11) Characteristic p of the coefficient field Z/pZ for computing homology.
-* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals.
+* `-p [ --field-charac ]` (default=11) Characteristic p of the coefficient field Z/pZ for computing homology.
+* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals
-**Example**
-`alpha_complex_persistence -r 32 -p 2 -m 0.45 ../../data/points/tore3D_300.off`
-outputs:
-```
-Alpha complex is of dimension 3 - 9273 simplices - 300 vertices.
-Simplex_tree dim: 3
-2 0 0 inf
-2 1 0.0682162 1.0001
-2 1 0.0934117 1.00003
-2 2 0.56444 1.03938
-```
+**Example**
-Here we retrieve expected Betti numbers on a tore 3D:
```
-Betti numbers[0] = 1
-Betti numbers[1] = 2
-Betti numbers[2] = 1
+periodic_alpha_complex_3d_persistence ../../data/points/grid_10_10_10_in_0_1.off ../../data/points/iso_cuboid_3_in_0_1.txt -p 3 -m 1.0
```
N.B.:
+
+* Cuboid file must be in the format described [here](/doc/latest/fileformats.html#FileFormatsIsoCuboid).
* Filtration values are alpha square values.
diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp
index 3b9a2ae0..cceac46e 100644
--- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp
+++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp
@@ -129,16 +129,16 @@ int main(int argc, char **argv) {
std::vector<Alpha_value_type>::iterator the_alpha_value_iterator = the_alpha_values.begin();
for (auto object_iterator : the_objects) {
// Retrieve Alpha shape vertex list from object
- if (const Cell_handle* cell = CGAL::object_cast<Cell_handle>(&object_iterator)) {
+ if (const Cell_handle *cell = CGAL::object_cast<Cell_handle>(&object_iterator)) {
vertex_list = from_cell<Vertex_list, Cell_handle>(*cell);
count_cells++;
- } else if (const Facet* facet = CGAL::object_cast<Facet>(&object_iterator)) {
+ } else if (const Facet *facet = CGAL::object_cast<Facet>(&object_iterator)) {
vertex_list = from_facet<Vertex_list, Facet>(*facet);
count_facets++;
- } else if (const Edge_3* edge = CGAL::object_cast<Edge_3>(&object_iterator)) {
+ } else if (const Edge_3 *edge = CGAL::object_cast<Edge_3>(&object_iterator)) {
vertex_list = from_edge<Vertex_list, Edge_3>(*edge);
count_edges++;
- } else if (const Vertex_handle* vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) {
+ } else if (const Vertex_handle *vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) {
count_vertices++;
vertex_list = from_vertex<Vertex_list, Vertex_handle>(*vertex);
}
@@ -165,7 +165,7 @@ int main(int argc, char **argv) {
}
// Construction of the simplex_tree
// you can also use the_alpha_value_iterator->exact()
- Filtration_value filtr = /*std::sqrt*/CGAL::to_double(the_alpha_value_iterator->exact());
+ Filtration_value filtr = /*std::sqrt*/ CGAL::to_double(the_alpha_value_iterator->exact());
#ifdef DEBUG_TRACES
std::cout << "filtration = " << filtr << std::endl;
#endif // DEBUG_TRACES
diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp
index ac72dcc4..188cf604 100644
--- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp
+++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp
@@ -113,9 +113,8 @@ int main(int argc, char **argv) {
std::cerr << "Unable to read file " << cuboid_file << std::endl;
exit(-1);
}
- //Checking if the cuboid is the same in x,y and z direction. If not, CGAL will not process it.
- if ((x_max-x_min != y_max-y_min) || (x_max-x_min != z_max-z_min) || (z_max-z_min != y_max-y_min))
- {
+ // Checking if the cuboid is the same in x,y and z direction. If not, CGAL will not process it.
+ if ((x_max - x_min != y_max - y_min) || (x_max - x_min != z_max - z_min) || (z_max - z_min != y_max - y_min)) {
std::cerr << "The size of the cuboid in every directions is not the same." << std::endl;
exit(-1);
}
@@ -164,16 +163,16 @@ int main(int argc, char **argv) {
std::vector<Alpha_value_type>::iterator the_alpha_value_iterator = the_alpha_values.begin();
for (auto object_iterator : the_objects) {
// Retrieve Alpha shape vertex list from object
- if (const Cell_handle* cell = CGAL::object_cast<Cell_handle>(&object_iterator)) {
+ if (const Cell_handle *cell = CGAL::object_cast<Cell_handle>(&object_iterator)) {
vertex_list = from_cell<Vertex_list, Cell_handle>(*cell);
count_cells++;
- } else if (const Facet* facet = CGAL::object_cast<Facet>(&object_iterator)) {
+ } else if (const Facet *facet = CGAL::object_cast<Facet>(&object_iterator)) {
vertex_list = from_facet<Vertex_list, Facet>(*facet);
count_facets++;
- } else if (const Edge_3* edge = CGAL::object_cast<Edge_3>(&object_iterator)) {
+ } else if (const Edge_3 *edge = CGAL::object_cast<Edge_3>(&object_iterator)) {
vertex_list = from_edge<Vertex_list, Edge_3>(*edge);
count_edges++;
- } else if (const Vertex_handle* vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) {
+ } else if (const Vertex_handle *vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) {
count_vertices++;
vertex_list = from_vertex<Vertex_list, Vertex_handle>(*vertex);
}
diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp
index f46f1a58..93be8a05 100644
--- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp
+++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp
@@ -65,13 +65,13 @@ using Point_3 = Gt::Bare_point;
using Weighted_point_3 = Gt::Weighted_point;
// For CGAL >= 4.11
-#else // CGAL_VERSION_NR < 1041100000
+#else // CGAL_VERSION_NR < 1041100000
using Rvb = CGAL::Regular_triangulation_vertex_base_3<Kernel>;
-using Vb = CGAL::Alpha_shape_vertex_base_3<Kernel,Rvb>;
+using Vb = CGAL::Alpha_shape_vertex_base_3<Kernel, Rvb>;
using Rcb = CGAL::Regular_triangulation_cell_base_3<Kernel>;
-using Cb = CGAL::Alpha_shape_cell_base_3<Kernel,Rcb>;
-using Tds = CGAL::Triangulation_data_structure_3<Vb,Cb>;
-using Triangulation_3 = CGAL::Regular_triangulation_3<Kernel,Tds>;
+using Cb = CGAL::Alpha_shape_cell_base_3<Kernel, Rcb>;
+using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb>;
+using Triangulation_3 = CGAL::Regular_triangulation_3<Kernel, Tds>;
// From file type definition
using Point_3 = Triangulation_3::Bare_point;
@@ -177,16 +177,16 @@ int main(int argc, char **argv) {
std::vector<Alpha_value_type>::iterator the_alpha_value_iterator = the_alpha_values.begin();
for (auto object_iterator : the_objects) {
// Retrieve Alpha shape vertex list from object
- if (const Cell_handle* cell = CGAL::object_cast<Cell_handle>(&object_iterator)) {
+ if (const Cell_handle *cell = CGAL::object_cast<Cell_handle>(&object_iterator)) {
vertex_list = from_cell<Vertex_list, Cell_handle>(*cell);
count_cells++;
- } else if (const Facet* facet = CGAL::object_cast<Facet>(&object_iterator)) {
+ } else if (const Facet *facet = CGAL::object_cast<Facet>(&object_iterator)) {
vertex_list = from_facet<Vertex_list, Facet>(*facet);
count_facets++;
- } else if (const Edge_3* edge = CGAL::object_cast<Edge_3>(&object_iterator)) {
+ } else if (const Edge_3 *edge = CGAL::object_cast<Edge_3>(&object_iterator)) {
vertex_list = from_edge<Vertex_list, Edge_3>(*edge);
count_edges++;
- } else if (const Vertex_handle* vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) {
+ } else if (const Vertex_handle *vertex = CGAL::object_cast<Vertex_handle>(&object_iterator)) {
count_vertices++;
vertex_list = from_vertex<Vertex_list, Vertex_handle>(*vertex);
}
diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp
index 0fe8931f..5321bb0a 100644
--- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp
+++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp
@@ -50,14 +50,14 @@ using PK = CGAL::Periodic_3_regular_triangulation_traits_3<Kernel>;
// Vertex type
using DsVb = CGAL::Periodic_3_triangulation_ds_vertex_base_3<>;
-using Vb = CGAL::Regular_triangulation_vertex_base_3<PK,DsVb>;
-using AsVb = CGAL::Alpha_shape_vertex_base_3<PK,Vb>;
+using Vb = CGAL::Regular_triangulation_vertex_base_3<PK, DsVb>;
+using AsVb = CGAL::Alpha_shape_vertex_base_3<PK, Vb>;
// Cell type
using DsCb = CGAL::Periodic_3_triangulation_ds_cell_base_3<>;
-using Cb = CGAL::Regular_triangulation_cell_base_3<PK,DsCb>;
-using AsCb = CGAL::Alpha_shape_cell_base_3<PK,Cb>;
-using Tds = CGAL::Triangulation_data_structure_3<AsVb,AsCb>;
-using P3RT3 = CGAL::Periodic_3_regular_triangulation_3<PK,Tds>;
+using Cb = CGAL::Regular_triangulation_cell_base_3<PK, DsCb>;
+using AsCb = CGAL::Alpha_shape_cell_base_3<PK, Cb>;
+using Tds = CGAL::Triangulation_data_structure_3<AsVb, AsCb>;
+using P3RT3 = CGAL::Periodic_3_regular_triangulation_3<PK, Tds>;
using Alpha_shape_3 = CGAL::Alpha_shape_3<P3RT3>;
using Point_3 = P3RT3::Bare_point;
@@ -127,14 +127,13 @@ int main(int argc, char* const argv[]) {
std::cerr << "Unable to read file " << argv[3] << std::endl;
usage(argv[0]);
}
- //Checking if the cuboid is the same in x,y and z direction. If not, CGAL will not process it.
- if ((x_max-x_min != y_max-y_min) || (x_max-x_min != z_max-z_min) || (z_max-z_min != y_max-y_min))
- {
+ // Checking if the cuboid is the same in x,y and z direction. If not, CGAL will not process it.
+ if ((x_max - x_min != y_max - y_min) || (x_max - x_min != z_max - z_min) || (z_max - z_min != y_max - y_min)) {
std::cerr << "The size of the cuboid in every directions is not the same." << std::endl;
exit(-1);
}
- double maximal_possible_weight = 0.015625 * (x_max-x_min) * (x_max-x_min);
+ double maximal_possible_weight = 0.015625 * (x_max - x_min) * (x_max - x_min);
// Read weights information from file
std::ifstream weights_ifstr(argv[2]);
@@ -145,8 +144,7 @@ int main(int argc, char* const argv[]) {
wp.reserve(lp.size());
// Attempt read the weight in a double format, return false if it fails
while ((weights_ifstr >> weight) && (index < lp.size())) {
- if ((weight >= maximal_possible_weight) || (weight < 0))
- {
+ if ((weight >= maximal_possible_weight) || (weight < 0)) {
std::cerr << "At line " << (index + 1) << ", the weight (" << weight
<< ") is negative or more than or equal to maximal possible weight (" << maximal_possible_weight
<< ") = 1/64*cuboid length squared, which is not an acceptable input." << std::endl;