SCM

SCM Repository

[matrix] Diff of /pkg/R/Tsparse.R
ViewVC logotype

Diff of /pkg/R/Tsparse.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 886, Wed Aug 31 17:49:47 2005 UTC revision 892, Fri Sep 2 13:40:47 2005 UTC
# Line 12  Line 12 
12  .ind.prep <- function(xi, i, margin, di, dn)  .ind.prep <- function(xi, i, margin, di, dn)
13  {  {
14      ## Purpose: do the ``common things'' for "*gTMatrix" indexing      ## Purpose: do the ``common things'' for "*gTMatrix" indexing
15        ##          for 1 dimension, 'margin' ,
16      ##          and return match(.,.) + li = length of corresponding dimension      ##          and return match(.,.) + li = length of corresponding dimension
17      ##      ##
18      ## i is "index";  xi = "x@i";  margin in {1,2};      ## i is "index";  xi = "x@i";  margin in {1,2};
19      ## di = dim(x)      { when i is "logical" }      ## di = dim(x)      { used when i is "logical" }
20      ## dn = dimnames(x)      ## dn = dimnames(x) { used when i is character }
21    
22      dn <- dn[[margin]]      dn <- dn[[margin]]
23      has.dn <- is.character(dn)      has.dn <- is.character(dn)
24      if(is(i, "numeric")) {      if(is(i, "numeric")) {
25          storage.mode(i) <- "integer"          storage.mode(i) <- "integer"
26          i0 <- i - 1:1 # tranform to 0-indexing          i0 <- i - 1:1 # transform to 0-indexing
27          if(has.dn) dn <- dn[i]          if(has.dn) dn <- dn[i]
28      }      }
29      else if (is(i, "logical")) {      else if (is(i, "logical")) {

Legend:
Removed from v.886  
changed lines
  Added in v.892

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge