From f8d3d1018955ab2c26059b290013ee478d0154eb Mon Sep 17 00:00:00 2001 From: evanbiederstedt Date: Sun, 25 Sep 2022 19:05:43 -0400 Subject: [PATCH 1/2] remove Matrix.utils --- CHANGELOG.md | 2 ++ DESCRIPTION | 5 ++--- NAMESPACE | 1 - R/communities.R | 1 - man/exampleGraph.Rd | 2 +- src/RcppExports.cpp | 1 - src/leiden.cpp | 5 +++++ src/leidenalg/RBConfigurationVertexPartition.cpp | 5 +++++ 8 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9ace83..a85be45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## [1.0.4] - 2022 September 25 +* Remove 'Matrix.utils' as dependency ## [1.0.3] - 2022 April 08 * Install rigraph directly in `/src`. Remove previous linking to `igraph` R package in Makevars. diff --git a/DESCRIPTION b/DESCRIPTION index 28d4526..c12e1a4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: leidenAlg Type: Package Title: Implements the Leiden Algorithm via an R Interface -Version: 1.0.3 +Version: 1.0.4 Authors@R: c(person("Peter", "Kharchenko", email = "Peter_Kharchenko@hms.harvard.edu", role = c("aut")), person("Viktor", "Petukhov", email = "viktor.s.petukhov@ya.ru", role = c("aut")), person("V.A.", "Traag", email = "v.a.traag@cwts.leidenuniv.nl", role = c("ctb")), person("Gábor", "Csárdi", email = "sardi.gabor@gmail.com", role = c("ctb")), person("Tamás", "Nepusz", email = "ntamas@gmail.com", role = c("ctb")), person("Minh Van", "Nguyen", email = "nguyenminh2@gmail.com", role = c("ctb")), person("Evan", "Biederstedt", email = "evan.biederstedt@gmail.com", role=c("cre", "aut"))) Description: An R interface to the Leiden algorithm, an iterative community detection algorithm on networks. The algorithm is designed to converge to a partition in which all subsets of all communities are locally optimally assigned, yielding communities guaranteed to be connected. The implementation proves to be fast, scales well, and can be run on graphs of millions of nodes (as long as they can fit in memory). The original implementation was constructed as a python interface "leidenalg" found here: . The algorithm was originally described in Traag, V.A., Waltman, L. & van Eck, N.J. "From Louvain to Leiden: guaranteeing well-connected communities". Sci Rep 9, 5233 (2019) . License: GPL-3 @@ -13,7 +13,6 @@ Imports: graphics, grDevices, igraph, - Matrix.utils, parallel, Rcpp (>= 1.0.5), sccore, @@ -23,7 +22,7 @@ Suggests: testthat (>= 3.1.0) LinkingTo: Rcpp, RcppArmadillo, RcppEigen SystemRequirements: C++11, GNU make (optional), libxml2 (optional), glpk (>= 4.57, optional) -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.1 URL: https://github.com/kharchenkolab/leidenAlg BugReports: https://github.com/kharchenkolab/leidenAlg/issues NeedsCompilation: yes diff --git a/NAMESPACE b/NAMESPACE index fa3fbc5..28807ce 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,7 +7,6 @@ export(leiden.community) export(rleiden.community) exportPattern("^[[:alpha:]]+") import(Matrix) -import(Matrix.utils) import(Rcpp) import(parallel) import(sccore) diff --git a/R/communities.R b/R/communities.R index 2f4f48c..e10031c 100644 --- a/R/communities.R +++ b/R/communities.R @@ -13,7 +13,6 @@ #' @importFrom graphics par #' @importFrom grDevices adjustcolor #' @importFrom stats as.dendrogram is.leaf dendrapply as.hclust -#' @import Matrix.utils #' @import Matrix NULL diff --git a/man/exampleGraph.Rd b/man/exampleGraph.Rd index e50bc94..ef1c579 100644 --- a/man/exampleGraph.Rd +++ b/man/exampleGraph.Rd @@ -5,7 +5,7 @@ \alias{exampleGraph} \title{Conos graph} \format{ -An object of class \code{igraph} of length 10. +An object of class \code{igraph} of length 100. } \usage{ exampleGraph diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 737c1f4..fd6dc48 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -2,7 +2,6 @@ // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #include -#define NDEBUG 1 #include #include diff --git a/src/leiden.cpp b/src/leiden.cpp index 2164975..5d02233 100644 --- a/src/leiden.cpp +++ b/src/leiden.cpp @@ -12,6 +12,11 @@ using namespace std; using namespace Rcpp; +// Debug Mode implies checking assertions. +#if defined(_GLIBCXX_ASSERTIONS) +# define _GLIBCXX_ASSERTIONS 0 +#endif + // a wrapper for the Leidgen algorithm implementation (https://github.com/vtraag/leidenalg) int R_SEXP_to_vector(SEXP sv, igraph_vector_t *v) { diff --git a/src/leidenalg/RBConfigurationVertexPartition.cpp b/src/leidenalg/RBConfigurationVertexPartition.cpp index b5c66ce..00ca32e 100644 --- a/src/leidenalg/RBConfigurationVertexPartition.cpp +++ b/src/leidenalg/RBConfigurationVertexPartition.cpp @@ -1,6 +1,11 @@ #include "RBConfigurationVertexPartition.h" #include "igraph.h" +// Debug Mode implies checking assertions. +#if defined(_GLIBCXX_ASSERTIONS) +# define _GLIBCXX_ASSERTIONS 0 +#endif + RBConfigurationVertexPartition::RBConfigurationVertexPartition(Graph* graph, vector const& membership, double resolution_parameter) : From 24c92f81a014a23bd2b5cb53c91be0999b1a83c4 Mon Sep 17 00:00:00 2001 From: evanbiederstedt Date: Sun, 25 Sep 2022 19:53:46 -0400 Subject: [PATCH 2/2] add back #define NDEBUG 1 --- src/RcppExports.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index fd6dc48..737c1f4 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -2,6 +2,7 @@ // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #include +#define NDEBUG 1 #include #include