File: nsparseMatrix.R

package info (click to toggle)
rmatrix 1.3-2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,024 kB
  • sloc: ansic: 42,435; makefile: 330; sh: 180
file content (18 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#### Superclass Methods for all sparse nonzero-pattern matrices

.C2nC <- function(from, isTri = is(from, "triangularMatrix"))
    .Call(Csparse_to_nz_pattern, from, isTri)

setAs("CsparseMatrix", "nsparseMatrix", function(from) .C2nC(from))
setAs("CsparseMatrix", "nMatrix",       function(from) .C2nC(from))

setAs("nsparseMatrix", "dsparseMatrix", function(from) as(from, "dMatrix"))


setMethod("is.na", signature(x = "nsparseMatrix"), is.na_nsp)

if(getRversion() >= "3.1.0")
setMethod("anyNA", signature(x = "nsparseMatrix"), function(x) FALSE)


setMethod("image", "nsparseMatrix", function(x, ...) image(as(x,"dMatrix"), ...))