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 897, Sat Sep 3 21:57:55 2005 UTC revision 898, Sat Sep 3 21:58:37 2005 UTC
# Line 137  Line 137 
137  # numeric, sparse, triplet triangular matrices  # numeric, sparse, triplet triangular matrices
138  setClass("dtTMatrix",  setClass("dtTMatrix",
139           contains = c("dgTMatrix", "triangularMatrix"),           contains = c("dgTMatrix", "triangularMatrix"),
140             prototype = prototype(uplo = "U", diag = "N"),
141           validity = function(object) .Call("dtTMatrix_validate", object)           validity = function(object) .Call("dtTMatrix_validate", object)
142           )           )
143    
144  # numeric, sparse, triplet symmetric matrices  # numeric, sparse, triplet symmetric matrices
145  setClass("dsTMatrix",  setClass("dsTMatrix",
          prototype = prototype(uplo = "U"),  
146           contains = c("dgTMatrix", "symmetricMatrix"),           contains = c("dgTMatrix", "symmetricMatrix"),
147             prototype = prototype(uplo = "U"),
148           validity = function(object) .Call("dsTMatrix_validate", object)           validity = function(object) .Call("dsTMatrix_validate", object)
149           )           )
150    
# Line 151  Line 152 
152  setClass("dgCMatrix",  setClass("dgCMatrix",
153           representation(i = "integer", p = "integer", factors = "list"),           representation(i = "integer", p = "integer", factors = "list"),
154           contains = "dsparseMatrix",           contains = "dsparseMatrix",
155             prototype = prototype(p = 0:0),# to be valid
156           validity = function(object) .Call("dgCMatrix_validate", object)           validity = function(object) .Call("dgCMatrix_validate", object)
157           )           )
158    
159  # numeric, sparse, sorted compressed sparse column-oriented triangular matrices  # numeric, sparse, sorted compressed sparse column-oriented triangular matrices
160  setClass("dtCMatrix",  setClass("dtCMatrix",
161           contains = c("dgCMatrix", "triangularMatrix"),           contains = c("dgCMatrix", "triangularMatrix"),
162             prototype = prototype(p = 0:0, uplo = "U", diag = "N"),# to be valid
163           validity = function(object) .Call("tsc_validate", object)           validity = function(object) .Call("tsc_validate", object)
164           )           )
165    
166  # numeric, sparse, sorted compressed sparse column-oriented symmetric matrices  # numeric, sparse, sorted compressed sparse column-oriented symmetric matrices
167  setClass("dsCMatrix",  setClass("dsCMatrix",
168           contains = c("dgCMatrix", "symmetricMatrix"),           contains = c("dgCMatrix", "symmetricMatrix"),
169             prototype = prototype(p = 0:0, uplo = "U"),# to be valid
170           validity = function(object) .Call("dsCMatrix_validate", object)           validity = function(object) .Call("dsCMatrix_validate", object)
171           )           )
172    
# Line 212  Line 216 
216  setClass("lgCMatrix",  setClass("lgCMatrix",
217           representation(i = "integer", p = "integer"),           representation(i = "integer", p = "integer"),
218           contains = "lsparseMatrix",           contains = "lsparseMatrix",
219             prototype = prototype(p = 0:0),# to be valid
220           validity = function(object) .Call("lgCMatrix_validate", object)           validity = function(object) .Call("lgCMatrix_validate", object)
221           )           )
222    
223  # logical, sparse, sorted compressed sparse column-oriented triangular matrices  # logical, sparse, sorted compressed sparse column-oriented triangular matrices
224  setClass("ltCMatrix",  setClass("ltCMatrix",
225           contains = c("lgCMatrix", "triangularMatrix"),           contains = c("lgCMatrix", "triangularMatrix"),
226             prototype = prototype(p = 0:0, uplo = "U", diag = "N"),# to be valid
227           validity = function(object) .Call("ltCMatrix_validate", object)           validity = function(object) .Call("ltCMatrix_validate", object)
228           )           )
229    
230  # logical, sparse, sorted compressed sparse column-oriented symmetric matrices  # logical, sparse, sorted compressed sparse column-oriented symmetric matrices
231  setClass("lsCMatrix",  setClass("lsCMatrix",
232           contains = c("lgCMatrix", "symmetricMatrix"),           contains = c("lgCMatrix", "symmetricMatrix"),
233             prototype = prototype(p = 0:0, uplo = "U"),# to be valid
234           validity = function(object) .Call("lsCMatrix_validate", object)           validity = function(object) .Call("lsCMatrix_validate", object)
235           )           )
236    
# Line 283  Line 290 
290               if (dd[2] != n) return("pMatrix must be symmetric")               if (dd[2] != n) return("pMatrix must be symmetric")
291               if (length(perm) != n)               if (length(perm) != n)
292                   return(paste("length of 'perm' slot must be", n))                   return(paste("length of 'perm' slot must be", n))
293               if (!(all(range(perm) == c(1, n)) && length(unique(perm)) == n))               if(n > 0 &&
294                    !(all(range(perm) == c(1, n)) && length(unique(perm)) == n))
295                   return("'perm' slot is not a valid permutation")                   return("'perm' slot is not a valid permutation")
296               TRUE               TRUE
297           })           })

Legend:
Removed from v.897  
changed lines
  Added in v.898

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