From f9cd8af15ec398d23951630ea4e897af7d849216 Mon Sep 17 00:00:00 2001 From: David Coeurjolly Date: Tue, 6 Sep 2016 15:31:18 +0200 Subject: [PATCH 1/3] minor typos/edits --- src/DGtal/geometry/volumes/distance/VoronoiMap.h | 8 ++++---- src/DGtal/geometry/volumes/distance/VoronoiMap.ih | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/DGtal/geometry/volumes/distance/VoronoiMap.h b/src/DGtal/geometry/volumes/distance/VoronoiMap.h index eadddcb67d..f0b098f274 100644 --- a/src/DGtal/geometry/volumes/distance/VoronoiMap.h +++ b/src/DGtal/geometry/volumes/distance/VoronoiMap.h @@ -182,7 +182,7 @@ namespace DGtal * The method associates to each point satisfying the foreground predicate, * the closest site for which the predicate is false. This algorithm is * @f$ O(h.d.|domain size|)@f$ if the separable metric "hiddenBy" - * predicate is in @f$ O(h)$@f$. + * predicate is in @f$ O(h)@f$. * * @param aDomain a pointer to the (hyper-rectangular) domain on * which the computation is performed. @@ -206,7 +206,7 @@ namespace DGtal * The method associates to each point satisfying the foreground predicate, * the closest site for which the predicate is false. This algorithm is * @f$ O(h.d.|domain size|)@f$ if the separable metric "hiddenBy" - * predicate is in @f$ O(h)$@f$. + * predicate is in @f$ O(h)@f$. * * @param aDomain a pointer to the (hyper-rectangular) domain on * which the computation is performed. @@ -289,10 +289,10 @@ namespace DGtal /** Periodicity specification along one dimensions. * - * @param n the dimension index. + * @param [in] n the dimension index. * @return \c true if the n-th dimension is periodic, \c false otherwise. */ - bool isPeriodic( Dimension n ) const + bool isPeriodic( const Dimension n ) const { return myPeriodicitySpec[ n ]; } diff --git a/src/DGtal/geometry/volumes/distance/VoronoiMap.ih b/src/DGtal/geometry/volumes/distance/VoronoiMap.ih index b24a133eb7..825f16469f 100644 --- a/src/DGtal/geometry/volumes/distance/VoronoiMap.ih +++ b/src/DGtal/geometry/volumes/distance/VoronoiMap.ih @@ -85,7 +85,6 @@ DGtal::VoronoiMap::compute( ) myUpperBoundCopy = myDomainPtr->upperBound(); //Point outside the domain - //myInfinity = myDomainPtr->upperBound() + Point::diagonal(1); for ( auto & coord : myInfinity ) coord = DGtal::NumberTraits< typename Point::Coordinate >::max(); @@ -109,7 +108,7 @@ void DGtal::VoronoiMap::computeOtherSteps ( const Dimension dim ) const { #ifdef VERBOSE - std::string title = "Voro dimension " + boost::lexical_cast( dim ) ; + std::string title = "VoronoiMap dimension " + boost::lexical_cast( dim ) ; trace.beginBlock ( title ); #endif @@ -170,7 +169,7 @@ DGtal::VoronoiMap::computeOtherStep1D ( const Point &startingP // Extent along current dimension. const auto extent = myUpperBoundCopy[dim] - myLowerBoundCopy[dim] + 1; - // Sites storage. + // Site storage. std::vector Sites; // Reserve sites storage. From 703ec365b71a39807826e9f19c552e8bf7c9878a Mon Sep 17 00:00:00 2001 From: David Coeurjolly Date: Tue, 6 Sep 2016 15:46:37 +0200 Subject: [PATCH 2/3] disabling default constructor --- src/DGtal/geometry/volumes/distance/VoronoiMap.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/DGtal/geometry/volumes/distance/VoronoiMap.h b/src/DGtal/geometry/volumes/distance/VoronoiMap.h index f0b098f274..72aaae9c72 100644 --- a/src/DGtal/geometry/volumes/distance/VoronoiMap.h +++ b/src/DGtal/geometry/volumes/distance/VoronoiMap.h @@ -229,6 +229,11 @@ namespace DGtal */ ~VoronoiMap(); + /** + * Disabling default constructor. + */ + VoronoiMap() = delete; + public: // ------------------- ConstImage model ------------------------ @@ -334,16 +339,6 @@ namespace DGtal void computeOtherStep1D (const Point &row, const Dimension dim) const; - // ------------------- protected methods ------------------------ - protected: - - /** - * Default Constructor. - * - */ - VoronoiMap(); - - // ------------------- Private members ------------------------ private: From e703f6f1af16dc84fb5bf50a45df36e9f8658031 Mon Sep 17 00:00:00 2001 From: David Coeurjolly Date: Tue, 6 Sep 2016 16:32:58 +0200 Subject: [PATCH 3/3] extra braces --- tests/geometry/volumes/distance/testVoronoiMap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/geometry/volumes/distance/testVoronoiMap.cpp b/tests/geometry/volumes/distance/testVoronoiMap.cpp index 6be492f839..012501f6f7 100644 --- a/tests/geometry/volumes/distance/testVoronoiMap.cpp +++ b/tests/geometry/volumes/distance/testVoronoiMap.cpp @@ -219,7 +219,7 @@ bool testCheckConcept() * Example of a test. To be completed. * */ -bool testVoronoiMap( std::array const& periodicity = { false, false } ) +bool testVoronoiMap( std::array const& periodicity = { {false, false} } ) { unsigned int nbok = 0; unsigned int nb = 0; @@ -296,7 +296,7 @@ bool testVoronoiMap( std::array const& periodicity = { false, false } ) template bool testVoronoiMapFromSites2D( const Set &aSet, const std::string &name, - std::array const& periodicity = { false, false } ) + std::array const& periodicity = { {false, false} } ) { unsigned int nbok = 0; unsigned int nb = 0; @@ -679,9 +679,9 @@ int main( int argc, char** argv ) bool res = testCheckConcept() && testVoronoiMap() - && testVoronoiMap( { true, false } ) - && testVoronoiMap( { false, true } ) - && testVoronoiMap( { true, true } ) + && testVoronoiMap( { {true, false} } ) + && testVoronoiMap( { {false, true} } ) + && testVoronoiMap( { {true, true} } ) && testSimple2D() && testSimpleRandom2D() && testSimple3D()