SCM

SCM Repository

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

Annotation of /pkg/R/Auxiliaries.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 908 - (view) (download)

1 : maechler 632 #### "Namespace private" Auxiliaries such as method functions
2 :     #### (called from more than one place --> need to be defined early)
3 :    
4 : maechler 656 ## For %*% (M = Matrix; v = vector (double or integer {complex maybe?}):
5 :     .M.v <- function(x, y) callGeneric(x, as.matrix(y))
6 :     .v.M <- function(x, y) callGeneric(rbind(x), y)
7 : maechler 632
8 : maechler 656 .has.DN <- ## has non-trivial Dimnames slot?
9 :     function(x) !identical(list(NULL,NULL), x@Dimnames)
10 :    
11 : maechler 632 ## chol() via "dpoMatrix"
12 :     cholMat <- function(x, pivot, LINPACK) {
13 :     px <- as(x, "dpoMatrix")
14 : bates 703 if (isTRUE(validObject(px, test=TRUE))) chol(px)
15 : maechler 632 else stop("'x' is not positive definite -- chol() undefined.")
16 :     }
17 : maechler 908
18 :     rowCheck <- function(a, b) {
19 :     da <- dim(a)
20 :     db <- dim(b)
21 :     if(da[1] != db[1])
22 :     stop(gettextf("Matrices must have same number of rows in %s",
23 :     deparse(sys.call(sys.parent()))),
24 :     call. = FALSE)
25 :     ## return the common nrow()
26 :     da[1]
27 :     }
28 :    
29 :     colCheck <- function(a, b) {
30 :     da <- dim(a)
31 :     db <- dim(b)
32 :     if(da[2] != db[2])
33 :     stop(gettextf("Matrices must have same number of columns in %s",
34 :     deparse(sys.call(sys.parent()))),
35 :     call. = FALSE)
36 :     ## return the common ncol()
37 :     da[2]
38 :     }
39 :    
40 :    

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