diff --git a/NAMESPACE b/NAMESPACE index ab7de4c089e..eb9d481b663 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -91,6 +91,7 @@ export("%<-%") export("%>%") export("%c%") export("%du%") +export("%j%") export("%m%") export("%s%") export("%u%") @@ -471,6 +472,7 @@ export(graph_from_isomorphism_class) export(graph_from_lcf) export(graph_from_literal) export(graph_id) +export(graph_join) export(graph_version) export(graphlet_basis) export(graphlet_proj) diff --git a/R/operators.R b/R/operators.R index 2a58a86ca00..9df4b057c90 100644 --- a/R/operators.R +++ b/R/operators.R @@ -302,6 +302,67 @@ disjoint_union <- function(...) { disjoint_union(x, y) } +#' Join of two graphs +#' +#' `r lifecycle::badge("experimental")` +#' +#' The join of two graphs is created by connecting all vertices from +#' the first graph to all vertices in the second graph. +#' +#' `graph_join()` creates the join of two graphs. The graphs must be disjoint, +#' i.e., have distinct vertex sets. First the vertices of the second graph will +#' be relabeled with new vertex IDs, then the union of the two graphs is formed. +#' Finally, all vertices from the first graph will be connected to all vertices +#' from the second graph. If the two graphs have \eqn{|V_1|} and \eqn{|V_2|} vertices and +#' \eqn{|E_1|} and \eqn{|E_2|} edges respectively, then the new graph will have \eqn{|V_1|+|V_2|} +#' vertices and \eqn{|E_1|+|E_2|+|V_1| \times |V_2|} edges. This function can also be used via +#' the `%j%` operator. +#' +#' The vertex ordering of the graphs is preserved. In other words, the vertex +#' IDs of the first graph map to identical values in the new graph, while the +#' vertex IDs of the second graph map to IDs incremented by the vertex count +#' of the first graph. +#' +#' Both graphs need to have the same directedness, i.e. either both directed or +#' both undirected. If both graphs are directed, then for each pair of vertices +#' \eqn{v}, \eqn{u} in graphs \eqn{G_1}, \eqn{G_2} we add edges \eqn{(v, u)} and \eqn{(u, v)} to maintain completeness. +#' +#' Note that the current version of this function cannot handle graph, vertex +#' and edge attributes; they will be lost in the result. +#' +#' An error is generated if some input graphs are directed and others are +#' undirected. +#' +#' @aliases %j% +#' @param g1,g2 Graph objects. +#' @param x,y Graph objects. +#' @return A new graph object. +#' @author Gabor Csardi \email{csardi.gabor@@gmail.com} +#' @export +#' @keywords graphs +#' @concept graph_operators +#' @family functions for manipulating graph structure +#' @examples +#' +#' ## A star and a ring +#' g1 <- make_star(10, mode = "undirected") +#' g2 <- make_ring(5) +#' print_all(g1 %j% g2) +#' @export +#' @cdocs igraph_join +graph_join <- function(g1, g2) { + ensure_igraph(g1) + ensure_igraph(g2) + + join_impl(left = g1, right = g2) +} + +#' @export +#' @rdname graph_join +"%j%" <- function(x, y) { + graph_join(x, y) +} + .igraph.graph.union.or.intersection <- function( call, ..., diff --git a/man/add_edges.Rd b/man/add_edges.Rd index 1dd4efc7f3a..a7871920a37 100644 --- a/man/add_edges.Rd +++ b/man/add_edges.Rd @@ -60,6 +60,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/add_vertices.Rd b/man/add_vertices.Rd index 06b61187877..19443f04f57 100644 --- a/man/add_vertices.Rd +++ b/man/add_vertices.Rd @@ -55,6 +55,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/complementer.Rd b/man/complementer.Rd index 5b3ef9b06fd..67a81485751 100644 --- a/man/complementer.Rd +++ b/man/complementer.Rd @@ -54,6 +54,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/compose.Rd b/man/compose.Rd index bcefd04e217..c915f3e71cf 100644 --- a/man/compose.Rd +++ b/man/compose.Rd @@ -84,6 +84,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/contract.Rd b/man/contract.Rd index 5f2c561b467..cbefaec391f 100644 --- a/man/contract.Rd +++ b/man/contract.Rd @@ -58,6 +58,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/delete_edges.Rd b/man/delete_edges.Rd index 862be149fef..82b92a23e12 100644 --- a/man/delete_edges.Rd +++ b/man/delete_edges.Rd @@ -47,6 +47,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/delete_vertices.Rd b/man/delete_vertices.Rd index b21361a1975..4328d098480 100644 --- a/man/delete_vertices.Rd +++ b/man/delete_vertices.Rd @@ -42,6 +42,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/difference.Rd b/man/difference.Rd index 71ca15b607e..112a702848a 100644 --- a/man/difference.Rd +++ b/man/difference.Rd @@ -35,6 +35,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/difference.igraph.Rd b/man/difference.igraph.Rd index 129b86b4d50..2847e946b83 100644 --- a/man/difference.igraph.Rd +++ b/man/difference.igraph.Rd @@ -73,6 +73,7 @@ Other functions for manipulating graph structure: \code{\link{difference}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/disjoint_union.Rd b/man/disjoint_union.Rd index ef4b90aa2ee..d61f23ab792 100644 --- a/man/disjoint_union.Rd +++ b/man/disjoint_union.Rd @@ -65,6 +65,7 @@ Other functions for manipulating graph structure: \code{\link{difference}()}, \code{\link{difference.igraph}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/edge.Rd b/man/edge.Rd index ed57091dccb..ac504febe4a 100644 --- a/man/edge.Rd +++ b/man/edge.Rd @@ -64,6 +64,7 @@ Other functions for manipulating graph structure: \code{\link{difference}()}, \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/ego.Rd b/man/ego.Rd index 66039cec73d..616862a879f 100644 --- a/man/ego.Rd +++ b/man/ego.Rd @@ -163,6 +163,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/graph_join.Rd b/man/graph_join.Rd new file mode 100644 index 00000000000..fd96968bd08 --- /dev/null +++ b/man/graph_join.Rd @@ -0,0 +1,93 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/operators.R +\name{graph_join} +\alias{graph_join} +\alias{\%j\%} +\title{Join of two graphs} +\usage{ +graph_join(g1, g2) + +x \%j\% y +} +\arguments{ +\item{g1, g2}{Graph objects.} + +\item{x, y}{Graph objects.} +} +\value{ +A new graph object. +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} +} +\details{ +The join of two graphs is created by connecting all vertices from +the first graph to all vertices in the second graph. + +\code{graph_join()} creates the join of two graphs. The graphs must be disjoint, +i.e., have distinct vertex sets. First the vertices of the second graph will +be relabeled with new vertex IDs, then the union of the two graphs is formed. +Finally, all vertices from the first graph will be connected to all vertices +from the second graph. If the two graphs have \eqn{|V_1|} and \eqn{|V_2|} vertices and +\eqn{|E_1|} and \eqn{|E_2|} edges respectively, then the new graph will have \eqn{|V_1|+|V_2|} +vertices and \eqn{|E_1|+|E_2|+|V_1| \times |V_2|} edges. This function can also be used via +the \verb{\%j\%} operator. + +The vertex ordering of the graphs is preserved. In other words, the vertex +IDs of the first graph map to identical values in the new graph, while the +vertex IDs of the second graph map to IDs incremented by the vertex count +of the first graph. + +Both graphs need to have the same directedness, i.e. either both directed or +both undirected. If both graphs are directed, then for each pair of vertices +\eqn{v}, \eqn{u} in graphs \eqn{G_1}, \eqn{G_2} we add edges \eqn{(v, u)} and \eqn{(u, v)} to maintain completeness. + +Note that the current version of this function cannot handle graph, vertex +and edge attributes; they will be lost in the result. + +An error is generated if some input graphs are directed and others are +undirected. +} +\examples{ + +## A star and a ring +g1 <- make_star(10, mode = "undirected") +g2 <- make_ring(5) +print_all(g1 \%j\% g2) +} +\seealso{ +Other functions for manipulating graph structure: +\code{\link{+.igraph}()}, +\code{\link{add_edges}()}, +\code{\link{add_vertices}()}, +\code{\link{complementer}()}, +\code{\link{compose}()}, +\code{\link{connect}()}, +\code{\link{contract}()}, +\code{\link{delete_edges}()}, +\code{\link{delete_vertices}()}, +\code{\link{difference}()}, +\code{\link{difference.igraph}()}, +\code{\link{disjoint_union}()}, +\code{\link{edge}()}, +\code{\link{igraph-minus}}, +\code{\link{intersection}()}, +\code{\link{intersection.igraph}()}, +\code{\link{path}()}, +\code{\link{permute}()}, +\code{\link{rep.igraph}()}, +\code{\link{reverse_edges}()}, +\code{\link{simplify}()}, +\code{\link{transitive_closure}()}, +\code{\link{union}()}, +\code{\link{union.igraph}()}, +\code{\link{vertex}()} +} +\author{ +Gabor Csardi \email{csardi.gabor@gmail.com} +} +\concept{functions for manipulating graph structure} +\concept{graph_operators} +\keyword{graphs} +\section{Related documentation in the C library}{\href{https://igraph.org/c/html/latest/igraph-Operators.html#igraph_join}{\code{join()}}.} + diff --git a/man/igraph-minus.Rd b/man/igraph-minus.Rd index 663c4f255a4..7286596a6c4 100644 --- a/man/igraph-minus.Rd +++ b/man/igraph-minus.Rd @@ -71,6 +71,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, \code{\link{path}()}, diff --git a/man/intersection.Rd b/man/intersection.Rd index 795c3ca88b2..7b507283a3a 100644 --- a/man/intersection.Rd +++ b/man/intersection.Rd @@ -36,6 +36,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection.igraph}()}, \code{\link{path}()}, diff --git a/man/intersection.igraph.Rd b/man/intersection.igraph.Rd index 5f87df0a316..17c5f7f5d28 100644 --- a/man/intersection.igraph.Rd +++ b/man/intersection.igraph.Rd @@ -72,6 +72,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{path}()}, diff --git a/man/path.Rd b/man/path.Rd index 0c13a5f94be..bf1dba6602a 100644 --- a/man/path.Rd +++ b/man/path.Rd @@ -59,6 +59,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/permute.Rd b/man/permute.Rd index cfb42733418..ce6745ba86a 100644 --- a/man/permute.Rd +++ b/man/permute.Rd @@ -62,6 +62,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/plus-.igraph.Rd b/man/plus-.igraph.Rd index eb1f65b141d..ba38a2457f7 100644 --- a/man/plus-.igraph.Rd +++ b/man/plus-.igraph.Rd @@ -115,6 +115,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/rep.igraph.Rd b/man/rep.igraph.Rd index 958ccaebdbe..a3e99de320f 100644 --- a/man/rep.igraph.Rd +++ b/man/rep.igraph.Rd @@ -43,6 +43,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/reverse_edges.Rd b/man/reverse_edges.Rd index bc71af9cded..d0b6d874290 100644 --- a/man/reverse_edges.Rd +++ b/man/reverse_edges.Rd @@ -46,6 +46,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/simplify.Rd b/man/simplify.Rd index 93a2ced2ceb..b4a171542d0 100644 --- a/man/simplify.Rd +++ b/man/simplify.Rd @@ -85,6 +85,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/transitive_closure.Rd b/man/transitive_closure.Rd index 01461959e4d..7b02ee54ae7 100644 --- a/man/transitive_closure.Rd +++ b/man/transitive_closure.Rd @@ -60,6 +60,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/union.Rd b/man/union.Rd index eeda392e3b4..10ff4bfd2fc 100644 --- a/man/union.Rd +++ b/man/union.Rd @@ -36,6 +36,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/union.igraph.Rd b/man/union.igraph.Rd index 750a4a904cd..cd359f2deea 100644 --- a/man/union.igraph.Rd +++ b/man/union.igraph.Rd @@ -69,6 +69,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/man/vertex.Rd b/man/vertex.Rd index 56add28973a..9b9800c4e56 100644 --- a/man/vertex.Rd +++ b/man/vertex.Rd @@ -52,6 +52,7 @@ Other functions for manipulating graph structure: \code{\link{difference.igraph}()}, \code{\link{disjoint_union}()}, \code{\link{edge}()}, +\code{\link{graph_join}()}, \code{\link{igraph-minus}}, \code{\link{intersection}()}, \code{\link{intersection.igraph}()}, diff --git a/src/cpp11.dd b/src/cpp11.dd index 9abbae1fcad..3eb6766ac81 100644 --- a/src/cpp11.dd +++ b/src/cpp11.dd @@ -2,3 +2,255 @@ cpp11.o: \ cpp11.cpp \ igraph_types.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/R.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/altrep.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/as.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/attribute_proxy.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/data_frame.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/declarations.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/doubles.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/environment.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/external_pointer.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/function.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/integers.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/list.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/list_of.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/logicals.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/matrix.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/named_arg.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/protect.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/r_bool.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/r_string.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/r_vector.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/raws.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/sexp.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/strings.hpp \ + /opt/R/4.5.2/lib/R/include/R_ext/Arith.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Boolean.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Complex.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Error.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Memory.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Print.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Rdynload.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Utils.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Visibility.h \ + /opt/R/4.5.2/lib/R/include/R_ext/libextern.h \ + /opt/R/4.5.2/lib/R/include/Rconfig.h \ + /opt/R/4.5.2/lib/R/include/Rinternals.h \ + /opt/R/4.5.2/lib/R/include/Rversion.h \ + /usr/include/asm-generic/errno.h \ + /usr/include/c++/13/algorithm \ + /usr/include/c++/13/backward/auto_ptr.h \ + /usr/include/c++/13/backward/binders.h \ + /usr/include/c++/13/bits/algorithmfwd.h \ + /usr/include/c++/13/bits/align.h \ + /usr/include/c++/13/bits/alloc_traits.h \ + /usr/include/c++/13/bits/allocated_ptr.h \ + /usr/include/c++/13/bits/allocator.h \ + /usr/include/c++/13/bits/atomic_base.h \ + /usr/include/c++/13/bits/atomic_lockfree_defines.h \ + /usr/include/c++/13/bits/basic_ios.h \ + /usr/include/c++/13/bits/basic_ios.tcc \ + /usr/include/c++/13/bits/basic_string.h \ + /usr/include/c++/13/bits/basic_string.tcc \ + /usr/include/c++/13/bits/char_traits.h \ + /usr/include/c++/13/bits/charconv.h \ + /usr/include/c++/13/bits/concept_check.h \ + /usr/include/c++/13/bits/cpp_type_traits.h \ + /usr/include/c++/13/bits/cxxabi_forced.h \ + /usr/include/c++/13/bits/cxxabi_init_exception.h \ + /usr/include/c++/13/bits/exception.h \ + /usr/include/c++/13/bits/exception_defines.h \ + /usr/include/c++/13/bits/exception_ptr.h \ + /usr/include/c++/13/bits/functexcept.h \ + /usr/include/c++/13/bits/functional_hash.h \ + /usr/include/c++/13/bits/hash_bytes.h \ + /usr/include/c++/13/bits/locale_classes.h \ + /usr/include/c++/13/bits/locale_classes.tcc \ + /usr/include/c++/13/bits/locale_facets.h \ + /usr/include/c++/13/bits/locale_facets.tcc \ + /usr/include/c++/13/bits/localefwd.h \ + /usr/include/c++/13/bits/memory_resource.h \ + /usr/include/c++/13/bits/memoryfwd.h \ + /usr/include/c++/13/bits/move.h \ + /usr/include/c++/13/bits/nested_exception.h \ + /usr/include/c++/13/bits/new_allocator.h \ + /usr/include/c++/13/bits/ostream.tcc \ + /usr/include/c++/13/bits/ostream_insert.h \ + /usr/include/c++/13/bits/postypes.h \ + /usr/include/c++/13/bits/predefined_ops.h \ + /usr/include/c++/13/bits/ptr_traits.h \ + /usr/include/c++/13/bits/range_access.h \ + /usr/include/c++/13/bits/refwrap.h \ + /usr/include/c++/13/bits/requires_hosted.h \ + /usr/include/c++/13/bits/shared_ptr.h \ + /usr/include/c++/13/bits/shared_ptr_atomic.h \ + /usr/include/c++/13/bits/shared_ptr_base.h \ + /usr/include/c++/13/bits/specfun.h \ + /usr/include/c++/13/bits/std_abs.h \ + /usr/include/c++/13/bits/stl_algobase.h \ + /usr/include/c++/13/bits/stl_bvector.h \ + /usr/include/c++/13/bits/stl_construct.h \ + /usr/include/c++/13/bits/stl_function.h \ + /usr/include/c++/13/bits/stl_heap.h \ + /usr/include/c++/13/bits/stl_iterator.h \ + /usr/include/c++/13/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/13/bits/stl_iterator_base_types.h \ + /usr/include/c++/13/bits/stl_pair.h \ + /usr/include/c++/13/bits/stl_raw_storage_iter.h \ + /usr/include/c++/13/bits/stl_vector.h \ + /usr/include/c++/13/bits/stream_iterator.h \ + /usr/include/c++/13/bits/streambuf.tcc \ + /usr/include/c++/13/bits/streambuf_iterator.h \ + /usr/include/c++/13/bits/string_view.tcc \ + /usr/include/c++/13/bits/uniform_int_dist.h \ + /usr/include/c++/13/bits/uses_allocator.h \ + /usr/include/c++/13/bits/uses_allocator_args.h \ + /usr/include/c++/13/bits/vector.tcc \ + /usr/include/c++/13/cctype \ + /usr/include/c++/13/clocale \ + /usr/include/c++/13/compare \ + /usr/include/c++/13/csetjmp \ + /usr/include/c++/13/cstdint \ + /usr/include/c++/13/cstdio \ + /usr/include/c++/13/cstring \ + /usr/include/c++/13/debug/assertions.h \ + /usr/include/c++/13/ext/aligned_buffer.h \ + /usr/include/c++/13/ext/alloc_traits.h \ + /usr/include/c++/13/ext/atomicity.h \ + /usr/include/c++/13/ext/concurrence.h \ + /usr/include/c++/13/ext/numeric_traits.h \ + /usr/include/c++/13/ext/string_conversions.h \ + /usr/include/c++/13/ext/type_traits.h \ + /usr/include/c++/13/initializer_list \ + /usr/include/c++/13/limits \ + /usr/include/c++/13/math.h \ + /usr/include/c++/13/memory \ + /usr/include/c++/13/ostream \ + /usr/include/c++/13/pstl/execution_defs.h \ + /usr/include/c++/13/pstl/glue_algorithm_defs.h \ + /usr/include/c++/13/pstl/glue_memory_defs.h \ + /usr/include/c++/13/pstl/pstl_config.h \ + /usr/include/c++/13/streambuf \ + /usr/include/c++/13/string \ + /usr/include/c++/13/system_error \ + /usr/include/c++/13/tr1/bessel_function.tcc \ + /usr/include/c++/13/tr1/beta_function.tcc \ + /usr/include/c++/13/tr1/ell_integral.tcc \ + /usr/include/c++/13/tr1/exp_integral.tcc \ + /usr/include/c++/13/tr1/hypergeometric.tcc \ + /usr/include/c++/13/tr1/legendre_function.tcc \ + /usr/include/c++/13/tr1/modified_bessel_func.tcc \ + /usr/include/c++/13/tr1/poly_hermite.tcc \ + /usr/include/c++/13/tr1/poly_laguerre.tcc \ + /usr/include/c++/13/tr1/riemann_zeta.tcc \ + /usr/include/c++/13/tr1/special_function_util.h \ + /usr/include/c++/13/utility \ + /usr/include/c++/13/vector \ + /usr/include/errno.h \ + /usr/include/features-time64.h \ + /usr/include/inttypes.h \ + /usr/include/limits.h \ + /usr/include/linux/errno.h \ + /usr/include/linux/limits.h \ + /usr/include/pthread.h \ + /usr/include/wchar.h \ + /usr/include/wctype.h \ + /usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/cpu-set.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endianness.h \ + /usr/include/x86_64-linux-gnu/bits/floatn-common.h \ + /usr/include/x86_64-linux-gnu/bits/floatn.h \ + /usr/include/x86_64-linux-gnu/bits/flt-eval-method.h \ + /usr/include/x86_64-linux-gnu/bits/fp-fast.h \ + /usr/include/x86_64-linux-gnu/bits/fp-logb.h \ + /usr/include/x86_64-linux-gnu/bits/iscanonical.h \ + /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h \ + /usr/include/x86_64-linux-gnu/bits/long-double.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-least.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \ + /usr/include/x86_64-linux-gnu/bits/struct_mutex.h \ + /usr/include/x86_64-linux-gnu/bits/struct_rwlock.h \ + /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/time64.h \ + /usr/include/x86_64-linux-gnu/bits/timesize.h \ + /usr/include/x86_64-linux-gnu/bits/timex.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/types/FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/error_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_sched_param.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \ + /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ + /usr/include/x86_64-linux-gnu/bits/uio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/atomic_word.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/c++allocator.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/c++locale.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/cpu_defines.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/ctype_base.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/ctype_inline.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/error_constants.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/gthr-default.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/gthr.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/os_defines.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/sys/single_threaded.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/stdarg.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/stdbool.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/stdint.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/syslimits.h \ + vendor/cigraph/include/igraph_decls.h \ + vendor/cigraph/include/igraph_types.h \ + vendor/igraph_config.h \ diff --git a/src/rinterface.dd b/src/rinterface.dd index 4e60bfc2463..81e02afe963 100644 --- a/src/rinterface.dd +++ b/src/rinterface.dd @@ -2,3 +2,111 @@ rinterface.o: \ rinterface.c \ rinterface.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Arith.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Boolean.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Complex.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Constants.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Error.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Memory.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Print.h \ + /opt/R/4.5.2/lib/R/include/R_ext/RS.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Random.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Rdynload.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Utils.h \ + /opt/R/4.5.2/lib/R/include/R_ext/libextern.h \ + /opt/R/4.5.2/lib/R/include/Rconfig.h \ + /opt/R/4.5.2/lib/R/include/Rdefines.h \ + /opt/R/4.5.2/lib/R/include/Rinternals.h \ + vendor/cigraph/include/igraph_adjlist.h \ + vendor/cigraph/include/igraph_arpack.h \ + vendor/cigraph/include/igraph_array.h \ + vendor/cigraph/include/igraph_array_pmt.h \ + vendor/cigraph/include/igraph_attributes.h \ + vendor/cigraph/include/igraph_attributes.h \ + vendor/cigraph/include/igraph_bipartite.h \ + vendor/cigraph/include/igraph_bitset.h \ + vendor/cigraph/include/igraph_bitset_list.h \ + vendor/cigraph/include/igraph_blas.h \ + vendor/cigraph/include/igraph_centrality.h \ + vendor/cigraph/include/igraph_cliques.h \ + vendor/cigraph/include/igraph_cocitation.h \ + vendor/cigraph/include/igraph_cohesive_blocks.h \ + vendor/cigraph/include/igraph_coloring.h \ + vendor/cigraph/include/igraph_community.h \ + vendor/cigraph/include/igraph_complex.h \ + vendor/cigraph/include/igraph_components.h \ + vendor/cigraph/include/igraph_constants.h \ + vendor/cigraph/include/igraph_constants.h \ + vendor/cigraph/include/igraph_constructors.h \ + vendor/cigraph/include/igraph_conversion.h \ + vendor/cigraph/include/igraph_cycles.h \ + vendor/cigraph/include/igraph_datatype.h \ + vendor/cigraph/include/igraph_datatype.h \ + vendor/cigraph/include/igraph_decls.h \ + vendor/cigraph/include/igraph_dqueue.h \ + vendor/cigraph/include/igraph_dqueue_pmt.h \ + vendor/cigraph/include/igraph_eigen.h \ + vendor/cigraph/include/igraph_embedding.h \ + vendor/cigraph/include/igraph_epidemics.h \ + vendor/cigraph/include/igraph_error.h \ + vendor/cigraph/include/igraph_error.h \ + vendor/cigraph/include/igraph_eulerian.h \ + vendor/cigraph/include/igraph_flow.h \ + vendor/cigraph/include/igraph_foreign.h \ + vendor/cigraph/include/igraph_games.h \ + vendor/cigraph/include/igraph_graph_list.h \ + vendor/cigraph/include/igraph_graphicality.h \ + vendor/cigraph/include/igraph_graphlets.h \ + vendor/cigraph/include/igraph_heap.h \ + vendor/cigraph/include/igraph_heap_pmt.h \ + vendor/cigraph/include/igraph_hrg.h \ + vendor/cigraph/include/igraph_interface.h \ + vendor/cigraph/include/igraph_interrupt.h \ + vendor/cigraph/include/igraph_iterators.h \ + vendor/cigraph/include/igraph_lapack.h \ + vendor/cigraph/include/igraph_layout.h \ + vendor/cigraph/include/igraph_lsap.h \ + vendor/cigraph/include/igraph_matching.h \ + vendor/cigraph/include/igraph_matrix.h \ + vendor/cigraph/include/igraph_matrix_list.h \ + vendor/cigraph/include/igraph_matrix_pmt.h \ + vendor/cigraph/include/igraph_microscopic_update.h \ + vendor/cigraph/include/igraph_mixing.h \ + vendor/cigraph/include/igraph_motifs.h \ + vendor/cigraph/include/igraph_neighborhood.h \ + vendor/cigraph/include/igraph_nongraph.h \ + vendor/cigraph/include/igraph_operators.h \ + vendor/cigraph/include/igraph_paths.h \ + vendor/cigraph/include/igraph_pmt.h \ + vendor/cigraph/include/igraph_pmt_off.h \ + vendor/cigraph/include/igraph_progress.h \ + vendor/cigraph/include/igraph_psumtree.h \ + vendor/cigraph/include/igraph_qsort.h \ + vendor/cigraph/include/igraph_random.h \ + vendor/cigraph/include/igraph_reachability.h \ + vendor/cigraph/include/igraph_scan.h \ + vendor/cigraph/include/igraph_separators.h \ + vendor/cigraph/include/igraph_sparsemat.h \ + vendor/cigraph/include/igraph_stack.h \ + vendor/cigraph/include/igraph_stack_pmt.h \ + vendor/cigraph/include/igraph_statusbar.h \ + vendor/cigraph/include/igraph_structural.h \ + vendor/cigraph/include/igraph_strvector.h \ + vendor/cigraph/include/igraph_strvector.h \ + vendor/cigraph/include/igraph_topology.h \ + vendor/cigraph/include/igraph_transitivity.h \ + vendor/cigraph/include/igraph_typed_list_pmt.h \ + vendor/cigraph/include/igraph_types.h \ + vendor/cigraph/include/igraph_types.h \ + vendor/cigraph/include/igraph_vector.h \ + vendor/cigraph/include/igraph_vector.h \ + vendor/cigraph/include/igraph_vector_list.h \ + vendor/cigraph/include/igraph_vector_pmt.h \ + vendor/cigraph/include/igraph_vector_ptr.h \ + vendor/cigraph/include/igraph_vector_type.h \ + vendor/cigraph/include/igraph_visitor.h \ + vendor/cigraph/src/graph/attributes.h \ + vendor/cigraph/src/graph/internal.h \ + vendor/igraph_config.h \ + vendor/igraph_export.h \ + vendor/igraph_version.h \ diff --git a/src/rinterface_extra.dd b/src/rinterface_extra.dd index 8abe00ad47b..ce88125123e 100644 --- a/src/rinterface_extra.dd +++ b/src/rinterface_extra.dd @@ -3,3 +3,114 @@ rinterface_extra.o: \ rinterface.h \ rinterface_extra.c \ rrandom.h \ + /opt/R/4.5.2/lib/R/include/R.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Altrep.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Arith.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Boolean.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Complex.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Constants.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Error.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Memory.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Print.h \ + /opt/R/4.5.2/lib/R/include/R_ext/RS.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Random.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Rdynload.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Utils.h \ + /opt/R/4.5.2/lib/R/include/R_ext/Visibility.h \ + /opt/R/4.5.2/lib/R/include/R_ext/libextern.h \ + /opt/R/4.5.2/lib/R/include/Rdefines.h \ + /opt/R/4.5.2/lib/R/include/Rinternals.h \ + /opt/R/4.5.2/lib/R/include/Rversion.h \ + vendor/cigraph/include/igraph_adjlist.h \ + vendor/cigraph/include/igraph_arpack.h \ + vendor/cigraph/include/igraph_array.h \ + vendor/cigraph/include/igraph_array_pmt.h \ + vendor/cigraph/include/igraph_attributes.h \ + vendor/cigraph/include/igraph_attributes.h \ + vendor/cigraph/include/igraph_bipartite.h \ + vendor/cigraph/include/igraph_bitset.h \ + vendor/cigraph/include/igraph_bitset_list.h \ + vendor/cigraph/include/igraph_blas.h \ + vendor/cigraph/include/igraph_centrality.h \ + vendor/cigraph/include/igraph_cliques.h \ + vendor/cigraph/include/igraph_cocitation.h \ + vendor/cigraph/include/igraph_cohesive_blocks.h \ + vendor/cigraph/include/igraph_coloring.h \ + vendor/cigraph/include/igraph_community.h \ + vendor/cigraph/include/igraph_complex.h \ + vendor/cigraph/include/igraph_components.h \ + vendor/cigraph/include/igraph_constants.h \ + vendor/cigraph/include/igraph_constants.h \ + vendor/cigraph/include/igraph_constructors.h \ + vendor/cigraph/include/igraph_conversion.h \ + vendor/cigraph/include/igraph_cycles.h \ + vendor/cigraph/include/igraph_datatype.h \ + vendor/cigraph/include/igraph_datatype.h \ + vendor/cigraph/include/igraph_decls.h \ + vendor/cigraph/include/igraph_dqueue.h \ + vendor/cigraph/include/igraph_dqueue_pmt.h \ + vendor/cigraph/include/igraph_eigen.h \ + vendor/cigraph/include/igraph_embedding.h \ + vendor/cigraph/include/igraph_epidemics.h \ + vendor/cigraph/include/igraph_error.h \ + vendor/cigraph/include/igraph_error.h \ + vendor/cigraph/include/igraph_eulerian.h \ + vendor/cigraph/include/igraph_flow.h \ + vendor/cigraph/include/igraph_foreign.h \ + vendor/cigraph/include/igraph_games.h \ + vendor/cigraph/include/igraph_graph_list.h \ + vendor/cigraph/include/igraph_graphicality.h \ + vendor/cigraph/include/igraph_graphlets.h \ + vendor/cigraph/include/igraph_heap.h \ + vendor/cigraph/include/igraph_heap_pmt.h \ + vendor/cigraph/include/igraph_hrg.h \ + vendor/cigraph/include/igraph_interface.h \ + vendor/cigraph/include/igraph_interrupt.h \ + vendor/cigraph/include/igraph_iterators.h \ + vendor/cigraph/include/igraph_lapack.h \ + vendor/cigraph/include/igraph_layout.h \ + vendor/cigraph/include/igraph_lsap.h \ + vendor/cigraph/include/igraph_matching.h \ + vendor/cigraph/include/igraph_matrix.h \ + vendor/cigraph/include/igraph_matrix_list.h \ + vendor/cigraph/include/igraph_matrix_pmt.h \ + vendor/cigraph/include/igraph_microscopic_update.h \ + vendor/cigraph/include/igraph_mixing.h \ + vendor/cigraph/include/igraph_motifs.h \ + vendor/cigraph/include/igraph_neighborhood.h \ + vendor/cigraph/include/igraph_nongraph.h \ + vendor/cigraph/include/igraph_operators.h \ + vendor/cigraph/include/igraph_paths.h \ + vendor/cigraph/include/igraph_pmt.h \ + vendor/cigraph/include/igraph_pmt_off.h \ + vendor/cigraph/include/igraph_progress.h \ + vendor/cigraph/include/igraph_psumtree.h \ + vendor/cigraph/include/igraph_qsort.h \ + vendor/cigraph/include/igraph_random.h \ + vendor/cigraph/include/igraph_reachability.h \ + vendor/cigraph/include/igraph_scan.h \ + vendor/cigraph/include/igraph_separators.h \ + vendor/cigraph/include/igraph_sparsemat.h \ + vendor/cigraph/include/igraph_stack.h \ + vendor/cigraph/include/igraph_stack_pmt.h \ + vendor/cigraph/include/igraph_statusbar.h \ + vendor/cigraph/include/igraph_structural.h \ + vendor/cigraph/include/igraph_strvector.h \ + vendor/cigraph/include/igraph_strvector.h \ + vendor/cigraph/include/igraph_topology.h \ + vendor/cigraph/include/igraph_transitivity.h \ + vendor/cigraph/include/igraph_typed_list_pmt.h \ + vendor/cigraph/include/igraph_types.h \ + vendor/cigraph/include/igraph_types.h \ + vendor/cigraph/include/igraph_vector.h \ + vendor/cigraph/include/igraph_vector.h \ + vendor/cigraph/include/igraph_vector_list.h \ + vendor/cigraph/include/igraph_vector_pmt.h \ + vendor/cigraph/include/igraph_vector_ptr.h \ + vendor/cigraph/include/igraph_vector_type.h \ + vendor/cigraph/include/igraph_visitor.h \ + vendor/cigraph/src/graph/attributes.h \ + vendor/cigraph/src/graph/internal.h \ + vendor/igraph_config.h \ + vendor/igraph_export.h \ + vendor/igraph_version.h \ diff --git a/tests/testthat/test-operators.R b/tests/testthat/test-operators.R index d38e3ae5a1a..503555a2a95 100644 --- a/tests/testthat/test-operators.R +++ b/tests/testthat/test-operators.R @@ -66,6 +66,64 @@ test_that("disjoint_union() does not convert vertex types", { expect_s3_class(vertex_attr(u, "date"), c("POSIXct", "POSIXt")) }) +test_that("graph_join() works", { + # Test basic join of undirected graphs + g1 <- make_ring(5) + g2 <- make_ring(3) + gj <- graph_join(g1, g2) + + # Check vertex and edge counts + expect_vcount(gj, 8) # 5 + 3 + expect_ecount(gj, 23) # 5 + 3 + 5*3 = 23 + + # Check that original edges are preserved + # Edges from g1 should be 1-2, 2-3, 3-4, 4-5, 5-1 + # Edges from g2 should be 6-7, 7-8, 8-6 (shifted by vcount(g1)=5) + # Plus all cross edges between vertices 1-5 and vertices 6-8 + + # Test with operator + gj2 <- g1 %j% g2 + expect_equal(vcount(gj2), 8) + expect_equal(ecount(gj2), 23) + + # Test directed graphs + g1_dir <- make_ring(4, directed = TRUE) + g2_dir <- make_ring(3, directed = TRUE) + gj_dir <- graph_join(g1_dir, g2_dir) + + expect_vcount(gj_dir, 7) # 4 + 3 + # For directed: original edges + 2 * v1 * v2 = 4 + 3 + 2*4*3 = 31 + expect_ecount(gj_dir, 31) + + # Test mixed directedness should error + expect_error( + graph_join(g1, g1_dir), + "Cannot create join" + ) +}) + +test_that("graph_join() preserves vertex ordering", { + g1 <- make_ring(3) + g2 <- make_ring(2) + + gj <- graph_join(g1, g2) + + # Check that edges from g1 are preserved + el1 <- as_edgelist(g1) + el_joined <- as_edgelist(gj) + + # First graph edges should be in the result + expect_true(all(apply(el1, 1, function(row) { + any(apply(el_joined, 1, function(r) all(r == row))) + }))) + + # Second graph edges should be shifted by vcount(g1) + el2_shifted <- as_edgelist(g2) + vcount(g1) + expect_true(all(apply(el2_shifted, 1, function(row) { + any(apply(el_joined, 1, function(r) all(r == row))) + }))) +}) + test_that("intersection() works", { g1 <- make_ring(10) g2 <- make_star(11, center = 11, mode = "undirected")