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 2005, Wed Jul 18 14:46:20 2007 UTC revision 2098, Sun Dec 9 00:35:14 2007 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    
 - log1p(<sparseMatrix>) "should" give <dsparseMatrix>  
   Pretty surely, this would happen automagically, if "log1p" became part of  
   "Math" group generic ---> which is the case from R 2.6.0 on  
   
137  - msy <- as(matrix(c(2:1,1:2),2), "dsyMatrix"); str(msy)  - msy <- as(matrix(c(2:1,1:2),2), "dsyMatrix"); str(msy)
138    
139    shows that the Cholesky factorization is computed ``too quickly''.    shows that the Cholesky factorization is computed ``too quickly''.
140    Can be a big pain for largish matrices, when it is unneeded.    Can be a big pain for largish matrices, when it is unneeded.
141    
142    - example(Cholesky, echo=FALSE) ; cm <- chol(mtm); str(cm); str(mtm)
143    
144      shows that chol() does not seems to make use of an already
145      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  - diag(m) <- val    currently automatically works via  m[cbind(i,i)] <- val
148    However,    However,
149    we need methods for 'diag<-' at least for diagonalMatrix,    we need methods for 'diag<-' at least for diagonalMatrix,
150    triangularMatrix, and probably also "dense*general*Matrix" since the    triangularMatrix, and probably also "dense*general*Matrix" since the
151    above currently goes via "matrix" and back instead of using the 'x' slot    above currently goes via "matrix" and back instead of using the 'x' slot
152    directly.    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 as 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.2005  
changed lines
  Added in v.2098

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