summaryrefslogtreecommitdiff
path: root/src/Skeleton_blocker
diff options
context:
space:
mode:
authorsalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-23 13:58:21 +0000
committersalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-23 13:58:21 +0000
commit05bd4b83bd56e7b3dedcc513c07fd82be2198d3d (patch)
treec6ce13c92ceef4203b462d97e6a8c53c90168121 /src/Skeleton_blocker
parent15059e2c538cc289d6e67d81d829b8f1ad30c46b (diff)
skbl renaming, new link methods for abstract link of geometrical complex
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@468 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: cb85e1ae86635857fbaaa0781526cb3eeaa9a50a
Diffstat (limited to 'src/Skeleton_blocker')
-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/iterators/Skeleton_blockers_edges_iterators.h24
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h8
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h7
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h26
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h57
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h31
-rw-r--r--src/Skeleton_blocker/test/TestGeometricComplex.cpp37
8 files changed, 133 insertions, 63 deletions
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 aaa682c3..c98b0b45 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
@@ -134,7 +134,7 @@ public:
Skeleton_blocker_off_reader(const std::string & name_file, Complex& read_complex, bool read_only_points = false,bool is_flag = false):valid_(false) {
std::ifstream stream(name_file);
if (stream.is_open()) {
- if(is_flag){
+ if(is_flag || read_only_points){
Skeleton_blocker_off_flag_visitor_reader<Complex> off_visitor(read_complex, read_only_points);
Off_reader off_reader(stream);
valid_ = off_reader.read(off_visitor);
@@ -184,8 +184,8 @@ public:
for(auto v : save_complex.vertex_range()){
vertex_num[v]=current_vertex++;
const auto& pt(save_complex.point(v));
- for(auto it = pt.begin();it!=pt.end();++it)
- stream<<*it<<" ";
+ for(auto x : pt)
+ stream<<x<<" ";
stream<<std::endl;
}
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
index feae3d57..0be6c74d 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
@@ -30,8 +30,8 @@ namespace Gudhi{
namespace skbl {
template<typename SkeletonBlockerComplex>
-class Complex_edge_around_vertex_iterator :
- public boost::iterator_facade < Complex_edge_around_vertex_iterator<SkeletonBlockerComplex>
+class Edge_around_vertex_iterator :
+ public boost::iterator_facade < Edge_around_vertex_iterator<SkeletonBlockerComplex>
, typename SkeletonBlockerComplex::Edge_handle const
, boost::forward_traversal_tag
, typename SkeletonBlockerComplex::Edge_handle const
@@ -54,10 +54,10 @@ private:
public:
- Complex_edge_around_vertex_iterator():complex(NULL){
+ Edge_around_vertex_iterator():complex(NULL){
}
- Complex_edge_around_vertex_iterator(const Complex* complex_,Vertex_handle v_):
+ Edge_around_vertex_iterator(const Complex* complex_,Vertex_handle v_):
complex(complex_),
v(v_)
{
@@ -67,7 +67,7 @@ public:
/**
* returns an iterator to the end
*/
- Complex_edge_around_vertex_iterator(const Complex* complex_,Vertex_handle v_,int end):
+ Edge_around_vertex_iterator(const Complex* complex_,Vertex_handle v_,int end):
complex(complex_),
v(v_)
{
@@ -75,7 +75,7 @@ public:
set_end();
}
- bool equal(const Complex_edge_around_vertex_iterator& other) const{
+ bool equal(const Edge_around_vertex_iterator& other) const{
return (complex== other.complex) && (v == other.v) && (current_ == other.current_) && (end_ == other.end_);
}
@@ -102,8 +102,8 @@ private:
*
*/
template<typename SkeletonBlockerComplex>
-class Complex_edge_iterator :
-public boost::iterator_facade < Complex_edge_iterator<SkeletonBlockerComplex>
+class Edge_iterator :
+public boost::iterator_facade < Edge_iterator<SkeletonBlockerComplex>
, typename SkeletonBlockerComplex::Edge_handle const
, boost::forward_traversal_tag
, typename SkeletonBlockerComplex::Edge_handle const
@@ -120,10 +120,10 @@ public:
const Complex* complex;
std::pair<boost_edge_iterator,boost_edge_iterator> edge_iterator ;
- Complex_edge_iterator():complex(NULL){
+ Edge_iterator():complex(NULL){
}
- Complex_edge_iterator(const SkeletonBlockerComplex* complex_):
+ Edge_iterator(const SkeletonBlockerComplex* complex_):
complex(complex_),
edge_iterator(boost::edges(complex_->skeleton))
{
@@ -132,7 +132,7 @@ public:
/**
* return an iterator to the end
*/
- Complex_edge_iterator(const SkeletonBlockerComplex* complex_,int end):
+ Edge_iterator(const SkeletonBlockerComplex* complex_,int end):
complex(complex_),
edge_iterator(boost::edges(complex_->skeleton))
{
@@ -140,7 +140,7 @@ public:
}
- bool equal(const Complex_edge_iterator& other) const{
+ bool equal(const Edge_iterator& other) const{
return (complex == other.complex) && (edge_iterator == other.edge_iterator);
}
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 0b397f56..666ce430 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
@@ -67,7 +67,6 @@ class Simplex_around_vertex_iterator :
typedef typename Link::Vertex_handle Link_vertex_handle;
// Link_vertex_handle == Complex_Vertex_handle but this renaming helps avoiding confusion
-
typedef typename Gudhi::skbl::Trie<Simplex_handle> Trie;
@@ -97,8 +96,7 @@ public:
v(other.v),
link_v(other.link_v),
trie(other.trie),
- nodes_to_be_seen(other.nodes_to_be_seen)
- {
+ nodes_to_be_seen(other.nodes_to_be_seen){
if(!other.is_end()){
}
}
@@ -237,7 +235,7 @@ class Simplex_iterator :
typedef typename Complex::Edge_handle Edge_handle;
typedef typename Complex::Simplex_handle Simplex_handle;
- typedef typename Complex::CVI CVI;
+ typedef typename Complex::Complex_vertex_iterator Complex_vertex_iterator;
typedef typename Link::Vertex_handle Link_vertex_handle;
@@ -245,7 +243,7 @@ class Simplex_iterator :
private:
const Complex* complex_;
- CVI current_vertex_;
+ Complex_vertex_iterator current_vertex_;
typedef Simplex_around_vertex_iterator<SkeletonBlockerComplex,Link> SAVI;
SAVI current_simplex_around_current_vertex_;
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
index 1fdbdfc9..e137d1ea 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
@@ -49,7 +49,7 @@ private:
typedef typename LinkType::Vertex_handle Vertex_handle;
typedef typename LinkType::Root_vertex_handle Root_vertex_handle;
typedef typename LinkType::Simplex_handle Simplex_handle;
- typedef Complex_edge_iterator<Complex> Complex_edge_iterator_;
+ typedef typename Complex::Complex_edge_iterator Complex_edge_iterator_;
const Complex* complex_;
Vertex_handle v_;
@@ -133,9 +133,10 @@ private:
typedef typename SkeletonBlockerComplex::Root_vertex_handle Root_vertex_handle;
typedef typename SkeletonBlockerComplex::Simplex_handle Simplex_handle;
typedef typename SkeletonBlockerComplex::Superior_triangle_around_vertex_iterator STAVI;
+ typedef typename SkeletonBlockerComplex::Complex_vertex_iterator Complex_vertex_iterator;
const SkeletonBlockerComplex* complex_;
- Complex_vertex_iterator<SkeletonBlockerComplex> current_vertex_;
+ Complex_vertex_iterator current_vertex_;
STAVI current_triangle_;
bool is_end_;
public:
@@ -176,7 +177,7 @@ public:
Triangle_iterator& operator=(const Triangle_iterator & other){
complex_ = other.complex_;
- Complex_vertex_iterator<SkeletonBlockerComplex> current_vertex_;
+ Complex_vertex_iterator current_vertex_;
STAVI current_triangle_;
return *this;
}
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
index 4c90ee51..a9d4e373 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
@@ -35,8 +35,8 @@ namespace skbl {
*@remark Incrementation increases Vertex_handle.
*/
template<typename SkeletonBlockerComplex>
-class Complex_vertex_iterator : public boost::iterator_facade
-< Complex_vertex_iterator <SkeletonBlockerComplex>
+class Vertex_iterator : public boost::iterator_facade
+< Vertex_iterator <SkeletonBlockerComplex>
, typename SkeletonBlockerComplex::Vertex_handle const
, boost::forward_traversal_tag
, typename SkeletonBlockerComplex::Vertex_handle const
@@ -52,10 +52,10 @@ private:
public:
- Complex_vertex_iterator():complex(NULL){
+ Vertex_iterator():complex(NULL){
}
- Complex_vertex_iterator(const SkeletonBlockerComplex* complex_):
+ Vertex_iterator(const SkeletonBlockerComplex* complex_):
complex(complex_),
vertexIterator(vertices(complex_->skeleton)){
if(!finished() && !is_active()) {
@@ -66,7 +66,7 @@ public:
/**
* return an iterator to the end.
*/
- Complex_vertex_iterator(const SkeletonBlockerComplex* complex_,int end):
+ Vertex_iterator(const SkeletonBlockerComplex* complex_,int end):
complex(complex_),vertexIterator(vertices(complex_->skeleton)){
vertexIterator.first = vertexIterator.second ;
}
@@ -77,11 +77,11 @@ public:
return(Vertex_handle(*(vertexIterator.first)));
}
- bool equal(const Complex_vertex_iterator& other) const{
+ bool equal(const Vertex_iterator& other) const{
return vertexIterator == other.vertexIterator && complex == other.complex;
}
- bool operator<(const Complex_vertex_iterator& other) const{
+ bool operator<(const Vertex_iterator& other) const{
return dereference()<other.dereference();
}
@@ -107,8 +107,8 @@ private:
template<typename SkeletonBlockerComplex>
-class Complex_neighbors_vertices_iterator
-: public boost::iterator_facade < Complex_neighbors_vertices_iterator<SkeletonBlockerComplex>
+class Neighbors_vertices_iterator
+: public boost::iterator_facade < Neighbors_vertices_iterator<SkeletonBlockerComplex>
, typename SkeletonBlockerComplex::Vertex_handle const
, boost::forward_traversal_tag
, typename SkeletonBlockerComplex::Vertex_handle const
@@ -133,10 +133,10 @@ public:
// boost_adjacency_iterator ai, ai_end;
// for (tie(ai, ai_end) = adjacent_vertices(v.vertex, skeleton); ai != ai_end; ++ai){
- Complex_neighbors_vertices_iterator():complex(NULL){
+ Neighbors_vertices_iterator():complex(NULL){
}
- Complex_neighbors_vertices_iterator(const Complex* complex_,Vertex_handle v_):
+ Neighbors_vertices_iterator(const Complex* complex_,Vertex_handle v_):
complex(complex_),
v(v_){
tie(current_,end_) = adjacent_vertices(v.vertex, complex->skeleton);
@@ -145,7 +145,7 @@ public:
/**
* returns an iterator to the end
*/
- Complex_neighbors_vertices_iterator(const Complex* complex_,Vertex_handle v_,int end):
+ Neighbors_vertices_iterator(const Complex* complex_,Vertex_handle v_,int end):
complex(complex_),
v(v_){
tie(current_,end_) = adjacent_vertices(v.vertex, complex->skeleton);
@@ -162,7 +162,7 @@ public:
return(Vertex_handle(*current_));
}
- bool equal(const Complex_neighbors_vertices_iterator& other) const{
+ bool equal(const Neighbors_vertices_iterator& other) const{
return (complex== other.complex) && (v == other.v) && (current_ == other.current_) && (end_ == other.end_);
}
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
index 893c65c6..5b2c1f27 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
@@ -63,10 +63,10 @@ namespace skbl {
*/
template<class SkeletonBlockerDS>
class Skeleton_blocker_complex {
- template<class ComplexType> friend class Complex_vertex_iterator;
- template<class ComplexType> friend class Complex_neighbors_vertices_iterator;
- template<class ComplexType> friend class Complex_edge_iterator;
- template<class ComplexType> friend class Complex_edge_around_vertex_iterator;
+ template<class ComplexType> friend class Vertex_iterator;
+ template<class ComplexType> friend class Neighbors_vertices_iterator;
+ template<class ComplexType> friend class Edge_iterator;
+ template<class ComplexType> friend class Edge_around_vertex_iterator;
template<class ComplexType> friend class Skeleton_blocker_link_complex;
template<class ComplexType> friend class Skeleton_blocker_link_superior;
@@ -587,7 +587,6 @@ public:
if (found) {
if (visitor)
visitor->on_remove_edge(a, b);
- // if (heapCollapse.Contains(edge)) heapCollapse.Delete(edge);
boost::remove_edge(a.vertex, b.vertex, skeleton);
degree_[a.vertex]--;
degree_[b.vertex]--;
@@ -1237,35 +1236,34 @@ public:
/** @name Vertex iterators
*/
//@{
- typedef Complex_vertex_iterator<Skeleton_blocker_complex> CVI; // todo rename
+ typedef Vertex_iterator<Skeleton_blocker_complex> Complex_vertex_iterator;
//
- // @brief Range over the vertices of the simplicial complex.
+ // Range over the vertices of the simplicial complex.
// Methods .begin() and .end() return a Complex_vertex_iterator.
//
- typedef boost::iterator_range<
- Complex_vertex_iterator<Skeleton_blocker_complex> > Complex_vertex_range;
+ typedef boost::iterator_range<Complex_vertex_iterator> Complex_vertex_range;
/**
* @brief Returns a Complex_vertex_range over all vertices of the complex
*/
Complex_vertex_range vertex_range() const {
- auto begin = Complex_vertex_iterator<Skeleton_blocker_complex>(this);
- auto end = Complex_vertex_iterator<Skeleton_blocker_complex>(this, 0);
+ auto begin = Complex_vertex_iterator(this);
+ auto end = Complex_vertex_iterator(this, 0);
return Complex_vertex_range(begin, end);
}
- typedef boost::iterator_range<
- Complex_neighbors_vertices_iterator<Skeleton_blocker_complex> > Complex_neighbors_vertices_range;
+ typedef Neighbors_vertices_iterator<Skeleton_blocker_complex> Complex_neighbors_vertices_iterator;
+
+
+ typedef boost::iterator_range<Complex_neighbors_vertices_iterator> Complex_neighbors_vertices_range;
/**
* @brief Returns a Complex_edge_range over all edges of the simplicial complex that passes trough v
*/
Complex_neighbors_vertices_range vertex_range(Vertex_handle v) const {
- auto begin = Complex_neighbors_vertices_iterator<Skeleton_blocker_complex>(
- this, v);
- auto end = Complex_neighbors_vertices_iterator<Skeleton_blocker_complex>(
- this, v, 0);
+ auto begin = Complex_neighbors_vertices_iterator(this, v);
+ auto end = Complex_neighbors_vertices_iterator(this, v, 0);
return Complex_neighbors_vertices_range(begin, end);
}
@@ -1275,28 +1273,33 @@ public:
*/
//@{
- typedef boost::iterator_range<
- Complex_edge_iterator<Skeleton_blocker_complex<SkeletonBlockerDS>>> Complex_edge_range;
+ typedef Edge_iterator<Skeleton_blocker_complex> Complex_edge_iterator;
+
+
+ typedef boost::iterator_range<Complex_edge_iterator> Complex_edge_range;
/**
* @brief Returns a Complex_edge_range over all edges of the simplicial complex
*/
Complex_edge_range edge_range() const {
- auto begin = Complex_edge_iterator<Skeleton_blocker_complex < SkeletonBlockerDS >> (this);
- auto end = Complex_edge_iterator<Skeleton_blocker_complex < SkeletonBlockerDS >> (this, 0);
+ auto begin = Complex_edge_iterator(this);
+ auto end = Complex_edge_iterator(this, 0);
return Complex_edge_range(begin, end);
}
- typedef boost::iterator_range <Complex_edge_around_vertex_iterator<Skeleton_blocker_complex<SkeletonBlockerDS>>>
- Complex_edge_around_vertex_range;
+
+ typedef Edge_around_vertex_iterator<Skeleton_blocker_complex> Complex_edge_around_vertex_iterator;
+
+
+ typedef boost::iterator_range <Complex_edge_around_vertex_iterator> Complex_edge_around_vertex_range;
/**
* @brief Returns a Complex_edge_range over all edges of the simplicial complex that passes
* through 'v'
*/
Complex_edge_around_vertex_range edge_range(Vertex_handle v) const {
- auto begin = Complex_edge_around_vertex_iterator<Skeleton_blocker_complex < SkeletonBlockerDS >> (this, v);
- auto end = Complex_edge_around_vertex_iterator<Skeleton_blocker_complex < SkeletonBlockerDS >> (this, v, 0);
+ auto begin = Complex_edge_around_vertex_iterator(this, v);
+ auto end = Complex_edge_around_vertex_iterator(this, v, 0);
return Complex_edge_around_vertex_range(begin, end);
}
@@ -1327,6 +1330,10 @@ public:
typedef boost::iterator_range<Triangle_iterator<Skeleton_blocker_complex> > Complex_triangle_range;
+
+ typedef Triangle_iterator<Skeleton_blocker_complex> Complex_triangle_iterator;
+
+
/**
* @brief Range over triangles of the simplicial complex.
* Methods .begin() and .end() return a Triangle_around_vertex_iterator.
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
index bb58d0dc..ee56ce3b 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
@@ -92,7 +92,8 @@ class Skeleton_blocker_geometric_complex :
unsigned current = 0;
complex=make_complex_from_top_faces<Skeleton_blocker_geometric_complex>(simplex_begin,simplex_end,is_flag_complex);
for(auto point = points_begin; point != points_end; ++point)
- complex.point(Vertex_handle(current++)) = Point(point->begin(),point->end());
+ // complex.point(Vertex_handle(current++)) = Point(point->begin(),point->end());
+ complex.point(Vertex_handle(current++)) = Point(*point);
return complex;
}
@@ -185,6 +186,31 @@ class Skeleton_blocker_geometric_complex :
return link;
}
+ typedef Skeleton_blocker_link_complex<Skeleton_blocker_complex<SkeletonBlockerGeometricDS>> Abstract_link;
+
+ /**
+ * Constructs the abstract link of v (without points coordinates).
+ */
+ Abstract_link abstract_link(Vertex_handle v) const {
+ return Abstract_link(*this, Simplex_handle(v));
+ }
+
+ /**
+ * Constructs the link of 'simplex' with points coordinates.
+ */
+ Geometric_link abstract_link(const Simplex_handle& simplex) const {
+ return Abstract_link(*this, simplex);
+ }
+
+ /**
+ * Constructs the link of 'simplex' with points coordinates.
+ */
+ Geometric_link abstract_link(Edge_handle edge) const {
+ return Abstract_link(*this, edge);
+ }
+
+
+
private:
void add_points_to_link(Geometric_link& link) const {
@@ -193,6 +219,9 @@ class Skeleton_blocker_geometric_complex :
link.point(v) = (*this).point(v_root);
}
}
+
+
+
};
} // namespace skbl
diff --git a/src/Skeleton_blocker/test/TestGeometricComplex.cpp b/src/Skeleton_blocker/test/TestGeometricComplex.cpp
index 1a81b7f7..bd7af89b 100644
--- a/src/Skeleton_blocker/test/TestGeometricComplex.cpp
+++ b/src/Skeleton_blocker/test/TestGeometricComplex.cpp
@@ -40,7 +40,7 @@ struct Geometry_trait{
typedef Geometry_trait::Point Point;
typedef Skeleton_blocker_simple_geometric_traits<Geometry_trait> Complex_geometric_traits;
typedef Skeleton_blocker_geometric_complex< Complex_geometric_traits > Complex;
-
+typedef Complex::Vertex_handle Vertex_handle;
bool test_constructor1(){
@@ -71,12 +71,47 @@ bool test_constructor1(){
return (complex==same);
}
+bool test_constructor2(){
+ Complex complex;
+ Skeleton_blocker_off_reader<Complex> off_reader("test2.off",complex);
+ if(!off_reader.is_valid()){
+ std::cerr << "Unable to read file"<<std::endl;
+ return false;
+ }
+ std::cout << "complex has "<<
+ complex.num_vertices()<<" vertices, "<<
+ complex.num_blockers()<<" blockers, "<<
+ complex.num_edges()<<" edges and" <<
+ complex.num_triangles()<<" triangles.";
+
+ if(complex.num_vertices()!=7 || complex.num_edges()!=12 || complex.num_triangles() !=6)
+ return false;
+
+ auto link_0 = complex.abstract_link(Vertex_handle(0));
+
+
+ std::cout<<"\n link(0):"<<link_0.to_string()<<endl;
+
+ auto link_geometric_0 = complex.link(Vertex_handle(0));
+
+ auto print_point = [&](Vertex_handle v){for(auto x : link_geometric_0.point(v)) std::cout <<x<<" "; std::cout<<std::endl;};
+
+ std::for_each(link_geometric_0.vertex_range().begin(),link_geometric_0.vertex_range().end(),print_point);
+
+// for(auto v : link_geometric_0.vertex_range())
+// std::cout<<"point("<<v<<"):"<<link_geometric_0.point(v)<<std::endl;
+
+ return link_0.num_vertices()==2;
+}
+
+
int main (int argc, char *argv[])
{
Tests tests_geometric_complex;
tests_geometric_complex.add("Test constructor 1",test_constructor1);
+ tests_geometric_complex.add("Test constructor 2",test_constructor2);
if(tests_geometric_complex.run())
return EXIT_SUCCESS;