From bef66102e0ab999724dbb6c1ad9733ee2a5d6813 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 15 Sep 2016 14:00:35 +0000 Subject: Fix cpplint and warnings git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/warning_fix@1502 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: afc7d137b66225954ebfe37a823f1f0b6bcfe7a5 --- src/Skeleton_blocker/concept/SkeletonBlockerDS.h | 213 +++++++++++---------- .../concept/SkeletonBlockerGeometricDS.h | 113 ++++++----- 2 files changed, 170 insertions(+), 156 deletions(-) (limited to 'src/Skeleton_blocker/concept') diff --git a/src/Skeleton_blocker/concept/SkeletonBlockerDS.h b/src/Skeleton_blocker/concept/SkeletonBlockerDS.h index 3c650f99..d82425a0 100644 --- a/src/Skeleton_blocker/concept/SkeletonBlockerDS.h +++ b/src/Skeleton_blocker/concept/SkeletonBlockerDS.h @@ -1,128 +1,129 @@ -/* - * SkeletonBlockerDS.h +/* This file is part of the Gudhi Library. The Gudhi library + * (Geometric Understanding in Higher Dimensions) is a generic C++ + * library for computational topology. * - * Created on: Feb 20, 2014 - * Author: David Salinas - * Copyright 2013 INRIA. All rights reserved + * Author(s): David Salinas + * + * Copyright (C) 2014 INRIA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -#ifndef GUDHI_SKELETONBLOCKERDS_H_ -#define GUDHI_SKELETONBLOCKERDS_H_ - +#ifndef CONCEPT_SKELETON_BLOCKER_SKELETONBLOCKERDS_H_ +#define CONCEPT_SKELETON_BLOCKER_SKELETONBLOCKERDS_H_ namespace Gudhi { namespace skeleton_blocker { - - /** \brief Concept for the template class passed for Skeleton_blocker_complex. * Most importantly, it contains the nodes for vertices and edges * (Graph_vertex and Graph_edge) that are stored in the simplicial * complex. The user can redefine these classes to attach * additional information to vertices and edges. */ -struct SkeletonBlockerDS -{ - /** - * @brief index that allows to find the vertex in the boost graph - */ - typedef int boost_vertex_handle; - - - /** - * @brief Root_vertex_handle and Vertex_handle are similar to global and local vertex descriptor - * used in boost subgraphs - * and allow to localize a vertex of a subcomplex on its parent root complex. - * - * In gross, vertices are stored in a vector - * and the Root_vertex_handle and Vertex_handle store indices of a vertex in this vector. - * - * For the root simplicial complex, the Root_vertex_handle and Vertex_handle of a vertex - * are the same. - * - * - * For a subcomplex L of a simplicial complex K, the local descriptor, ie the Vertex_handle, of a - * vertex v (that belongs to L) is its position in the vector of vertices - * of the subcomplex L whereas its Root_vertex_handle (global descriptor) is the position of v in the vector of the - * vertices of the root simplicial complex K. - */ - struct Root_vertex_handle{ - - boost_vertex_handle vertex; - - friend ostream& operator << (ostream& o, const Root_vertex_handle & v); - }; - - /** - * A Vertex_handle must be Default Constructible, Assignable and Equality Comparable. - */ - struct Vertex_handle{ - boost_vertex_handle vertex; - - friend ostream& operator << (ostream& o, const Vertex_handle & v); - }; - - - /** - * \brief The type of vertices that are stored the boost graph. - * A Vertex must be Default Constructible and Equality Comparable. - * - */ - struct Graph_vertex{ - /** \brief Used to deactivate a vertex for example when contracting an edge. - * It allows in some cases to remove the vertex at low cost. - */ - void deactivate(); - - /** \brief Used to activate a vertex. - */ - void activate(); - - /** \brief Tells if the vertex is active. - */ - bool is_active() const; - - void set_id(Root_vertex_handle i); - Root_vertex_handle get_id() const; - virtual string to_string() const ; - friend ostream& operator << (ostream& o, const Graph_vertex & v); - }; - - - /** - * \brief The type of edges that are stored the boost graph. - * An Edge must be Default Constructible and Equality Comparable. - */ - struct Graph_edge{ - /** - * @brief Allows to modify vertices of the edge. - */ - void setId(Root_vertex_handle a,Root_vertex_handle b); - - /** - * @brief Returns the first vertex of the edge. - */ - Root_vertex_handle first() const ; - - /** - * @brief Returns the second vertex of the edge. - */ - Root_vertex_handle second() const ; - - friend ostream& operator << (ostream& o, const Simple_edge & v); - }; - - +struct SkeletonBlockerDS { + /** + * @brief index that allows to find the vertex in the boost graph + */ + typedef int boost_vertex_handle; + + /** + * @brief Root_vertex_handle and Vertex_handle are similar to global and local vertex descriptor + * used in boost subgraphs + * and allow to localize a vertex of a subcomplex on its parent root complex. + * + * In gross, vertices are stored in a vector + * and the Root_vertex_handle and Vertex_handle store indices of a vertex in this vector. + * + * For the root simplicial complex, the Root_vertex_handle and Vertex_handle of a vertex + * are the same. + * + * + * For a subcomplex L of a simplicial complex K, the local descriptor, ie the Vertex_handle, of a + * vertex v (that belongs to L) is its position in the vector of vertices + * of the subcomplex L whereas its Root_vertex_handle (global descriptor) is the position of v in the vector of the + * vertices of the root simplicial complex K. + */ + struct Root_vertex_handle { + boost_vertex_handle vertex; + + friend ostream& operator<<(ostream& o, const Root_vertex_handle & v); + }; + + /** + * A Vertex_handle must be Default Constructible, Assignable and Equality Comparable. + */ + struct Vertex_handle { + boost_vertex_handle vertex; + + friend ostream& operator<<(ostream& o, const Vertex_handle & v); + }; + + /** + * \brief The type of vertices that are stored the boost graph. + * A Vertex must be Default Constructible and Equality Comparable. + * + */ + struct Graph_vertex { + /** \brief Used to deactivate a vertex for example when contracting an edge. + * It allows in some cases to remove the vertex at low cost. + */ + void deactivate(); + + /** \brief Used to activate a vertex. + */ + void activate(); + + /** \brief Tells if the vertex is active. + */ + bool is_active() const; + + void set_id(Root_vertex_handle i); + Root_vertex_handle get_id() const; + virtual string to_string() const; + friend ostream& operator<<(ostream& o, const Graph_vertex & v); + }; + + /** + * \brief The type of edges that are stored the boost graph. + * An Edge must be Default Constructible and Equality Comparable. + */ + struct Graph_edge { + /** + * @brief Allows to modify vertices of the edge. + */ + void setId(Root_vertex_handle a, Root_vertex_handle b); + + /** + * @brief Returns the first vertex of the edge. + */ + Root_vertex_handle first() const; + + /** + * @brief Returns the second vertex of the edge. + */ + Root_vertex_handle second() const; + + friend ostream& operator<<(ostream& o, const Simple_edge & v); + }; }; - - } // namespace skeleton_blocker namespace skbl = skeleton_blocker; } // namespace Gudhi - -#endif /* GUDHI_SKELETONBLOCKERDS_H_ */ +#endif // CONCEPT_SKELETON_BLOCKER_SKELETONBLOCKERDS_H_ diff --git a/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h b/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h index c5d52800..6017df1a 100644 --- a/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h +++ b/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h @@ -1,13 +1,27 @@ -/* - * SkeletonBlockerGeometricDS.h +/* This file is part of the Gudhi Library. The Gudhi library + * (Geometric Understanding in Higher Dimensions) is a generic C++ + * library for computational topology. * - * Created on: Feb 20, 2014 - * Author: David Salinas - * Copyright 2013 INRIA. All rights reserved + * Author(s): David Salinas + * + * Copyright (C) 2014 INRIA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -#ifndef GUDHI_SKELETONBLOCKERGEOMETRICDS_H_ -#define GUDHI_SKELETONBLOCKERGEOMETRICDS_H_ +#ifndef CONCEPT_SKELETON_BLOCKER_SKELETONBLOCKERGEOMETRICDS_H_ +#define CONCEPT_SKELETON_BLOCKER_SKELETONBLOCKERGEOMETRICDS_H_ namespace Gudhi { namespace skeleton_blocker { @@ -20,52 +34,51 @@ namespace skeleton_blocker { * Graph_edge must specify how to access to an index. * */ - //todo the index is just for contraction, to remove -template -struct SkeletonBlockerGeometricDS : public SkeletonBlockerDS -{ +//todo the index is just for contraction, to remove - /** - * Geometry information. - */ - typedef GeometryTrait GT ; +template +struct SkeletonBlockerGeometricDS : public SkeletonBlockerDS { + /** + * Geometry information. + */ + typedef GeometryTrait GT; - /** - * Type of point (should be the same as GT::Point). - */ - typedef typename GeometryTrait::Point Point; + /** + * Type of point (should be the same as GT::Point). + */ + typedef typename GeometryTrait::Point Point; - /** - * @brief Vertex that stores a point. - */ - class Graph_vertex : public SkeletonBlockerDS::Graph_vertex{ - public: - /** - * @brief Access to the point. - */ - Point& point(); - /** - * @brief Access to the point. - */ - const Point& point(); - }; + /** + * @brief Vertex that stores a point. + */ + class Graph_vertex : public SkeletonBlockerDS::Graph_vertex { + public: + /** + * @brief Access to the point. + */ + Point& point(); + /** + * @brief Access to the point. + */ + const Point& point(); + }; - /** - * @brief Edge that allows to access to an index. - * The indices of the edges are used to store heap information - * in the edge contraction algorithm. - */ - class Graph_Edge : public SkeletonBlockerDS::Graph_edge{ - public: - /** - * @brief Access to the index. - */ - int& index(); - /** - * @brief Access to the index. - */ - int index(); - }; + /** + * @brief Edge that allows to access to an index. + * The indices of the edges are used to store heap information + * in the edge contraction algorithm. + */ + class Graph_Edge : public SkeletonBlockerDS::Graph_edge { + public: + /** + * @brief Access to the index. + */ + int& index(); + /** + * @brief Access to the index. + */ + int index(); + }; }; } // namespace skeleton_blocker @@ -74,4 +87,4 @@ namespace skbl = skeleton_blocker; } // namespace Gudhi -#endif /* GUDHI_SKELETONBLOCKERGEOMETRICDS_H_ */ +#endif // CONCEPT_SKELETON_BLOCKER_SKELETONBLOCKERGEOMETRICDS_H_ -- cgit v1.2.3 From 1b5c8012bf843edcf4ae927fb0b46a2a42dfd3d6 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 15 Sep 2016 15:19:44 +0000 Subject: fix cpplint git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/warning_fix@1504 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b0036e77dafec3301dd9f130265e1513a82cddf4 --- src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h | 2 +- .../Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Skeleton_blocker/concept') diff --git a/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h b/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h index 6017df1a..477464c4 100644 --- a/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h +++ b/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h @@ -34,7 +34,7 @@ namespace skeleton_blocker { * Graph_edge must specify how to access to an index. * */ -//todo the index is just for contraction, to remove +// TODO(DS): the index is just for contraction, to remove template struct SkeletonBlockerGeometricDS : public SkeletonBlockerDS { diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h index 20d5600c..2acdb555 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h @@ -337,7 +337,7 @@ public boost::iterator_facade < Simplex_coboundary_iteratorvertex_range(); current_vertex = link_vertex_range.begin(); -- cgit v1.2.3