forked from wrathematics/coop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for dgCMatrix from the Matrix package
- Loading branch information
1 parent
adc720f
commit c9fe174
Showing
7 changed files
with
112 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
co_sparse <- function(x, y, type) | ||
co_sparse <- function(n, a, i, j, index, type) | ||
{ | ||
if (!missing(y)) | ||
stop("argument 'y' can not be used with a matrix 'x'") | ||
|
||
a <- x$v | ||
i <- x$i | ||
j <- x$j | ||
n <- as.integer(x$ncol) | ||
|
||
if (length(a) != length(i) || length(i) != length(j)) | ||
stop("Malformed simple_triplet_matrix: lengths of 'v', 'i', and 'j' do not agree") | ||
|
||
if (!is.double(a)) | ||
storage.mode(a) <- "double" | ||
if (!is.integer(i)) | ||
storage.mode(i) <- "integer" | ||
if (!is.integer(j)) | ||
storage.mode(j) <- "integer" | ||
|
||
.Call(R_co_sparse, n, a, i, j, as.integer(type)) | ||
.Call(R_co_sparse, as.integer(n), a, i, j, as.integer(index), as.integer(type)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters