SCM

SCM Repository

[matrix] Diff of /pkg/TODO
ViewVC logotype

Diff of /pkg/TODO

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

revision 1887, Thu Jun 7 09:04:34 2007 UTC revision 2102, Fri Jan 11 22:35:25 2008 UTC
# Line 1  Line 1 
1  Check for DimNames propagation in coercion and other operations.  Check for DimNames propagation in coercion and other operations.
2  ------  ------
 - rcond methods for sparseMatrix classes  
   
3  - Report the problem in the Linux ldexp manual page.  The second and  - Report the problem in the Linux ldexp manual page.  The second and
4    third calls in the Synopsis should be to ldexpf and ldexpl.    third calls in the Synopsis should be to ldexpf and ldexpl.
5    
# Line 52  Line 50 
50    for all  "dsparse*" -> "lsparse*" and vice versa.    for all  "dsparse*" -> "lsparse*" and vice versa.
51    How can one do this {in a documented way} ?    How can one do this {in a documented way} ?
52    
53    - Think of constructing  setAs(...) calls automatically in order to
54      basically enable all ``sensible'' as(fromMatrix, toMatrix)  calls,
55      possibly using canCoerce(.)
56    
57    - setAs(<Mcl>,  "[dln]Matrix") for <Mcl> in {Matrix or denseMatrix + sparseMatrix}
58    
59    - When we have a packed matrix, it's a waste to go through "full" to "sparse":
60      ==> implement
61            setAs("dspMatrix", "sparseMatrix")
62            setAs("dppMatrix", "sparseMatrix")
63            setAs("dtpMatrix", "sparseMatrix")
64      and the same for "lsp" , "ltp"  and  "nsp" , "ntp" !
65    
66  - tcrossprod(x, y) : do provide methods for y != NULL  - tcrossprod(x, y) : do provide methods for y != NULL
67    calling Lapack's DGEMM for "dense"    calling Lapack's DGEMM for "dense"
68    [2005-12-xx: done for dgeMatrix at least]    [2005-12-xx: done for dgeMatrix at least]
# Line 73  Line 84 
84    
85  - is.na() method for all our matrices [ ==> which(*, arr.ind=TRUE) might work ]  - is.na() method for all our matrices [ ==> which(*, arr.ind=TRUE) might work ]
86    
 - When we have a packed matrix, it's a waste to go through "full" to "sparse":  
   ==> implement  
         setAs("dspMatrix", "sparseMatrix")  
         setAs("dppMatrix", "sparseMatrix")  
         setAs("dtpMatrix", "sparseMatrix")  
   and the same for "lsp" , "ltp"  and  "nsp" , "ntp" !  
   
87  - use  .Call(Csparse_drop, M, tol) in more places,  - use  .Call(Csparse_drop, M, tol) in more places,
88    both with 'tol = 0.' to drop "values that happen to be 0" and for    both with 'tol = 0.' to drop "values that happen to be 0" and for
89    zapsmall() methods for Csparse*    zapsmall() methods for Csparse*
# Line 92  Line 96 
96  - chol() and determinant() should ``work'': proper result or "good" error  - chol() and determinant() should ``work'': proper result or "good" error
97    message.    message.
98    
 - Think of constructing  setAs(...) calls automatically in order to  
   basically enable all ``sensible'' as(fromMatrix, toMatrix)  calls,  
   possibly using canCoerce(.)  
   
99  - make sure *all* group methods have (maybe "bail-out") setMethod for "Matrix".  - make sure *all* group methods have (maybe "bail-out") setMethod for "Matrix".
100    e.g. zapsmall(<pMatrix>) fails "badly"    e.g. zapsmall(<pMatrix>) fails "badly"
101    
# Line 109  Line 109 
109    
110  - rbind(<sparse>, <dense>) does not work  (e.g. <dgC>, <dge>)  - rbind(<sparse>, <dense>) does not work  (e.g. <dgC>, <dge>)
111    
 - setAs(<Mcl>,  "[dln]Matrix" )  for <Mcl> in {Matrix or denseMatrix + sparseMatrix}  
   
 - Tell users about the possibility to disable the "S4-generic but somewhat slow"  
   cbind/rbind, e.g. via  
   
   setHook(packageEvent("Matrix", "onLoad"),  
           function(...) methods:::bind_activation(FALSE))  
   
 - ensure that  M[0], M[FALSE], M[1:2]  works as for traditional Matrices  
   
