summaryrefslogtreecommitdiff
path: root/src/Witness_complex
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-11 10:36:42 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-11 10:36:42 +0000
commit2d209b04475261e7f2f6688bc5bc7d90a7fa1e56 (patch)
tree8f0ac1a45fbd63bf17e26fc9fa8971da3778dc0f /src/Witness_complex
parent67f7ecf8e35b51256304b5120daf2827450b6dcd (diff)
Put the class Witness_complex to private in doc
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1037 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 351b135de4d345830ab7fb796eb69b23063fd494
Diffstat (limited to 'src/Witness_complex')
-rw-r--r--src/Witness_complex/example/witness_complex_from_file.cpp4
-rw-r--r--src/Witness_complex/example/witness_complex_sphere.cpp4
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h29
3 files changed, 32 insertions, 5 deletions
diff --git a/src/Witness_complex/example/witness_complex_from_file.cpp b/src/Witness_complex/example/witness_complex_from_file.cpp
index 98d1fe9c..a8294bad 100644
--- a/src/Witness_complex/example/witness_complex_from_file.cpp
+++ b/src/Witness_complex/example/witness_complex_from_file.cpp
@@ -40,7 +40,7 @@ using namespace Gudhi::witness_complex;
typedef std::vector< Vertex_handle > typeVectorVertex;
typedef std::vector< std::vector <double> > Point_Vector;
-typedef Witness_complex< Simplex_tree<> > WitnessComplex;
+//typedef Witness_complex< Simplex_tree<> > WitnessComplex;
/**
* \brief Customized version of read_points
@@ -98,7 +98,7 @@ int main(int argc, char * const argv[]) {
// Compute witness complex
start = clock();
- WitnessComplex(knn, nbL, point_vector[0].size(), simplex_tree);
+ Gudhi::witness_complex::witness_complex(knn, nbL, point_vector[0].size(), simplex_tree);
end = clock();
std::cout << "Witness complex took "
<< static_cast<double>(end - start) / CLOCKS_PER_SEC << " s. \n";
diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp
index fae80d67..7bbf983a 100644
--- a/src/Witness_complex/example/witness_complex_sphere.cpp
+++ b/src/Witness_complex/example/witness_complex_sphere.cpp
@@ -44,8 +44,6 @@ using namespace Gudhi::witness_complex;
typedef std::vector< Vertex_handle > typeVectorVertex;
-typedef Witness_complex< Simplex_tree<> > WitnessComplex;
-
/** Write a gnuplot readable file.
* Data range is a random access range of pairs (arg, value)
*/
@@ -85,7 +83,7 @@ int main(int argc, char * const argv[]) {
Gudhi::witness_complex::landmark_choice_by_random_point(point_vector, number_of_landmarks, knn);
// Compute witness complex
- WitnessComplex(knn, number_of_landmarks, point_vector[0].size(), simplex_tree);
+ Gudhi::witness_complex::witness_complex(knn, number_of_landmarks, point_vector[0].size(), simplex_tree);
end = clock();
double time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
std::cout << "Witness complex for " << number_of_landmarks << " landmarks took "
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index 046343db..524912cf 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -48,6 +48,7 @@ namespace Gudhi {
namespace witness_complex {
/**
+ * \private
\class Witness_complex
\brief Constructs the witness complex for the given set of witnesses and landmarks.
\ingroup witness_complex
@@ -236,6 +237,34 @@ class Witness_complex {
}
};
+ /**
+ * \ingroup witness_complex
+ * \brief Iterative construction of the witness complex.
+ * \details The witness complex is written in simplicial complex sc_
+ * basing on a matrix knn of
+ * nearest neighbours of the form {witnesses}x{landmarks}.
+ *
+ * The type KNearestNeighbors can be seen as
+ * Witness_range<Closest_landmark_range<Vertex_handle>>, where
+ * Witness_range and Closest_landmark_range are random access ranges.
+ *
+ * Procedure takes into account at most (dim+1)
+ * first landmarks from each landmark range to construct simplices.
+ *
+ * Landmarks are supposed to be in [0,nbL_-1]
+ */
+
+
+ template <class KNearestNeighbors, class SimplicialComplexForWitness>
+ void witness_complex(KNearestNeighbors const & knn,
+ int nbL,
+ int dim,
+ SimplicialComplexForWitness & sc)
+ {
+
+ Witness_complex<SimplicialComplexForWitness>(knn, nbL, dim, sc);
+ }
+
} // namespace witness_complex
} // namespace Gudhi