SCM

SCM Repository

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

Diff of /pkg/R/dsCMatrix.R

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

revision 1279, Tue May 23 08:01:11 2006 UTC revision 1280, Tue May 23 08:01:44 2006 UTC
# Line 9  Line 9 
9    
10  setAs("dsCMatrix", "dsTMatrix",  setAs("dsCMatrix", "dsTMatrix",
11        function(from) ## Cholmod:        function(from) ## Cholmod:
12        .Call("Csparse_to_Tsparse", from, PACKAGE = "Matrix"))        .Call(Csparse_to_Tsparse, from))
13    
14  setAs("dsCMatrix", "dgTMatrix", # needed for image()  setAs("dsCMatrix", "dgTMatrix", # needed for image()
15        function(from) ## pre-Cholmod:        function(from) ## pre-Cholmod:
16        .Call("dsCMatrix_to_dgTMatrix", from, PACKAGE = "Matrix"))        .Call(dsCMatrix_to_dgTMatrix, from))
17    
18  setAs("dsCMatrix", "dgeMatrix",  setAs("dsCMatrix", "dgeMatrix",
19        function(from) as(as(from, "dgTMatrix"), "dgeMatrix"))        function(from) as(as(from, "dgTMatrix"), "dgeMatrix"))
# Line 30  Line 30 
30                           Dim = from@Dim, Dimnames = from@Dimnames))                           Dim = from@Dim, Dimnames = from@Dimnames))
31    
32  setAs("dsCMatrix", "dgCMatrix",  setAs("dsCMatrix", "dgCMatrix",
33        function(from) .Call("sCMatrix_to_gCMatrix", from, PACKAGE = "Matrix"))        function(from) .Call(sCMatrix_to_gCMatrix, from))
34    
35  if(FALSE) # have 'C' version above  if(FALSE) # have 'C' version above
36  setAs("dsCMatrix", "dsTMatrix",  setAs("dsCMatrix", "dsTMatrix",
37        function(from)        function(from)
38        new("dsTMatrix", i = from@i,        new("dsTMatrix", i = from@i,
39            j = .Call("Matrix_expand_pointers", from@p, PACKAGE = "Matrix"),            j = .Call(Matrix_expand_pointers, from@p),
40            x = from@x, uplo = from@uplo,            x = from@x, uplo = from@uplo,
41            Dim= from@Dim, Dimnames = from@Dimnames)            Dim= from@Dim, Dimnames = from@Dimnames)
42        )        )
# Line 46  Line 46 
46    
47  setMethod("solve", signature(a = "dsCMatrix", b = "dgeMatrix"),  setMethod("solve", signature(a = "dsCMatrix", b = "dgeMatrix"),
48            function(a, b, ...)            function(a, b, ...)
49            .Call("dsCMatrix_matrix_solve", a, b, TRUE, PACKAGE = "Matrix"),            .Call(dsCMatrix_matrix_solve, a, b, TRUE),
50            valueClass = "dgeMatrix")            valueClass = "dgeMatrix")
51    
52  setMethod("solve", signature(a = "dsCMatrix", b = "matrix"),  setMethod("solve", signature(a = "dsCMatrix", b = "matrix"),
53            function(a, b, ...)            function(a, b, ...)
54            .Call("dsCMatrix_matrix_solve", a, b, FALSE, PACKAGE = "Matrix"),            .Call(dsCMatrix_matrix_solve, a, b, FALSE),
55            valueClass = "dgeMatrix")            valueClass = "dgeMatrix")
56    
57  ##setMethod("solve", signature(a = "dsCMatrix", b = "numeric"),  ##setMethod("solve", signature(a = "dsCMatrix", b = "numeric"),
# Line 59  Line 59 
59  ##          valueClass = "dgeMatrix")  ##          valueClass = "dgeMatrix")
60    
61  setMethod("chol", signature(x = "dsCMatrix", pivot = "missing"),  setMethod("chol", signature(x = "dsCMatrix", pivot = "missing"),
62            function(x, pivot, LINPACK) .Call("dsCMatrix_chol", x, TRUE, PACKAGE = "Matrix"))            function(x, pivot, LINPACK) .Call(dsCMatrix_chol, x, TRUE))
63    
64  setMethod("chol", signature(x = "dsCMatrix", pivot = "logical"),  setMethod("chol", signature(x = "dsCMatrix", pivot = "logical"),
65            function(x, pivot, LINPACK) .Call("dsCMatrix_chol", x, pivot, PACKAGE = "Matrix"))            function(x, pivot, LINPACK) .Call(dsCMatrix_chol, x, pivot))
66    
67  setMethod("t", signature(x = "dsCMatrix"),  setMethod("t", signature(x = "dsCMatrix"),
68            function(x) .Call("ssc_transpose", x, PACKAGE = "Matrix"),            function(x) .Call(ssc_transpose, x),
69            valueClass = "dsCMatrix")            valueClass = "dsCMatrix")
70    
71  setMethod("determinant", signature(x = "dsCMatrix", logarithm = "missing"),  setMethod("determinant", signature(x = "dsCMatrix", logarithm = "missing"),
# Line 84  Line 84 
84    
85  setMethod("writeHB", signature(obj = "dsCMatrix"),  setMethod("writeHB", signature(obj = "dsCMatrix"),
86            function(obj, file, ...)            function(obj, file, ...)
87            .Call("Matrix_writeHarwellBoeing",            .Call(Matrix_writeHarwellBoeing,
88                  if (obj@uplo == "U") t(obj) else obj,                  if (obj@uplo == "U") t(obj) else obj,
89                  as.character(file), "DSC", PACKAGE = "Matrix"))                  as.character(file), "DSC"))
90    
91  setMethod("writeMM", signature(obj = "dsCMatrix"),  setMethod("writeMM", signature(obj = "dsCMatrix"),
92            function(obj, file, ...)            function(obj, file, ...)
93            .Call("Matrix_writeMatrixMarket",            .Call(Matrix_writeMatrixMarket,
94                  if (obj@uplo == "U") t(obj) else obj,                  if (obj@uplo == "U") t(obj) else obj,
95                  as.character(file), "DSC", PACKAGE = "Matrix"))                  as.character(file), "DSC"))

Legend:
Removed from v.1279  
changed lines
  Added in v.1280

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge