Notification time stamped 2023-06-30 20:47:16 UTC
From 1a38dc90d92055d6df94f2dc9b916616fbaf539c Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla gwync@protonmail.com Date: Jun 30 2023 20:41:38 +0000 Subject: Patch for test failure
---
diff --git a/23dd3ee5fc3c56ed4e0bd5339e4bde07d7dcd831.patch b/23dd3ee5fc3c56ed4e0bd5339e4bde07d7dcd831.patch new file mode 100644 index 0000000..3dd106b --- /dev/null +++ b/23dd3ee5fc3c56ed4e0bd5339e4bde07d7dcd831.patch @@ -0,0 +1,43 @@ +From 23dd3ee5fc3c56ed4e0bd5339e4bde07d7dcd831 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Szabolcs=20Horva=CC=81t?= szhorvat@gmail.com +Date: Fri, 30 Jun 2023 21:35:49 +0200 +Subject: [PATCH] fix: correct bisection procedure in + igraph_community_voronoi() + +--- + src/community/voronoi.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/src/community/voronoi.c b/src/community/voronoi.c +index f8f48e8414..1a9ea7cae3 100644 +--- a/src/community/voronoi.c ++++ b/src/community/voronoi.c +@@ -341,17 +341,24 @@ static igraph_error_t brent_opt(optfun_t *f, igraph_real_t x1, igraph_real_t x2, + } + + /* It sometimes happens in disconnected graphs that the maximum is reached at or near the +- * top of the radius range. If so, we bisect the (f3, f2) interval to search for a configuration ++ * top of the radius range. If so, we bisect the (x3, x2) interval to search for a configuration + * where f3 >= f2. */ + if (f2 > f3) { +- /* Limit iterations to 20 */ +- for (int i=0; i < 20; ++i) { +- x1 = x2; f1 = f2; ++ /* Limit iterations to niter=20 */ ++ const int niter = 20; ++ int i; ++ for (i=0; i < niter; ++i) { ++ x1 = x3; f1 = f3; + x3 = 0.5 * (x1 + x2); + IGRAPH_CHECK(f(x3, &f3, extra)); + + if (f3 >= f2) break; + } ++ /* If no maximum was found in 'niter' bisections, just take the upper end of the range. */ ++ if (i == niter) { ++ IGRAPH_CHECK(f(x2, &f2, extra)); ++ return IGRAPH_SUCCESS; ++ } + } + + /* Limit iterations to 20 */ diff --git a/igraph.spec b/igraph.spec index 9ac0cb0..949ecc4 100644 --- a/igraph.spec +++ b/igraph.spec @@ -15,6 +15,7 @@ Summary: Library for creating and manipulating graphs License: GPL-2.0-or-later URL: http://igraph.sourceforge.net/ Source0: https://github.com/igraph/igraph/releases/download/%%7Bversion%7D/igraph-%%7... +Patch0: 23dd3ee5fc3c56ed4e0bd5339e4bde07d7dcd831.patch
BuildRequires: gcc BuildRequires: gcc-c++ @@ -40,6 +41,8 @@ documentation needed to develop application with %{name}. %prep %setup -q
+%patch -P 0 -p1 + %build %cmake \ -DIGRAPH_ENABLE_LTO=AUTO \
https://src.fedoraproject.org/rpms/igraph/c/1a38dc90d92055d6df94f2dc9b916616...
scm-commits@lists.fedoraproject.org