summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-15 12:21:47 +0000
committerpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-15 12:21:47 +0000
commitc23385d5be8588339531e82f8eb8abcde2ad1158 (patch)
tree34beb2b08b44ffc479c130062e307055527b0411
parent68bf758eacef58672cefbc1955c4dec9e2b2786a (diff)
FIXME note in the Persistence_landscape_on_grid.h file (distance computations).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_stat@1880 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: dfe7abfc7ddde3bd028c11156085b610be643167
-rw-r--r--src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp2
-rw-r--r--src/Gudhi_stat/include/gudhi/concretizations/Persistence_landscape_on_grid.h3
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h19
3 files changed, 23 insertions, 1 deletions
diff --git a/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp b/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp
index e6bc6648..af87687d 100644
--- a/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp
+++ b/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp
@@ -58,7 +58,7 @@ int main(int argc, char** argv) {
Persistent_cohomology pcoh(b);
pcoh.init_coefficients(p); // initializes the coefficient field for homology
pcoh.compute_persistent_cohomology(min_persistence);
-
+
std::stringstream ss;
ss << argv[1] << "_persistence";
std::ofstream out(ss.str().c_str());
diff --git a/src/Gudhi_stat/include/gudhi/concretizations/Persistence_landscape_on_grid.h b/src/Gudhi_stat/include/gudhi/concretizations/Persistence_landscape_on_grid.h
index b524e34a..d29a51ab 100644
--- a/src/Gudhi_stat/include/gudhi/concretizations/Persistence_landscape_on_grid.h
+++ b/src/Gudhi_stat/include/gudhi/concretizations/Persistence_landscape_on_grid.h
@@ -733,6 +733,9 @@ public:
/**
* Computations of L^{p} distance between two landscapes on a grid. p is the parameter of the procedure.
+ * FIXME: Note that, due to the grid representation, the method below may give non--accurate results in case when the landscape P and Q the difference of which we want to compute
+ * are interxsecting. This is a consequence of a general way they are computed. In the future, an integral of absolute value of a difference of P and Q will be given as a separated
+ * function to fix that inaccuracy.
**/
friend double compute_distance_of_landscapes_on_grid( const Persistence_landscape_on_grid& first, const Persistence_landscape_on_grid& second , double p )
{
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
index b31df6a4..3568561a 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
@@ -598,6 +598,25 @@ class Persistent_cohomology {
<< cpx_->filtration(get<1>(pair)) << std::endl;
}
}
+
+
+ /** @brief Vector of persistence intervals.
+ * @return A vector of persistence intervals on a fixed dimension. Each persistence pair is represented as a pair of objects of a type Filtration_value.
+ */
+ std::vector< std::pair< Filtration_value , Filtration_value > > paris_in_dimension( unsigned dimension )
+ {
+ std::vector< std::pair< Filtration_value , Filtration_value > > result;
+ //should I initialize this somehow locally?? Even to the size of persistent_pairs_ list.
+ for (auto pair : persistent_pairs_)
+ {
+ if ( ( cpx_->dimension( get<0>(pair) ) == dimension ) && ( cpx_->null_simplex() != get<1>(pair) ) )
+ {
+ result.push_back( std::pair<Filtration_value , Filtration_value>(cpx_->filtration( get<0>(pair) ) , cpx_->filtration( get<1>(pair) ) ) );
+ }
+ }
+ return result;
+ }
+
/** @brief Returns Betti numbers.
* @return A vector of Betti numbers.