# SCM Repository

[matrix] Diff of /pkg/R/Auxiliaries.R
 [matrix] / pkg / R / Auxiliaries.R

# Diff of /pkg/R/Auxiliaries.R

revision 919, Fri Sep 16 17:27:06 2005 UTC revision 925, Mon Sep 19 19:01:31 2005 UTC
# Line 86  Line 86
86      ## else return a (i,j) matrix of non-zero-indices      ## else return a (i,j) matrix of non-zero-indices
87
88      stopifnot(is(x, "sparseMatrix"))      stopifnot(is(x, "sparseMatrix"))
89      if(is(x, "gTMatrix"))      if(is(x, "TsparseMatrix"))
90          stop("'x' must be column- or row-compressed  'sparseMatrix'")          stop("'x' must be column- or row-compressed  'sparseMatrix'")
91      isCol <- function(M) any("i" == slotNames(M))      isCol <- function(M) any("i" == slotNames(M))
92      .Call("compressed_non_0_ij", x, isCol(x), PACKAGE = "Matrix")      .Call("compressed_non_0_ij", x, isCol(x), PACKAGE = "Matrix")
93  }  }
94
95  ### These are currently tests in ../tests/dgTMatrix.R !!!  ### There is a test on this in ../tests/dgTMatrix.R !
96  uniq <- function(x) {  uniq <- function(x) {
97      if(is(x, "gTMatrix")) {      if(is(x, "TsparseMatrix")) {
98          ## Purpose: produce a *unique* triplet representation:          ## Purpose: produce a *unique* triplet representation:
99          ##              by having (i,j) sorted and unique          ##              by having (i,j) sorted and unique
100          ## -----------------------------------------------------------          ## -----------------------------------------------------------

Legend:
 Removed from v.919 changed lines Added in v.925