112  - make sure  M[FALSE, FALSE]  works for all Matrices  - make sure  M[FALSE, FALSE]  works for all Matrices
113    {e.g. fails for M <- Diagonal(4)}    {e.g. fails for M <- Diagonal(4)}
114    
# Line 133  Line 123 
123    --> R/diagMatrix.R ('FIXME')    --> R/diagMatrix.R ('FIXME')
124    but also R/Ops.R  to ensure  sp-sym. + sp-sym. |-> sp-sym.  etc    but also R/Ops.R  to ensure  sp-sym. + sp-sym. |-> sp-sym.  etc
125    
126    - Diagonal(n) %*% A ---  too slow!! --> ~/R/MM/Pkg-ex/Matrix/diag-Tamas-ex.R
127    
128  - For a square sparse matrix 'b' {typically dgCMatrix or dgTMatrix},  - For a square sparse matrix 'b' {typically dgCMatrix or dgTMatrix},
129    we'd want a function  "Mat_plus_t_Mat" <- function(b) {....}    we'd want a function  "Mat_plus_t_Mat" <- function(b) {....}
130    which computes the symmetric sparse matrix   b + t(b)    which computes the symmetric sparse matrix   b + t(b)
# Line 142  Line 134 
134    !M  where M is "sparseMatrix", currently always gives dense. This only    !M  where M is "sparseMatrix", currently always gives dense. This only
135    makes sense when M is ``really sparse''.    makes sense when M is ``really sparse''.
136    
137  - column names of sparse matrices are not printed;  - msy <- as(matrix(c(2:1,1:2),2), "dsyMatrix"); str(msy)
138    we now "mention" them (if they are non-empty).  
139    Option:    shows that the Cholesky factorization is computed ``too quickly''.
140          build show( <sparseMatrix>) on a function, possibly    Can be a big pain for largish matrices, when it is unneeded.
141          print.sparseMatrix(), which gets an argument such as  
142          'col.names.show  = FALSE' which is documented and can be set to TRUE  - example(Cholesky, echo=FALSE) ; cm <- chol(mtm); str(cm); str(mtm)
143    
144  - 'arules' needs fast colSums() and rowSums() - for ngCMatrix;    shows that chol() does not seems to make use of an already
145    do it for "nMatrix" and "lMatrix" and return *integer*    present factorization and rather uses one with more '0' in x slot.
146    
147    - diag(m) <- val    currently automatically works via  m[cbind(i,i)] <- val
148      However,
149      we need methods for 'diag<-' at least for diagonalMatrix,
150      triangularMatrix, and probably also "dense*general*Matrix" since the
151      above currently goes via "matrix" and back instead of using the 'x' slot
152      directly.
153    
154    - image(M, ..): Think about an optional smart option which keeps
155       "0 |-> transparent" and allows colors to differentiate negative and
156       positive entries.
157    
158    - examples for solve( Cholesky(.), b, system = c("A", "LDLt"....))
159      probably rather in man/CHMfactor-class.Rd than man/Cholesky.Rd
160    
161    - (A + tr(A))/2  := the symmetric part of A, is needed in several
162      circumstances; unfortunately it's not "smart" (preserving symmetry, ...)
163      --> define a generic and methods for it!
164      Names:  symPart(A) or  symMat(A) or symmetrize(A) or ... ?
165      Googling around I found that Nick Higham has a GPL contributed Matlab
166      toolbox where he uses  symmpart(A) := (A + A') /. 2
167      {and  skewpart(A) := (A - A') /. 2}
168    
169    - tr(A %*% B) {and even  tr(A %*% B %*% C) ...} are also needed
170      frequently in some computations {conditional normal distr. ...}.
171      Since this can be done faster than by
172        sum(diag(A %*% B))  even for traditional matrices, e.g.
173                   sum(A * t(B)) or {even faster for "full" mat}
174                   crossprod(as.vector(A), as.vector(B))
175      and even more so for, e.g.  <sparse> %*% <dense>
176      {used in Soeren's 'gR' computations},
177      we should also provide a generic and methods.

Legend:
Removed from v.1887  
changed lines
  Added in v.2102

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