SCM

SCM Repository

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

Diff of /pkg/R/Auxiliaries.R

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

revision 1548, Mon Sep 11 22:13:07 2006 UTC revision 1571, Sat Sep 16 21:03:12 2006 UTC
# Line 7  Line 7 
7  is0  <- function(x) !is.na(x) & x == 0  is0  <- function(x) !is.na(x) & x == 0
8  all0 <- function(x) !any(is.na(x)) && all(x == 0)  all0 <- function(x) !any(is.na(x)) && all(x == 0)
9    
10    allTrue  <- function(x) !any(is.na(x)) && all(x)
11    allFalse <- function(x) !any(is.na(x)) && !any(x)
12    
13    
14  ## For %*% (M = Matrix; v = vector (double or integer {complex maybe?}):  ## For %*% (M = Matrix; v = vector (double or integer {complex maybe?}):
15  .M.v <- function(x, y) callGeneric(x, as.matrix(y))  .M.v <- function(x, y) callGeneric(x, as.matrix(y))
16  .v.M <- function(x, y) callGeneric(rbind(x), y)  .v.M <- function(x, y) callGeneric(rbind(x), y)
# Line 25  Line 29 
29                    fun, cl1, cl2), call. = FALSE)                    fun, cl1, cl2), call. = FALSE)
30  }  }
31    
32    ## This should be done in C and be exported by 'methods':  [FIXME - ask JMC ]
33    copyClass <- function(x, newCl, sNames =
34                          intersect(slotNames(newCl), slotNames(x))) {
35        r <- new(newCl)
36        for(n in sNames)
37            slot(r, n) <- slot(x, n)
38        r
39    }
40    
41  ## chol() via "dpoMatrix"  ## chol() via "dpoMatrix"
42  cholMat <- function(x, pivot, LINPACK) {  cholMat <- function(x, pivot, ...) {
43      px <- as(x, "dpoMatrix")      px <- as(x, "dpoMatrix")
44      if (isTRUE(validObject(px, test=TRUE))) chol(px)      if (isTRUE(validObject(px, test=TRUE))) chol(px)
45      else stop("'x' is not positive definite -- chol() undefined.")      else stop("'x' is not positive definite -- chol() undefined.")

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

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