From c524232f734de875d69e2f190f01a6c976024368 Mon Sep 17 00:00:00 2001 From: Gard Spreemann Date: Thu, 14 Jun 2018 20:39:01 +0200 Subject: GUDHI 2.2.0 as released by upstream in a tarball. --- concept/Persistent_cohomology/FilteredComplex.h | 40 ++++++++++++++----------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'concept/Persistent_cohomology/FilteredComplex.h') diff --git a/concept/Persistent_cohomology/FilteredComplex.h b/concept/Persistent_cohomology/FilteredComplex.h index c19698df..62b9002f 100644 --- a/concept/Persistent_cohomology/FilteredComplex.h +++ b/concept/Persistent_cohomology/FilteredComplex.h @@ -4,7 +4,7 @@ * * Author(s): Clément Maria * - * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France) + * 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 @@ -29,10 +29,6 @@ struct FilteredComplex { /** Handle to specify a simplex. */ typedef unspecified Simplex_handle; -/** \brief Key associated to each simplex. - * - * Must be a signed integer type. */ - typedef unspecified Simplex_key; /** \brief Type for the value of the filtration function. * * Must be comparable with <. */ @@ -58,20 +54,10 @@ struct FilteredComplex * filtration function on the complex. */ Filtration_value filtration(Simplex_handle sh); -/** \brief Returns a key that is different from the keys associated - * to the simplices. */ - Simplex_key null_key (); -/** \brief Returns the key associated to a simplex. - * - * This is never called on null_simplex(). */ - Simplex_key key ( Simplex_handle sh ); /** \brief Returns the simplex that has index idx in the filtration. * - * This is never called on null_key(). */ - Simplex_handle simplex ( Simplex_key idx ); -/** \brief Assign a key to a simplex. */ - void assign_key(Simplex_handle sh, Simplex_key key); - + * This is only called on valid indices. */ + Simplex_handle simplex ( size_t idx ); /** \brief Iterator on the simplices belonging to the * boundary of a simplex. * @@ -115,6 +101,26 @@ typedef unspecified Filtration_simplex_range; * .begin() and .end() return type Filtration_simplex_iterator.*/ Filtration_simplex_range filtration_simplex_range(); +/** \name Map interface + * Conceptually a `std::unordered_map`. + * @{ */ +/** \brief Data stored for each simplex. + * + * Must be an integer type. */ + typedef unspecified Simplex_key; +/** \brief Returns a constant dummy number that is either negative, + * or at least as large as `num_simplices()`. Suggested value: -1. */ + Simplex_key null_key (); +/** \brief Returns the number stored for a simplex by `assign_key`. + * + * This is never called on null_simplex(). */ + Simplex_key key ( Simplex_handle sh ); +/** \brief Store a number for a simplex, which can later be retrieved with `key(sh)`. + * + * This is never called on null_simplex(). */ + void assign_key(Simplex_handle sh, Simplex_key n); +/** @} */ + /* \brief Iterator over the simplices of the complex, * in an arbitrary order. -- cgit v1.2.3