summaryrefslogtreecommitdiff
path: root/src/Skeleton_blocker/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/Skeleton_blocker/include')
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h13
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h6
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h5
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h7
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h2
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h44
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h1
7 files changed, 63 insertions, 15 deletions
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
index d05bdc19..eff37a18 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
@@ -41,7 +41,7 @@
\section Introduction
The Skeleton-Blocker data-structure had been introduced in the two papers
-\cite socg_blockers_2011,\cite blockers2012\cite blockers2012.
+\cite socg_blockers_2011,\cite blockers2012.
It proposes a light encoding for simplicial complexes by storing only an *implicit* representation of its
simplices.
Intuitively, it just stores the 1-skeleton of a simplicial complex with a graph and the set of its "missing faces" that
@@ -53,7 +53,8 @@ This data-structure handles all simplicial complexes operations such as
\section Definitions
-We recall briefly classical definitions of simplicial complexes \cite Munkres-elementsalgtop1984.
+We recall briefly classical definitions of simplicial complexes
+ \cite Munkres-elementsalgtop1984.
An abstract simplex is a finite non-empty set and its dimension is its number of elements minus 1.
Whenever \f$\tau \subset \sigma\f$ and \f$\tau \neq \emptyset \f$, \f$ \tau \f$ is called a face of
\f$ \sigma\f$ and \f$ \sigma\f$ is called a coface of \f$ \tau \f$ . Furthermore,
@@ -91,22 +92,24 @@ in figure X.
\subsection Overview
-Four classes define a simplicial complex namely :
+Four classes are implemented for simplicial complex in this representation namely :
\li Skeleton_blocker_complex : a simplicial complex with basic operations such as vertex/edge/simplex enumeration and construction
\li Skeleton_blocker_link_complex : the link of a simplex in a parent complex. It is represented as a sub complex
of the parent complex
\li Skeleton_blocker_simplifiable_complex : a simplicial complex with simplification operations such as edge contraction or simplex collapse
-\li Skeleton_blocker_geometric_complex : a simplicial complex who has access to geometric points in \f$R^d\f$
+\li Skeleton_blocker_geometric_complex : a simplifiable simplicial complex who has access to geometric points in \f$R^d\f$
The two last classes are derived classes from the <Code>Skeleton_blocker_complex</Code> class. The class <Code>Skeleton_blocker_link_complex</Code> inheritates from a template passed parameter
that may be either <Code>Skeleton_blocker_complex</Code> or <Code>Skeleton_blocker_geometric_complex</Code> (a link may store points coordinates or not).
+Most user will just need to use Skeleton_blocker_geometric_complex.
\subsection Visitor
The class <Code>Skeleton_blocker_complex</Code> has a visitor that is called when usual operations such as adding an edge or remove a vertex are called.
You may want to use this visitor to compute statistics or to update another data-structure (for instance this visitor is heavily used in the
-<Code>Contraction</Code> package).
+<Code>Contraction</Code> package).
+
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
index a02dfe29..fd44fba5 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
@@ -28,6 +28,9 @@ namespace Gudhi {
namespace skbl {
+/**
+ *@brief Off reader visitor that can be passed to Off_reader to read a Skeleton_blocker_complex.
+ */
template<typename Complex>
class Skeleton_blocker_off_visitor_reader{
Complex& complex_;
@@ -65,6 +68,9 @@ public:
}
};
+/**
+*@brief Class that allows to load a Skeleton_blocker_complex from an off file.
+*/
template<typename Complex>
class Skeleton_blocker_off_reader{
public:
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
index bb48cd8e..a24bea25 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
@@ -30,8 +30,12 @@ namespace Gudhi{
namespace skbl{
+
/**
* @extends SkeletonBlockerGeometricDS
+ * @ingroup skbl
+ * @brief Simple traits that is a model of SkeletonBlockerGeometricDS and
+ * can be passed as a template argument to Skeleton_blocker_geometric_complex
*/
template<typename GeometryTrait>
struct Skeleton_blocker_simple_geometric_traits : public skbl::Skeleton_blocker_simple_traits {
@@ -49,6 +53,7 @@ public:
template<class ComplexGeometricTraits> friend class Skeleton_blocker_geometric_complex;
private:
Point point_;
+
Point& point(){ return point_; }
const Point& point() const { return point_; }
};
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
index 9d945d46..e17ea9b5 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
@@ -32,11 +32,14 @@ namespace skbl {
/**
* @extends SkeletonBlockerDS
+ * @ingroup skbl
+ * @brief Simple traits that is a model of SkeletonBlockerDS and
+ * can be passed as a template argument to Skeleton_blocker_complex
*/
struct Skeleton_blocker_simple_traits{
/**
- * @brief global and local handle similar to <a href="http://www.boost.org/doc/libs/1_38_0/libs/graph/doc/subgraph.html">boost subgraphs</a>.
- * In gross, vertices are stored in a vector.
+ * @brief Global and local handle similar to <a href="http://www.boost.org/doc/libs/1_38_0/libs/graph/doc/subgraph.html">boost subgraphs</a>.
+ * Vertices are stored in a vector.
* For the root simplicial complex, the local and global descriptors are the same.
* For a subcomplex L and one of its vertices 'v', the local descriptor of 'v' is its position in
* the vertex vector of the subcomplex L whereas its global descriptor is the position of 'v'
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
index 97cadfc9..9b4253d1 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
@@ -33,7 +33,7 @@ namespace skbl {
/**
* @brief Simplicial subcomplex of a complex represented by a skeleton/blockers pair.
- *
+ * @extends Skeleton_blocker_complex
* @details Stores a subcomplex of a simplicial complex.
* To simplify explanations below, we will suppose that :
* - K is the root simplicial complex
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
index c0a0a2eb..81ff0231 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
@@ -74,19 +74,35 @@ class Skeleton_blocker_complex
public:
-
+ /**
+ * @brief The type of stored vertex node, specified by the template SkeletonBlockerDS
+ */
typedef typename SkeletonBlockerDS::Graph_vertex Graph_vertex;
+
+ /**
+ * @brief The type of stored edge node, specified by the template SkeletonBlockerDS
+ */
typedef typename SkeletonBlockerDS::Graph_edge Graph_edge;
typedef typename SkeletonBlockerDS::Root_vertex_handle Root_vertex_handle;
+
+ /**
+ * @brief The type of an handle to a vertex of the complex.
+ */
typedef typename SkeletonBlockerDS::Vertex_handle Vertex_handle;
typedef typename Root_vertex_handle::boost_vertex_handle boost_vertex_handle;
+ /**
+ * @brief A ordered set of integers that represents a simplex.
+ */
typedef Skeleton_blocker_simplex<Vertex_handle> Simplex_handle;
typedef Skeleton_blocker_simplex<Root_vertex_handle> Root_simplex_handle;
+ /**
+ * @brief Handle to a blocker of the complex.
+ */
typedef Simplex_handle* Blocker_handle;
@@ -118,12 +134,12 @@ protected:
public:
/**
- * Handle to an edge of the complex.
+ * @brief Handle to an edge of the complex.
*/
typedef typename boost::graph_traits<Graph>::edge_descriptor Edge_handle;
-
+protected:
typedef std::multimap<Vertex_handle,Simplex_handle *> BlockerMap;
typedef typename std::multimap<Vertex_handle,Simplex_handle *>::value_type BlockerPair;
typedef typename std::multimap<Vertex_handle,Simplex_handle *>::iterator BlockerMapIterator;
@@ -166,6 +182,9 @@ public:
/** @name Constructors, Destructors
*/
//@{
+ /**
+ *@brief constructs a simplicial complex with a given number of vertices and a visitor.
+ */
Skeleton_blocker_complex(int num_vertices_ = 0,Visitor* visitor_=NULL):visitor(visitor_){
clear();
for (int i=0; i<num_vertices_; ++i){
@@ -277,10 +296,9 @@ private:
public:
/**
- * @brief Constructor with a list of simplices
+ * @brief Constructor with a list of simplices.
* @details The list of simplices must be the list
- * of simplices of a simplicial complex.
- *
+ * of simplices of a simplicial complex.
*/
Skeleton_blocker_complex(std::list<Simplex_handle>& simplices,Visitor* visitor_=NULL):
num_vertices_(0),num_blockers_(0),
@@ -330,6 +348,8 @@ public:
}
}
+/**
+*/
Skeleton_blocker_complex& operator=(const Skeleton_blocker_complex& copy){
clear();
visitor = NULL;
@@ -370,6 +390,9 @@ public:
skeleton.clear();
}
+/**
+*@brief allows to change the visitor.
+*/
void set_visitor(Visitor* other_visitor){
visitor = other_visitor;
}
@@ -445,11 +468,15 @@ public:
if (visitor) visitor->on_remove_vertex(address);
}
+/**
+*/
bool contains_vertex(Vertex_handle u) const{
if (u.vertex<0 || u.vertex>=boost::num_vertices(skeleton)) return false;
return (*this)[u].is_active();
}
+/**
+*/
bool contains_vertex(Root_vertex_handle u) const{
boost::optional<Vertex_handle> address = get_address(u);
return address && (*this)[*address].is_active();
@@ -923,8 +950,9 @@ public:
* @brief Compute the local vertices of 's' in the current complex
* If one of them is not present in the complex then the return value is uninitialized.
*
- * xxx rename get_address et place un using dans sub_complex
+ *
*/
+ //xxx rename get_address et place un using dans sub_complex
boost::optional<Simplex_handle> get_simplex_address(const Root_simplex_handle& s) const
{
boost::optional<Simplex_handle> res;
@@ -1126,6 +1154,7 @@ private:
public:
typedef Triangle_around_vertex_iterator<Skeleton_blocker_complex,Superior_link> Superior_triangle_around_vertex_iterator;
+
typedef boost::iterator_range < Triangle_around_vertex_iterator<Skeleton_blocker_complex,Link> > Complex_triangle_around_vertex_range;
/**
@@ -1320,6 +1349,7 @@ public:
*/
//@{
public:
+
std::string to_string() const{
std::ostringstream stream;
stream<<num_vertices()<<" vertices:\n"<<vertices_to_string()<<std::endl;
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h
index 968e8be4..1a51e709 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h
@@ -32,6 +32,7 @@ namespace skbl {
* \brief Class that allows simplification operation on a simplicial complex represented
* by a skeleton/blockers pair.
* \ingroup skbl
+ * @extends Skeleton_blocker_complex
*/
template<typename SkeletonBlockerDS>
class Skeleton_blocker_simplifiable_complex : public Skeleton_blocker_complex<SkeletonBlockerDS>