SCM

SCM Repository

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

Diff of /pkg/R/zzz.R

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

revision 1672, Mon Nov 6 20:25:10 2006 UTC revision 1673, Mon Nov 6 20:54:26 2006 UTC
# Line 36  Line 36 
36      ## generic kronecker      ## generic kronecker
37      assignInNamespace("%x%", function (X, Y) kronecker(X, Y), ns = "base")      assignInNamespace("%x%", function (X, Y) kronecker(X, Y), ns = "base")
38    
39      if(paste(R.version$major, R.version$minor, sep=".") >= "2.2")      if(paste(R.version$major, R.version$minor, sep=".") < "2.5") {
40            ## For  R  versions prior to 2.5.0 -- replace "diag<-" in base :
41            tmp <- function(x, value) {
42                dx <- dim(x)
43                if(length(dx) != 2)
44                    ## no further check, to also work with 'Matrix'
45                    stop("only matrix diagonals can be replaced")
46                len.i <- min(dx)
47                i <- seq_len(len.i)
48                len.v <- length(value)
49                if(len.v != 1 && len.v != len.i)
50                    stop("replacement diagonal has wrong length")
51                if(len.i > 0) x[cbind(i, i)] <- value
52                x
53            }
54            environment(tmp) <- baseenv()
55            assignInNamespace("diag<-", tmp, ns = "base")
56        }
57    
58          methods:::bind_activation(TRUE)          methods:::bind_activation(TRUE)
59  }  }
60    
# Line 46  Line 64 
64      assignInNamespace("as.array",  base::..Old..as.array,  ns = "base")      assignInNamespace("as.array",  base::..Old..as.array,  ns = "base")
65      library.dynam.unload("Matrix", libpath)      library.dynam.unload("Matrix", libpath)
66    
     if(paste(R.version$major, R.version$minor, sep=".") >= "2.2")  
67          methods:::bind_activation(FALSE)          methods:::bind_activation(FALSE)
68  }  }

Legend:
Removed from v.1672  
changed lines
  Added in v.1673

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