SCM

SCM Repository

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

Diff of /pkg/R/AllGeneric.R

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

revision 461, Sat Jan 29 14:09:38 2005 UTC revision 538, Thu Feb 10 13:50:27 2005 UTC
# Line 1  Line 1 
1  # Define those generics that we need, if they don't exist  #### Define those generics that we need, if they don't exist
2    
3  if (!isGeneric("expand")) {  ### In order to be able to define group generics
4    ### {MM : I think this is a workaround for a basic "methods"+NAMESPACE bug}
5    ## This errors out in R 2.1.0
6    ##- setGeneric("+", function(e1,e2) standardGeneric("+"), group = "Arith")
7    ##- setGeneric("-", function(e1,e2) standardGeneric("-"), group = "Arith")
8    ##- setGeneric("*", function(e1,e2) standardGeneric("*"), group = "Arith")
9    ##- setGeneric("/", function(e1,e2) standardGeneric("/"), group = "Arith")
10    
11    
12    if (!isGeneric("expand"))
13      setGeneric("expand", function(x, ...) standardGeneric("expand"))      setGeneric("expand", function(x, ...) standardGeneric("expand"))
 }  
14    
15  if (!isGeneric("tcrossprod")) {  if (!isGeneric("tcrossprod"))
16      setGeneric("tcrossprod", function(x) standardGeneric("tcrossprod"))      setGeneric("tcrossprod", function(x) standardGeneric("tcrossprod"))
 }  
17    
18  if (!isGeneric("isSymmetric")) {  if (!isGeneric("isSymmetric"))
19      setGeneric("isSymmetric", function(object, ...) standardGeneric("isSymmetric"))      setGeneric("isSymmetric", function(object, ...)
20  }                 standardGeneric("isSymmetric"))
21    
22  if (!isGeneric("isNested")) {  if (!isGeneric("isNested"))
23      setGeneric("isNested", function(object, ...) standardGeneric("isNested"))      setGeneric("isNested", function(object, ...) standardGeneric("isNested"))
 }  
24    
25  if (!isGeneric("facmul")) {  if (!isGeneric("facmul"))
26      setGeneric("facmul",      setGeneric("facmul",
27                 function(x, factor, y, transpose, left, ...)                 function(x, factor, y, transpose, left, ...)
28                 standardGeneric("facmul"))                 standardGeneric("facmul"))
 }  
29    
30  if (!isGeneric("lu")) {  if (!isGeneric("lu"))
31      setGeneric("lu", function(x, ...) standardGeneric("lu"))      setGeneric("lu", function(x, ...) standardGeneric("lu"))
 }  
32    
33  if (!isGeneric("norm")) {  if (!isGeneric("norm"))
34      setGeneric("norm", function(x, type, ...) standardGeneric("norm"))      setGeneric("norm", function(x, type, ...) standardGeneric("norm"))
 }  
35    
36  if (!isGeneric("rcond")) {  if (!isGeneric("rcond"))
37      setGeneric("rcond", function(x, type, ...) standardGeneric("rcond"))      setGeneric("rcond", function(x, type, ...) standardGeneric("rcond"))
 }  
38    
39  if (!isGeneric("Schur")) {  if (!isGeneric("Schur"))
40      setGeneric("Schur", function(x, vectors, ...) standardGeneric("Schur"))      setGeneric("Schur", function(x, vectors, ...) standardGeneric("Schur"))
 }  
41    
42  if (!isGeneric("unpack")) {  if (!isGeneric("unpack"))
43      setGeneric("unpack", function(x, ...) standardGeneric("unpack"))      setGeneric("unpack", function(x, ...) standardGeneric("unpack"))
 }  
44    
45  if (!isGeneric("%p%")) {  if (!isGeneric("%p%"))
46      setGeneric("%p%", function(a, b) standardGeneric("%p%"))      setGeneric("%p%", function(a, b) standardGeneric("%p%"))
 }  
47    
48  if (!isGeneric("coef<-")) {  if (!isGeneric("coef<-"))
49      setGeneric("coef<-", function(object, ..., value)      setGeneric("coef<-", function(object, ..., value)
50                 standardGeneric("coef<-"))                 standardGeneric("coef<-"))
51  }  
52    
53  ## The generics pdFactor, pdMatrix, corFactor and corMatrix will be deprecated  ## The generics pdFactor, pdMatrix, corFactor and corMatrix will be deprecated
54    
55  if (!isGeneric("pdFactor")) {  if (!isGeneric("pdFactor"))
56      setGeneric("pdFactor", function(object) standardGeneric("pdFactor"))      setGeneric("pdFactor", function(object) standardGeneric("pdFactor"))
 }  
57    
58  if (!isGeneric("pdMatrix")) {  if (!isGeneric("pdMatrix"))
59      setGeneric("pdMatrix", function(object) standardGeneric("pdMatrix"))      setGeneric("pdMatrix", function(object) standardGeneric("pdMatrix"))
 }  
60    
61  if (!isGeneric("corFactor")) {  if (!isGeneric("corFactor"))
62      ## extractor for transpose inverse square root factor of corr matrix      ## extractor for transpose inverse square root factor of corr matrix
63      setGeneric("corFactor", function(object, ...) standardGeneric("corFactor"))      setGeneric("corFactor", function(object, ...) standardGeneric("corFactor"))
 }  
64    
65  if (!isGeneric("corMatrix")) {  if (!isGeneric("corMatrix"))
66      ## extractor for correlation matrix or the transpose inverse      ## extractor for correlation matrix or the transpose inverse
67      ## square root matrix      ## square root matrix
68      setGeneric("corMatrix", function(object, ...) standardGeneric("corMatrix"))      setGeneric("corMatrix", function(object, ...) standardGeneric("corMatrix"))
 }  
69    
70  # if (!isGeneric("isInitialized")) {  # if (!isGeneric("isInitialized"))
71  #     setGeneric("isInitialized",  #     setGeneric("isInitialized",
72  #                function(object) standardGeneric("isInitialized"),  #                function(object) standardGeneric("isInitialized"),
73  #                valueClass = "logical")  #                valueClass = "logical")
74  # }  #
75    
76    if (!isGeneric("matrix<-"))
77        setGeneric("matrix<-", function(object, value) standardGeneric("matrix<-"))
78    
79    if (!isGeneric("expm"))
80        setGeneric("expm", function(x) standardGeneric("expm"))
81    
 if (!isGeneric("matrix<-")) {  
     setGeneric("matrix<-",  
                function(object, value) standardGeneric("matrix<-"))  
 }  
   
 if (!isGeneric("expm")) {  
     setGeneric("expm",  
                function(x) standardGeneric("expm"))  
 }  

Legend:
Removed from v.461  
changed lines
  Added in v.538

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