Skip to content

Commit

Permalink
leidenbase version 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Ewing committed Oct 2, 2020
1 parent 08c180d commit 8c52ebc
Show file tree
Hide file tree
Showing 48 changed files with 870 additions and 616 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: leidenbase
Type: Package
Title: R and C wrappers to run the Leiden find_partition function
Version: 0.1.1
Version: 0.1.2
Authors@R: person( 'Brent', 'Ewing', role = c( 'aut', 'cre' ), email = '[email protected]' )
Description: An R to C interface that runs the Leiden community
detection algorithm to find a basic partition. It runs the
Expand All @@ -20,13 +20,13 @@ Description: An R to C interface that runs the Leiden community
Scientific Reports (2019),
DOI: 10.1038/s41598-019-41695-z.
Requires: R (>= 3.0.0)
Imports: igraph (>= 1.1.0)
Imports: igraph (>= 0.8.2)
License: GNU PUBLIC LICENSE 2 and GNU PUBLIC LICENSE 3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
Suggests: testthat
NeedsCompilation: yes
Packaged: 2020-07-10 20:45:17 UTC; brent
Packaged: 2020-10-02 18:40:44 UTC; brent
Author: Brent Ewing [aut, cre]
Maintainer: Brent Ewing <[email protected]>
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,30 @@ Use the devtools::install_github() command
devtools::install_github('cole-trapnell-lab/leidenbase')
```

### Tested conditions

#### Linux Debian 10 Buster

R distribution: Debian packages
C/C++ compilers: Debian distribution packages
FORTRAN compiler: Debian distribution packages

#### MacOS 10.15 Catalina

R distribution: CRAN package from https://cran.r-project.org/bin/macosx/R-4.0.2.pkg
C/C++ compilers: Apple Xcode 12.0
FORTRAN compiler: gfortran 10.2 from https://github.com/fxcoudert/gfortran-for-macOS/releases

#### MicroSoft Windows 10

R distribution: CRAN package from https://cran.r-project.org/bin/windows/base/R-4.0.2-win.exe
C/C++ compilers: CRAN Rtools40 from https://cran.r-project.org/bin/windows/Rtools/rtools40-x86_64.exe
FORTRAN compiler: CRAN Rtools40 from https://cran.r-project.org/bin/windows/Rtools/rtools40-x86_64.exe

#### Suggestions

Try to use compatible C/C++ and FORTRAN compilers. For example, if you install R using a CRAN package, try to use the R compiler tools, and if you use *brew* on MacOS to install R, try to use brew-installed compilers.

### Leidenbase functions

The R wrapper for running the Leiden algorithm find partition function is
Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for leidenbase 0.1.0.
# Generated by GNU Autoconf 2.69 for leidenbase 0.1.2.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='leidenbase'
PACKAGE_TARNAME='leidenbase'
PACKAGE_VERSION='0.1.0'
PACKAGE_STRING='leidenbase 0.1.0'
PACKAGE_VERSION='0.1.2'
PACKAGE_STRING='leidenbase 0.1.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1253,7 +1253,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures leidenbase 0.1.0 to adapt to many kinds of systems.
\`configure' configures leidenbase 0.1.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1315,7 +1315,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of leidenbase 0.1.0:";;
short | recursive ) echo "Configuration of leidenbase 0.1.2:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1405,7 +1405,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
leidenbase configure 0.1.0
leidenbase configure 0.1.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2081,7 +2081,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by leidenbase $as_me 0.1.0, which was
It was created by leidenbase $as_me 0.1.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -4935,7 +4935,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by leidenbase $as_me 0.1.0, which was
This file was extended by leidenbase $as_me 0.1.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4988,7 +4988,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
leidenbase config.status 0.1.0
leidenbase config.status 0.1.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dnl We acknowledge Gabor Csardi's work on the R/C igraph
dnl distributions and for making the source code publicly
dnl and freely available.
dnl
AC_INIT([leidenbase], 0.1.0)
AC_INIT([leidenbase], 0.1.2)
AC_CONFIG_SRCDIR(src/leidenFindPartition.cpp)

: ${R_HOME=`R RHOME`}
Expand Down
4 changes: 2 additions & 2 deletions src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PKG_CFLAGS=-I. \
-Icigraph/src/AMD/Include \
-Icigraph/src/COLAMD/Include \
-Icigraph/src/SuiteSparse_config \
@CPPFLAGS@ @CFLAGS@ -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT\
@CPPFLAGS@ @CFLAGS@ -DUSING_R -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT\
-DPACKAGE_VERSION=\"0.8.2\" -DINTERNAL_ARPACK \
-DIGRAPH_THREAD_LOCAL=/**/
PKG_CXXFLAGS= -DIGRAPH_THREAD_LOCAL=/**/ -DNDEBUG \
Expand All @@ -26,7 +26,7 @@ PKG_CXXFLAGS= -DIGRAPH_THREAD_LOCAL=/**/ -DNDEBUG \
-Icigraph/include \
-Icigraph/src/prpack \
-Ileidenalg/include \
-DPRPACK_IGRAPH_SUPPORT
-DUSING_R -DPRPACK_IGRAPH_SUPPORT
PKG_LIBS=@XML2_LIBS@ @GMP_LIBS@ @GLPK_LIBS@ $(FLIBS) $(LAPACK_LIBS) $(BLAS_LIBS)

all: $(SHLIB)
Expand Down
4 changes: 2 additions & 2 deletions src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PKG_CPPFLAGS=-I. \
-Icigraph/src/AMD/Include \
-Icigraph/src/COLAMD/Include \
-Icigraph/src/SuiteSparse_config \
-DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT\
-DUSING_R -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT\
-DPACKAGE_VERSION=\"1.1.2.9000\" -DINTERNAL_ARPACK \
-DIGRAPH_THREAD_LOCAL= \
-DHAVE_GFORTRAN
Expand All @@ -27,7 +27,7 @@ PKG_CXXFLAGS= -DIGRAPH_THREAD_LOCAL= -DNDEBUG \
-Icigraph/include \
-Icigraph/src/prpack \
-Ileidenalg/include \
-DPRPACK_IGRAPH_SUPPORT
-DUSING_R -DPRPACK_IGRAPH_SUPPORT
PKG_LIBS= -liconv -lz -lws2_32 -lgfortran -lquadmath $(BLAS_LIBS) $(LAPACK_LIBS)

all: $(SHLIB)
Expand Down
52 changes: 26 additions & 26 deletions src/cigraph/include/igraph_arpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,34 +222,34 @@ __BEGIN_DECLS

typedef struct igraph_arpack_options_t {
/* INPUT */
char bmat[1]; /* I-standard problem, G-generalized */
int n; /* Dimension of the eigenproblem */
char which[2]; /* LA, SA, LM, SM, BE */
int nev; /* Number of eigenvalues to be computed */
igraph_real_t tol; /* Stopping criterion */
int ncv; /* Number of columns in V */
int ldv; /* Leading dimension of V */
int ishift; /* 0-reverse comm., 1-exact with tridiagonal */
int mxiter; /* Maximum number of update iterations to take */
int nb; /* Block size on the recurrence, only 1 works */
int mode; /* The kind of problem to be solved (1-5)
1: A*x=l*x, A symmetric
2: A*x=l*M*x, A symm. M pos. def.
3: K*x = l*M*x, K symm., M pos. semidef.
4: K*x = l*KG*x, K s. pos. semidef. KG s. indef.
5: A*x = l*M*x, A symm., M symm. pos. semidef. */
int start; /* 0: random, 1: use the supplied vector */
int lworkl; /* Size of temporary storage, default is fine */
igraph_real_t sigma; /* The shift for modes 3,4,5 */
igraph_real_t sigmai; /* The imaginary part of shift for rnsolve */
char bmat[1]; /* I-standard problem, G-generalized */
int n; /* Dimension of the eigenproblem */
char which[2]; /* LA, SA, LM, SM, BE */
int nev; /* Number of eigenvalues to be computed */
igraph_real_t tol; /* Stopping criterion */
int ncv; /* Number of columns in V */
int ldv; /* Leading dimension of V */
int ishift; /* 0-reverse comm., 1-exact with tridiagonal */
int mxiter; /* Maximum number of update iterations to take */
int nb; /* Block size on the recurrence, only 1 works */
int mode; /* The kind of problem to be solved (1-5)
1: A*x=l*x, A symmetric
2: A*x=l*M*x, A symm. M pos. def.
3: K*x = l*M*x, K symm., M pos. semidef.
4: K*x = l*KG*x, K s. pos. semidef. KG s. indef.
5: A*x = l*M*x, A symm., M symm. pos. semidef. */
int start; /* 0: random, 1: use the supplied vector */
int lworkl; /* Size of temporary storage, default is fine */
igraph_real_t sigma; /* The shift for modes 3,4,5 */
igraph_real_t sigmai; /* The imaginary part of shift for rnsolve */
/* OUTPUT */
int info; /* What happened, see docs */
int ierr; /* What happened in the dseupd call */
int noiter; /* The number of iterations taken */
int info; /* What happened, see docs */
int ierr; /* What happened in the dseupd call */
int noiter; /* The number of iterations taken */
int nconv;
int numop; /* Number of OP*x operations */
int numopb; /* Number of B*x operations if BMAT='G' */
int numreo; /* Number of steps of re-orthogonalizations */
int numop; /* Number of OP*x operations */
int numopb; /* Number of B*x operations if BMAT='G' */
int numreo; /* Number of steps of re-orthogonalizations */
/* INTERNAL */
int iparam[11];
int ipntr[14];
Expand Down
1 change: 1 addition & 0 deletions src/cigraph/include/igraph_vector_pmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ DECLDIR void FUNCTION(igraph_vector, remove_section)(TYPE(igraph_vector) *v,
/*-----------*/

DECLDIR void FUNCTION(igraph_vector, sort)(TYPE(igraph_vector) *v);
DECLDIR void FUNCTION(igraph_vector, reverse_sort)(TYPE(igraph_vector) *v);
DECLDIR long int FUNCTION(igraph_vector, qsort_ind)(TYPE(igraph_vector) *v,
igraph_vector_t *inds, igraph_bool_t descending);

Expand Down
2 changes: 1 addition & 1 deletion src/cigraph/include/igraph_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ __BEGIN_DECLS
#define IGRAPH_VERSION_PATCH @PACKAGE_VERSION_PATCH@
#define IGRAPH_VERSION_PRERELEASE "@PACKAGE_VERSION_PRERELEASE@"

int igraph_version(const char **version_string,
DECLDIR int igraph_version(const char **version_string,
int *major,
int *minor,
int *subminor);
Expand Down
56 changes: 33 additions & 23 deletions src/cigraph/src/adjlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,21 +360,27 @@ int igraph_adjlist_simplify(igraph_adjlist_t *al) {

int igraph_adjlist_remove_duplicate(const igraph_t *graph,
igraph_adjlist_t *al) {
long int i;
long int n = al->length;
long int i, j, l, n, p;
igraph_vector_int_t *v;

IGRAPH_UNUSED(graph);

n = al->length;
for (i = 0; i < n; i++) {
igraph_vector_int_t *v = &al->adjs[i];
long int j, p = 1, l = igraph_vector_int_size(v);
for (j = 1; j < l; j++) {
long int e = (long int) VECTOR(*v)[j];
/* Non-loop edges, and one end of loop edges are fine. */
/* We use here, that the vector is sorted and we also keep it sorted */
if (e != i || VECTOR(*v)[j - 1] != e) {
VECTOR(*v)[p++] = e;
v = &al->adjs[i];
l = igraph_vector_int_size(v);
if (l > 0) {
p = 1;
for (j = 1; j < l; j++) {
long int e = (long int) VECTOR(*v)[j];
/* Non-loop edges, and one end of loop edges are fine. */
/* We assume that the vector is sorted and we also keep it sorted */
if (e != i || VECTOR(*v)[j - 1] != e) {
VECTOR(*v)[p++] = e;
}
}
igraph_vector_int_resize(v, p);
}
igraph_vector_int_resize(v, p);
}

return 0;
Expand Down Expand Up @@ -501,21 +507,25 @@ void igraph_adjedgelist_destroy(igraph_inclist_t *il) {

int igraph_inclist_remove_duplicate(const igraph_t *graph,
igraph_inclist_t *al) {
long int i;
long int n = al->length;
long int i, j, l, n, p;
igraph_vector_int_t* v;

n = al->length;
for (i = 0; i < n; i++) {
igraph_vector_int_t *v = &al->incs[i];
long int j, p = 1, l = igraph_vector_int_size(v);
for (j = 1; j < l; j++) {
long int e = (long int) VECTOR(*v)[j];
/* Non-loop edges and one end of loop edges are fine. */
/* We use here, that the vector is sorted and we also keep it sorted */
if (IGRAPH_FROM(graph, e) != IGRAPH_TO(graph, e) ||
VECTOR(*v)[j - 1] != e) {
VECTOR(*v)[p++] = e;
v = &al->incs[i];
l = igraph_vector_int_size(v);
if (l > 0) {
p = 1;
for (j = 1; j < l; j++) {
long int e = (long int) VECTOR(*v)[j];
/* Non-loop edges and one end of loop edges are fine. */
/* We assume that the vector is sorted and we also keep it sorted */
if (VECTOR(*v)[j - 1] != e) {
VECTOR(*v)[p++] = e;
}
}
igraph_vector_int_resize(v, p);
}
igraph_vector_int_resize(v, p);
}

return 0;
Expand Down
Loading

0 comments on commit 8c52ebc

Please sign in to comment.