Skip to content

Commit cd7ad26

Browse files
Copilotkrlmlr
andcommitted
Update make_hypercube() to follow new guidelines
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
1 parent 2799f8d commit cd7ad26

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

R/make.R

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,18 +2030,21 @@ lattice <- function(...) constructor_spec(make_lattice, ...)
20302030

20312031
#' Create a hypercube graph
20322032
#'
2033+
#' `r lifecycle::badge("experimental")`
2034+
#'
20332035
#' The n-dimensional hypercube graph has \eqn{2^n} vertices and
20342036
#' \eqn{2^{n-1} n} edges.
20352037
#' Two vertices are connected if the binary representations of their vertex
20362038
#' IDs (minus one, to make them zero-based) differ in precisely one bit.
20372039
#'
2038-
#' @param n The dimension of the hypercube graph. Must be non-negative and
2039-
#' not greater than 57.
2040+
#' @param n The dimension of the hypercube graph.
2041+
#' Must be non-negative and not greater than 57.
20402042
#' @param directed Logical scalar, whether the graph should be directed.
20412043
#' If `TRUE`, edges point from vertices with lower IDs toward vertices
20422044
#' with higher IDs.
20432045
#' @return An igraph graph.
20442046
#'
2047+
#' @concept hypercube
20452048
#' @family deterministic constructors
20462049
#' @export
20472050
#' @examples
@@ -2051,13 +2054,7 @@ lattice <- function(...) constructor_spec(make_lattice, ...)
20512054
#' print_all(make_hypercube(4))
20522055
#' @cdocs igraph_hypercube
20532056
make_hypercube <- function(n, directed = FALSE) {
2054-
on.exit(.Call(R_igraph_finalizer))
2055-
res <- hypercube_impl(n, directed)
2056-
if (igraph_opt("add.params")) {
2057-
res$name <- "Hypercube graph"
2058-
res$n <- n
2059-
}
2060-
res
2057+
hypercube_impl(n = n, directed = directed)
20612058
}
20622059

20632060
#' @rdname make_hypercube

man/make_circulant.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/make_full_multipartite.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/make_hypercube.Rd

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/make_turan.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)