Skip to content

Commit

Permalink
Replaced more instances of dgCMatrix with CsparseMatrix.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarbo committed Aug 24, 2022
1 parent de2d7dd commit 12171ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Encoding: UTF-8
Type: Package
Package: fastTopics
Version: 0.6-139
Version: 0.6-140
Date: 2022-08-24
Title: Fast Algorithms for Fitting Topic Models and Non-Negative
Matrix Factorizations to Count Data
Expand Down
6 changes: 3 additions & 3 deletions R/datasim.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ simulate_count_data <- function (n, m, k, fmax = 1, lmax = 1, sparse = FALSE) {
L <- rand(n,k,0,lmax)
X <- generate_poisson_nmf_counts(F,L)
if (sparse)
X <- as(X,"dgCMatrix")
X <- as(X,"CsparseMatrix")

# Add row and column names to outputs.
rownames(X) <- paste0("i",1:n)
Expand Down Expand Up @@ -254,7 +254,7 @@ simulate_poisson_gene_data <- function (n, m, k, s, p = 1, sparse = FALSE) {
L <- generate_mixture_proportions(n,k)
X <- generate_poisson_nmf_counts(F,s*L)
if (sparse)
X <- as(X,"dgCMatrix")
X <- as(X,"CsparseMatrix")

# Add row and column names to outputs.
rownames(X) <- paste0("i",1:n)
Expand Down Expand Up @@ -293,7 +293,7 @@ simulate_multinom_gene_data <- function (n, m, k, sparse = FALSE) {
F <- normalize.cols(generate_poisson_rates(m,k))
X <- generate_multinom_topic_model_counts(F,L,s)
if (sparse)
X <- as(X,"dgCMatrix")
X <- as(X,"CsparseMatrix")

# Add row and column names to outputs.
rownames(X) <- paste0("i",1:n)
Expand Down
2 changes: 1 addition & 1 deletion R/fit_poisson_nmf.R
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ fit_poisson_nmf <- function (X, k, fit0, numiter = 100,
method.text <- "CCD"
cat(sprintf("Running %d %s updates, %s extrapolation ",numiter,
method.text,ifelse(control$extrapolate,"with","without")))
cat("(fastTopics 0.6-139).\n")
cat("(fastTopics 0.6-140).\n")
}

# INITIALIZE ESTIMATES
Expand Down

0 comments on commit 12171ed

Please sign in to comment.