SCM

SCM Repository

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

Diff of /pkg/R/AllClass.R

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

revision 1164, Sat Jan 14 23:40:42 2006 UTC revision 1165, Sat Jan 14 23:41:55 2006 UTC
# Line 29  Line 29 
29    
30  ## Virtual classes of Matrices determined by above/below diagonal relationships  ## Virtual classes of Matrices determined by above/below diagonal relationships
31    
32  setClass("generalMatrix", contains = "compMatrix")  setClass("generalMatrix", representation = "VIRTUAL", contains = "compMatrix")
33    
34  setClass("symmetricMatrix",  setClass("symmetricMatrix",
35           representation(uplo = "character", "VIRTUAL"),           representation(uplo = "character", "VIRTUAL"),
# Line 37  Line 37 
37    
38  setClass("triangularMatrix",  setClass("triangularMatrix",
39           representation(uplo = "character", diag = "character", "VIRTUAL"),           representation(uplo = "character", diag = "character", "VIRTUAL"),
40           contains = "Matrix")           contains = "Matrix",
41             validity =
42            function(object) .Call("triangularMatrix_validate", object, PACKAGE = "Matrix")
43             )
44    
45    
46  ## Virtual class of numeric matrices  ## Virtual class of numeric matrices
47  setClass("dMatrix",  setClass("dMatrix",
48           representation(x = "numeric", "VIRTUAL"), contains = "Matrix")           representation(x = "numeric", "VIRTUAL"), contains = "Matrix",
49             validity = function(object)
50             .Call("dMatrix_validate", object, PACKAGE = "Matrix"))
51    
52  ## Virtual class of integer matrices  ## Virtual class of integer matrices
53  setClass("iMatrix",  setClass("iMatrix",
# Line 110  Line 115 
115  ##----------------------  DENSE  -----------------------------------------  ##----------------------  DENSE  -----------------------------------------
116    
117  ## numeric, dense, general matrices  ## numeric, dense, general matrices
118  setClass("dgeMatrix", contains = c("ddenseMatrix", "compMatrix"),  setClass("dgeMatrix", contains = c("ddenseMatrix", "generalMatrix"),
119           ## checks that length( @ x) == prod( @ Dim):           ## checks that length( @ x) == prod( @ Dim):
120           validity =           validity =
121           function(object) .Call("dgeMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("dgeMatrix_validate", object, PACKAGE = "Matrix")
# Line 119  Line 124 
124    
125  ## numeric, dense, non-packed, triangular matrices  ## numeric, dense, non-packed, triangular matrices
126  setClass("dtrMatrix",  setClass("dtrMatrix",
          ## FIXME?  
          ##> 'ddense*' before 'dge*' so it can use d* or ddense* methods  
          ##> WITHOUT a coerce to dge* (losing triangularity)  
          ##> gives error from callNextMethod() in crossprod() dispatch {R bug?}  
          ##> contains = c("ddenseMatrix", "dgeMatrix", "triangularMatrix"),  
127           contains = c("ddenseMatrix", "triangularMatrix"),           contains = c("ddenseMatrix", "triangularMatrix"),
128           prototype = prototype(uplo = "U", diag = "N"),           prototype = prototype(uplo = "U", diag = "N"),
129           validity =           validity =
# Line 142  Line 142 
142  setClass("dsyMatrix",  setClass("dsyMatrix",
143           ## FIXME?           ## FIXME?
144           ##> 'ddense*' before 'dge*' so it can use d* or ddense* methods           ##> 'ddense*' before 'dge*' so it can use d* or ddense* methods
145           ##> WITHOUT a coerce to dge* (losing triangularity)           ##> WITHOUT a coerce to dge* (losing symmetry)
146           ##> gives error in crossprod() dispatch           ##> gives error in crossprod() dispatch
147           ##> contains = c("ddenseMatrix", "dgeMatrix", "symmetricMatrix"),           ##> contains = c("ddenseMatrix", "dgeMatrix", "symmetricMatrix"),
148           contains = c("dgeMatrix", "symmetricMatrix"),           contains = c("dgeMatrix", "symmetricMatrix"),
# Line 154  Line 154 
154  ## numeric, dense, packed symmetric matrices  ## numeric, dense, packed symmetric matrices
155  setClass("dspMatrix",  setClass("dspMatrix",
156           prototype = prototype(uplo = "U"),           prototype = prototype(uplo = "U"),
157           contains = c("ddenseMatrix", "compMatrix", "symmetricMatrix"),           contains = c("ddenseMatrix", "symmetricMatrix"),
158           validity =           validity =
159           function(object) .Call("dspMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("dspMatrix_validate", object, PACKAGE = "Matrix")
160           )           )
# Line 174  Line 174 
174  ##----- logical dense Matrices -- e.g. as result of <ddenseMatrix>  COMPARISON  ##----- logical dense Matrices -- e.g. as result of <ddenseMatrix>  COMPARISON
175    
176  ## numeric, dense, general matrices  ## numeric, dense, general matrices
177  setClass("lgeMatrix", contains = c("ldenseMatrix", "compMatrix"),  setClass("lgeMatrix", contains = c("ldenseMatrix", "generalMatrix"),
178           ## checks that length( @ x) == prod( @ Dim):           ## checks that length( @ x) == prod( @ Dim):
179           validity = function(object) stopifnot(length(object@x) == prod(object@Dim))           validity = function(object) stopifnot(length(object@x) == prod(object@Dim))
180           )           )
# Line 202  Line 202 
202  ## numeric, dense, packed symmetric matrices  ## numeric, dense, packed symmetric matrices
203  setClass("lspMatrix",  setClass("lspMatrix",
204           prototype = prototype(uplo = "U"),           prototype = prototype(uplo = "U"),
205           contains = c("ldenseMatrix", "compMatrix", "symmetricMatrix"),           contains = c("ldenseMatrix", "symmetricMatrix"),
206           validity = function(object)           validity = function(object)
207           .Call("dspMatrix_validate", object, PACKAGE = "Matrix")           .Call("dspMatrix_validate", object, PACKAGE = "Matrix")
208           ## "dsp" and "lsp" have the same validate           ## "dsp" and "lsp" have the same validate
# Line 221  Line 221 
221    
222  ## numeric, sparse, triplet general matrices  ## numeric, sparse, triplet general matrices
223  setClass("dgTMatrix",  setClass("dgTMatrix",
224           contains = c("TsparseMatrix", "dsparseMatrix", "compMatrix"),           contains = c("TsparseMatrix", "dsparseMatrix", "generalMatrix"),
225           validity =           validity =
226           function(object) .Call("dgTMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("dgTMatrix_validate", object, PACKAGE = "Matrix")
227           )           )
# Line 245  Line 245 
245    
246  ## numeric, sparse, triplet symmetric matrices  ## numeric, sparse, triplet symmetric matrices
247  setClass("dsTMatrix",  setClass("dsTMatrix",
248           contains = c("TsparseMatrix", "dsparseMatrix", "symmetricMatrix", "compMatrix"),           contains = c("TsparseMatrix", "dsparseMatrix", "symmetricMatrix"),
249           prototype = prototype(uplo = "U"),           prototype = prototype(uplo = "U"),
250           validity =           validity =
251           function(object) .Call("dsTMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("dsTMatrix_validate", object, PACKAGE = "Matrix")
# Line 253  Line 253 
253    
254  ## numeric, sparse, sorted compressed sparse column-oriented general matrices  ## numeric, sparse, sorted compressed sparse column-oriented general matrices
255  setClass("dgCMatrix",  setClass("dgCMatrix",
256           contains = c("CsparseMatrix", "dsparseMatrix", "compMatrix"),           contains = c("CsparseMatrix", "dsparseMatrix", "generalMatrix"),
257           prototype = prototype(p = 0:0),# to be valid           prototype = prototype(p = 0:0),# to be valid
258           validity =           validity =
259           function(object) .Call("dgCMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("dgCMatrix_validate", object, PACKAGE = "Matrix")
# Line 271  Line 271 
271  ## see comments for dsTMatrix above  ## see comments for dsTMatrix above
272  ## numeric, sparse, sorted compressed sparse column-oriented symmetric matrices  ## numeric, sparse, sorted compressed sparse column-oriented symmetric matrices
273  setClass("dsCMatrix",  setClass("dsCMatrix",
274           contains = c("CsparseMatrix", "dsparseMatrix", "symmetricMatrix", "compMatrix"),           contains = c("CsparseMatrix", "dsparseMatrix", "symmetricMatrix"),
275           prototype = prototype(p = 0:0, uplo = "U"),# to be valid           prototype = prototype(p = 0:0, uplo = "U"),# to be valid
276           validity =           validity =
277           function(object) .Call("dsCMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("dsCMatrix_validate", object, PACKAGE = "Matrix")
# Line 280  Line 280 
280  ## numeric, sparse, sorted compressed sparse row-oriented general matrices  ## numeric, sparse, sorted compressed sparse row-oriented general matrices
281  setClass("dgRMatrix",  setClass("dgRMatrix",
282           representation(j = "integer", p = "integer"),           representation(j = "integer", p = "integer"),
283           contains = c("dsparseMatrix", "compMatrix"),           contains = c("dsparseMatrix", "generalMatrix"),
284             prototype = prototype(p = 0:0),
285           ##TODO: validity = function(object) .Call("dgRMatrix_validate", object, PACKAGE = "Matrix")           ##TODO: validity = function(object) .Call("dgRMatrix_validate", object, PACKAGE = "Matrix")
286           )           )
287    
288  ## numeric, sparse, sorted compressed sparse row-oriented triangular matrices  ## numeric, sparse, sorted compressed sparse row-oriented triangular matrices
289  setClass("dtRMatrix",  setClass("dtRMatrix",
290           contains = c("dgRMatrix", "triangularMatrix"),           contains = c("dgRMatrix", "triangularMatrix"),
291             prototype = prototype(p = 0:0, uplo = "U", diag = "N"),# to be valid
292    
293           ##TODO: validity = function(object) .Call("dtRMatrix_validate", object, PACKAGE = "Matrix")           ##TODO: validity = function(object) .Call("dtRMatrix_validate", object, PACKAGE = "Matrix")
294           ##TODO: Should this contain dgRMatrix or dsparseMatrix?           ##TODO: Should this contain dgRMatrix or dsparseMatrix?
295           )           )
# Line 294  Line 297 
297  ## numeric, sparse, sorted compressed sparse row-oriented symmetric matrices  ## numeric, sparse, sorted compressed sparse row-oriented symmetric matrices
298  setClass("dsRMatrix",  setClass("dsRMatrix",
299           contains = c("dgRMatrix", "symmetricMatrix"),           contains = c("dgRMatrix", "symmetricMatrix"),
300             prototype = prototype(p = 0:0, uplo = "U"),# to be valid
301           ##TODO: validity = function(object) .Call("dsRMatrix_validate", object, PACKAGE = "Matrix")           ##TODO: validity = function(object) .Call("dsRMatrix_validate", object, PACKAGE = "Matrix")
302           )           )
303    
# Line 304  Line 308 
308    
309  ## logical, sparse, triplet general matrices  ## logical, sparse, triplet general matrices
310  setClass("lgTMatrix",  setClass("lgTMatrix",
311           contains = c("TsparseMatrix", "lsparseMatrix", "compMatrix"),           contains = c("TsparseMatrix", "lsparseMatrix", "generalMatrix"),
312           validity =           validity =
313           function(object) .Call("lgTMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("lgTMatrix_validate", object, PACKAGE = "Matrix")
314           )           )
# Line 319  Line 323 
323    
324  ## logical, sparse, triplet symmetric matrices  ## logical, sparse, triplet symmetric matrices
325  setClass("lsTMatrix",  setClass("lsTMatrix",
326           contains = c("TsparseMatrix", "lsparseMatrix", "symmetricMatrix", "compMatrix"),           contains = c("TsparseMatrix", "lsparseMatrix", "symmetricMatrix"),
327           validity =           validity =
328           function(object) .Call("lsTMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("lsTMatrix_validate", object, PACKAGE = "Matrix")
329           )           )
330    
331  ## logical, sparse, sorted compressed sparse column-oriented general matrices  ## logical, sparse, sorted compressed sparse column-oriented general matrices
332  setClass("lgCMatrix",  setClass("lgCMatrix",
333           contains = c("lsparseMatrix", "CsparseMatrix", "compMatrix"),           contains = c("lsparseMatrix", "CsparseMatrix", "generalMatrix"),
334           prototype = prototype(p = 0:0),# to be valid           prototype = prototype(p = 0:0),# to be valid
335           validity =           validity =
336           function(object) .Call("lgCMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("lgCMatrix_validate", object, PACKAGE = "Matrix")
# Line 342  Line 346 
346    
347  ## logical, sparse, sorted compressed sparse column-oriented symmetric matrices  ## logical, sparse, sorted compressed sparse column-oriented symmetric matrices
348  setClass("lsCMatrix",  setClass("lsCMatrix",
349           contains = c("lsparseMatrix", "CsparseMatrix", "symmetricMatrix", "compMatrix"),           contains = c("lsparseMatrix", "CsparseMatrix", "symmetricMatrix"),
350           prototype = prototype(p = 0:0, uplo = "U"),# to be valid           prototype = prototype(p = 0:0, uplo = "U"),# to be valid
351           validity =           validity =
352           function(object) .Call("lsCMatrix_validate", object, PACKAGE = "Matrix")           function(object) .Call("lsCMatrix_validate", object, PACKAGE = "Matrix")

Legend:
Removed from v.1164  
changed lines
  Added in v.1165

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