Skip to content

Commit

Permalink
[cpp][r] SVD on row-major matrix remainder fix #55
Browse files Browse the repository at this point in the history
  • Loading branch information
bnprks committed Nov 15, 2023
1 parent 6597d79 commit 6abe291
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion R/matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -2393,6 +2393,7 @@ setMethod("svds", signature(A="IterableMatrix"), function (A, k, nu = k, nv = k,
k,
solver_params[["ncv"]],
solver_params[["maxitr"]],
solver_params[["tol"]]
solver_params[["tol"]],
A@transpose
)
})
4 changes: 2 additions & 2 deletions src/matrix_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ Eigen::MatrixXd wilcoxon_rank_sum_pval_double_cpp(SEXP matrix, std::vector<uint3
}

// [[Rcpp::export]]
SEXP svds_cpp(SEXP matrix, int k, int n_cv, int maxit, double tol) {
SEXP svds_cpp(SEXP matrix, int k, int n_cv, int maxit, double tol, bool transpose) {
auto mat = take_unique_xptr<MatrixLoader<double>>(matrix);
SVDResult res = run_with_R_interrupt_check(
svd, mat.get(), k, n_cv, maxit, tol
svd, mat.get(), k, n_cv, maxit, tol, transpose
);
if (!res.success) warning("SVD calculation did not converge");
return List::create(
Expand Down

0 comments on commit 6abe291

Please sign in to comment.