Skip to content

Commit

Permalink
Merge pull request #3 from MatveevDaniil/main
Browse files Browse the repository at this point in the history
autoswitching to hashmap version implemented in pattern function in c…
  • Loading branch information
brianpatrickneal authored Feb 15, 2024
2 parents 3725c9d + e8f62e8 commit 7692777
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/argchecks_mid.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
(is.matrix(x) || inherits(x, "sparseMatrix")) &&
isTRUE(dim(x)[[1]] == dim(x)[[2]]) &&
Matrix::isSymmetric(x, check.attributes = FALSE) &&
all(unique(as.vector(x)) %in% c(0, 1))
all(Matrix::Matrix(x, sparse = TRUE)@x %in% c(0, 1))
}
.MUST.isAdjacencyMatrix <- function(x, name = NULL) {
if (is.null(name)) { name <- deparse(substitute(x)) }
Expand Down
3 changes: 3 additions & 0 deletions R/network_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ generateAdjacencyMatrix <- function(
method <- .checkMethod(method, dist_cutoff)
msg <- .makemsg(verbose)
tmpfile <- tempfile(pattern = "col_ids", fileext = ".txt")
if (dist_cutoff == 0) {
method <- "pattern"
}
if (dist_type == "levenshtein") {
msg("Computing network edges based on a max ", dist_type, " distance of ",
dist_cutoff, "...", newline = FALSE
Expand Down

0 comments on commit 7692777

Please sign in to comment.