Skip to content

Commit

Permalink
reformat matrixSums.R file
Browse files Browse the repository at this point in the history
  • Loading branch information
Irisapo committed Apr 2, 2019
1 parent b15c03a commit 12d56f3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions R/matrixSums.R
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
#' @useDynLib celda _rowSumByGroup
.rowSumByGroup <- function(x, group, L) {
group <- factor(group, levels = 1:L)
group <- factor(group, levels = seq(L))
res <- .Call("_rowSumByGroup", x, group)
return(res)
}

#' @useDynLib celda _rowSumByGroupChange
.rowSumByGroupChange <- function(x, px, group, pgroup, L) {
group <- factor(group, levels = 1:L)
pgroup <- factor(pgroup, levels = 1:L)
group <- factor(group, levels = seq(L))
pgroup <- factor(pgroup, levels = seq(L))
res <- .Call("_rowSumByGroupChange", x, px, group, pgroup)
return(res)
}

#' @useDynLib celda _colSumByGroup
.colSumByGroup <- function(x, group, K) {
group <- factor(group, levels = 1:K)
group <- factor(group, levels = seq(K))
res <- .Call("_colSumByGroup", x, group)
return(res)
}

#' @useDynLib celda _colSumByGroupChange
colSumByGroupChange <- function(x, px, group, pgroup, K) {
group <- factor(group, levels = 1:K)
pgroup <- factor(pgroup, levels = 1:K)
.colSumByGroupChange <- function(x, px, group, pgroup, K) {
group <- factor(group, levels = seq(K))
pgroup <- factor(pgroup, levels = seq(K))
res <- .Call("_colSumByGroupChange", x, px, group, pgroup)
return(res)
}


#' @useDynLib celda _rowSumByGroup_numeric
.rowSumByGroup.numeric <- function(x, group, L) {
group <- factor(group, levels = 1:L)
group <- factor(group, levels = seq(L))
res <- .Call("_rowSumByGroup_numeric", x, group)
return(res)
}

#' @useDynLib celda _colSumByGroup_numeric
.colSumByGroup.numeric <- function(x, group, K) {
group <- factor(group, levels = 1:K)
group <- factor(group, levels = seq(K))
res <- .Call("_colSumByGroup_numeric", x, group)
return(res)
}

#' @useDynLib celda _perplexityG
.perplexityG_logPx <- function(x, phi, psi, group, L) {
group <- factor(group, levels = 1:L)
group <- factor(group, levels = seq(L))
res <- .Call("_perplexityG", x, phi, psi, group)
return(res)
}

0 comments on commit 12d56f3

Please sign in to comment.