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 521, Sat Feb 5 17:04:56 2005 UTC revision 1887, Thu Jun 7 09:04:34 2007 UTC
# Line 1  Line 1 
1    Check for DimNames propagation in coercion and other operations.
2    ------
3    - rcond methods for sparseMatrix classes
4    
5  - Report the problem in the Linux ldexp manual page.  The second and  - Report the problem in the Linux ldexp manual page.  The second and
6    third calls in the Synopsis should be to ldexpf and ldexpl.    third calls in the Synopsis should be to ldexpf and ldexpl.
7    
8  - [,] indexing  - [,] indexing: for sparse "works", but not yet for negative indices!
9    
10    - consider moving alloc3Darray from ./src/Mutils.c to
11      $(RSRC)/src/base/array.c
12    ------
13    - provide methods for "dspMatrix" and "dppMatrix"!
14    
15    - implement (more) methods for supporting "packed" (symmetric / triangular)
16      matrices; particularly something like pack() and unpack()  [to/from our
17      classes from/to "numeric"] --- have already man/unpack.Rd but no method yet!
18    
19      (have some dtr* <-> dtp*)
20    
21    -----
22    
23    - combine the C functions for multiplication by special forms and
24      solution wrt special forms by using a 'right' argument and a
25      'classed' argument.
26       [done with dgeMatrix_matrix_mm();  not yet for other classes;
27        and for _crossprod()]
28    
29    - add more comprehensive examples / tests for Schur decomposition
30    
31    - arithmetic for sparse matrices:
32                 <sparseMatrix>  o  <same-dim-sparseMatrix>
33      should return a sparse matrix  for at least "+" and "*" , also %%,
34      and "/" and "%/%" at least when the RHS is non-zero a scalar.
35      Challenge: nice implementation (``common non-0''; but Tsparse* is not uniq).
36    
37    -----
38    
39    - "Math2" , "Math", "Arith":
40       keep triangular and symmetric Matrices when appropriate:
41       particularly desirable for  "Math2": round(), signif()
42    
43    - "d" <-> "l" coercion for all "[TCR]" sparse matrices is really trivial:
44      "d" -> "l" : drops the 'x' slot
45      "l" -> "d" : construct an 'x' slot of all '1'
46      We currently have many of these conversions explicitly, e.g.
47       setAs("dsTMatrix", "lsTMatrix",
48          function(from) new("lsTMatrix", i = from@i, j = from@j, uplo = from@uplo,
49                             Dim = from@Dim, Dimnames = from@Dimnames))
50      but I would rather want to automatically construct all these coercion
51      methods at once by a ``method constructor'', i.e.,
52      for all  "dsparse*" -> "lsparse*" and vice versa.
53      How can one do this {in a documented way} ?
54    
55    - tcrossprod(x, y) : do provide methods for y != NULL
56      calling Lapack's DGEMM for "dense"
57      [2005-12-xx: done for dgeMatrix at least]
58    
59    - BUGlet:  Shouldn't lose factorization here:
60      h6 <- Hilbert(6); chol(h6) ; str(h6) # has factor
61      str(H6 <- as(h6, "dspMatrix"))       # has lost factor
62      ## and the same in a similar situation involving  "dpo", "dpp"
63    
64    - Things like  M[upper.tri(M)] are not really most useful for  sparse
65      matrices.  --> provide generic functions
66      upperTriMatrix(), lowerTriMatrix()  both with argument  'diag = TRUE'
67      (which can be set to FALSE of course) which are used to extract a
68      triangle from an arbitrary sparse matrix and  return a  "dtCMatrix".
69    
70    - Factorizations: LU done; also Schur()  for  *sparse*  Matrices.
71    
72    - band(), triu(), tril() for *all* including "matrix", not just sparse matrices
73    
74    - is.na() method for all our matrices [ ==> which(*, arr.ind=TRUE) might work ]
75    
76    - When we have a packed matrix, it's a waste to go through "full" to "sparse":
77      ==> implement
78            setAs("dspMatrix", "sparseMatrix")
79            setAs("dppMatrix", "sparseMatrix")
80            setAs("dtpMatrix", "sparseMatrix")
81      and the same for "lsp" , "ltp"  and  "nsp" , "ntp" !
82    
83    - use  .Call(Csparse_drop, M, tol) in more places,
84      both with 'tol = 0.' to drop "values that happen to be 0" and for
85      zapsmall() methods for Csparse*
86    
87    - implement .Call(Csparse_scale, ....) interfacing to cholmod_scale()
88      in src/CHOLMOD/Include/cholmod_matrixops.h : for another function
89      specifically for multiplying a cholmod_sparse object by a diagonal matrix.
90      Use it in %*% and [t]crossprod methods.
91    
92    - chol() and determinant() should ``work'': proper result or "good" error
93      message.
94    
95    - Think of constructing  setAs(...) calls automatically in order to
96      basically enable all ``sensible'' as(fromMatrix, toMatrix)  calls,
97      possibly using canCoerce(.)
98    
99    - make sure *all* group methods have (maybe "bail-out") setMethod for "Matrix".
100      e.g. zapsmall(<pMatrix>) fails "badly"
101    
102  - group generics: "Arith", but also "Ops" and "Math";  see  - speedup: pass class definition to non0ind() [check all calls ..]
   ?Math.data.frame  and the examples in  
   ?SetGeneric  
