From 74273a1aa111491beba2f32825bb5f45fe6ad0a7 Mon Sep 17 00:00:00 2001 From: Kacper Pluta Date: Thu, 19 Jan 2017 16:48:55 +0100 Subject: [PATCH 1/4] Update moduleCubicalComplex.dox Added related file --- src/DGtal/topology/doc/moduleCubicalComplex.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DGtal/topology/doc/moduleCubicalComplex.dox b/src/DGtal/topology/doc/moduleCubicalComplex.dox index 035e489c80..a9f40f2d45 100644 --- a/src/DGtal/topology/doc/moduleCubicalComplex.dox +++ b/src/DGtal/topology/doc/moduleCubicalComplex.dox @@ -26,7 +26,7 @@ href="https://gforge.liris.cnrs.fr/projects/imagene">ImaGene. The following programs are related to this documentation: cubical-complex-collapse.cpp, cubical-complex-illustrations.cpp, -testCubicalComplex.cpp, +testCubicalComplex.cpp, cubicalComplexThinning.cpp. @section dgtal_ccomplex_sec1 Introduction to cubical complexes From e31a9fea00bbfee82130a70a0a561835f057f4f7 Mon Sep 17 00:00:00 2001 From: Kacper Pluta Date: Sun, 4 Nov 2018 22:04:25 +0200 Subject: [PATCH 2/4] Fix possible division by zero when only one sample. --- src/DGtal/math/MultiStatistics.ih | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DGtal/math/MultiStatistics.ih b/src/DGtal/math/MultiStatistics.ih index fb8843f342..59ee104029 100644 --- a/src/DGtal/math/MultiStatistics.ih +++ b/src/DGtal/math/MultiStatistics.ih @@ -250,8 +250,11 @@ DGtal::MultiStatistics::terminate() myExp[ k ] /= mySamples[ k ]; myExp2[ k ] /= mySamples[ k ]; myVar[ k ] = myExp2[ k ] - myExp[ k ] * myExp[ k ]; - myUnbiasedVar[ k ] = mySamples[ k ] * myVar[ k ] - / ( mySamples[ k ] - 1 ); + if ( mySamples[ k ] > 1 ) + myUnbiasedVar[ k ] = mySamples[ k ] * myVar[ k ] / ( mySamples[ k ] - 1 ); + else + myUnbiasedVar[ k ] = 0; + } myIsTerminate = true; } From ee0d463820e58e3740131143e98f6dee3157420f Mon Sep 17 00:00:00 2001 From: Kacper Pluta Date: Sun, 4 Nov 2018 22:15:48 +0200 Subject: [PATCH 3/4] Changelog entry --- ChangeLog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 51f1e9531c..3627e595b1 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -50,6 +50,9 @@ - *DEC* - Adding missing headers in some files of DEC. (Roland Denis, [#1349](https://github.com/DGtal-team/DGtal/pull/1349)) + +- *Math* + - Fix possible division by zero in the MultiStatistics class. # DGtal 0.9.4.1 From 5534b6583ce6e32d0381754145ec38f2e1f2f25f Mon Sep 17 00:00:00 2001 From: Kacper Pluta Date: Sun, 4 Nov 2018 22:48:10 +0200 Subject: [PATCH 4/4] info --- ChangeLog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 3627e595b1..92d4c5cd47 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -52,7 +52,8 @@ (Roland Denis, [#1349](https://github.com/DGtal-team/DGtal/pull/1349)) - *Math* - - Fix possible division by zero in the MultiStatistics class. + - Fix possible division by zero in the MultiStatistics class. + (Kacper Pluta, [#1358](https://github.com/DGtal-team/DGtal/pull/1358)) # DGtal 0.9.4.1