SCM

SCM Repository

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

Diff of /pkg/R/Csparse.R

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

revision 1547, Mon Sep 11 14:49:39 2006 UTC revision 1548, Mon Sep 11 22:13:07 2006 UTC
# Line 256  Line 256 
256                dm <- .Call(Csparse_band, x, 0, 0)                dm <- .Call(Csparse_band, x, 0, 0)
257                dlen <- min(dm@Dim)                dlen <- min(dm@Dim)
258                ind1 <- dm@i + 1:1        # 1-based index vector                ind1 <- dm@i + 1:1        # 1-based index vector
259                if (is(dm, "lMatrix")) {                if (is(dm, "nMatrix")) {
260                    val <- rep.int(FALSE, dlen)                    val <- rep.int(FALSE, dlen)
261                    val[ind1] <- TRUE                    val[ind1] <- TRUE
                   return(val)  
262                }                }
263                  else if (is(dm, "lMatrix")) {
264                      val <- rep.int(FALSE, dlen)
265                      val[ind1] <- as.logical(dm@x)
266                  }
267                  else {
268                val <- rep.int(0, dlen)                val <- rep.int(0, dlen)
269                ## cMatrix not yet active but for future expansion                ## cMatrix not yet active but for future expansion
270                if (is(dm, "cMatrix")) val <- as.complex(val)                if (is(dm, "cMatrix")) val <- as.complex(val)
271                val[ind1] <- dm@x                val[ind1] <- dm@x
272                  }
273                val                val
274            })            })
275    

Legend:
Removed from v.1547  
changed lines
  Added in v.1548

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