103    
104  - Should the uplo and diag slots continue to be stored as character?  - sum(): implement methods which work for *all* our matrices.
   An alternative is to use a factor as in the enum values for the  
   cblas.  
105    
106  - Organization of the source code files - right now they are organized  - Implement  expand(.) for the Cholesky() results
107    according to class (e.g. dgeMatrix.R, dgeMatrix.h, dgeMatrix.c).  Is    "dCHMsimpl" and  "dCHMsuper"  -- currently have no *decent* way to get at
108    there a better way?    the matrix factors of the corresponding matrix factorization !!
109    
110  - Fix the calculation of the Dim slot for the crossprod method for  - rbind(<sparse>, <dense>) does not work  (e.g. <dgC>, <dge>)
   dgCMatrix objects (too tired to do that now).  
111    
112  - bCrosstab(): do we really want the diagonal "V:V" crosstabs?  - setAs(<Mcl>,  "[dln]Matrix" )  for <Mcl> in {Matrix or denseMatrix + sparseMatrix}
                (if so or in any case: add to  man/bCrosstab.Rd )  
113    
114  - src/Metis/ : one of the two Makefiles needs fixing, as changing  - Tell users about the possibility to disable the "S4-generic but somewhat slow"
115               src/Metis/*.c  does not lead to recompilation.    cbind/rbind, e.g. via
116    
117  - man/Matrix.Rd :  has example with dimnames, but we just drop them!    setHook(packageEvent("Matrix", "onLoad"),
118                  MM thinks dimnames should be supported (but then ...)            function(...) methods:::bind_activation(FALSE))
119    
120  - data/ : names 'mm' and even more 'y' are  ``too short''.  - ensure that  M[0], M[FALSE], M[1:2]  works as for traditional Matrices
         If we really want to keep them, don't use "LazyData"  
         (such that one needs  data(*) explicitly);  
         But MM would rather want something like  ex.mm and ex.y  
121    
122  - spelling style: Should "coersion" be "coercion" ?  - make sure  M[FALSE, FALSE]  works for all Matrices
123      {e.g. fails for M <- Diagonal(4)}
124    
125  - "factors" maybe should move up to "Matrix"  - <sparse> %*% <dense>  {also in crossprod/tcrossprod}  currently always
126      returns <dense>, since --> Csparse_dense_prod --> cholmod_sdmult
127      and that does only return dense.
128      When the sparse matrix is very sparse, i.e. has many rows with only zero
129      entries, it would make much sense to return sparse.
130    
131  -------  - sparse-symmetric + diagonal should stay sparse-symmetric
132      (only stays sparse): Matrix(0, 4, 4) + Diagonal(4, 1:4)
133      --> R/diagMatrix.R ('FIXME')
134      but also R/Ops.R  to ensure  sp-sym. + sp-sym. |-> sp-sym.  etc
135    
136  We have a (at least one) basic problem :  - For a square sparse matrix 'b' {typically dgCMatrix or dgTMatrix},
137     Currently the show() method fail sometime after coercion:    we'd want a function  "Mat_plus_t_Mat" <- function(b) {....}
138     e.g. 'sy' show()s wrongly, even though it "str()" fine :    which computes the symmetric sparse matrix   b + t(b)
139      in way that never works with size-doubled vectors from  b@i etc..
140    
141        (po <- crossprod(Matrix(0:3, 2))) # ok  - ! <symmetricMatrix>  loses symmetry, both for dense and sparse matrices.
142        (ge <- as(po, "dgeMatrix")) # ok    !M  where M is "sparseMatrix", currently always gives dense. This only
143        (sy <- as(po, "dsyMatrix")) # BAD    makes sense when M is ``really sparse''.
       str(sy) # looks fine  
144    
145    or  - column names of sparse matrices are not printed;
146        example(expand) # -> ex$L and ex$U look bad, however    we now "mention" them (if they are non-empty).
147        as(ex$L, "dgeMatrix") # `works'    Option:
148            build show( <sparseMatrix>) on a function, possibly
149            print.sparseMatrix(), which gets an argument such as
150            'col.names.show  = FALSE' which is documented and can be set to TRUE
151    
152    {Of course, we don't need a workaround but must understand  - 'arules' needs fast colSums() and rowSums() - for ngCMatrix;
153     and solve the problem}    do it for "nMatrix" and "lMatrix" and return *integer*

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

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