SCM

SCM Repository

[matrix] Annotation of /pkg/TODO
ViewVC logotype

Annotation of /pkg/TODO

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2115 - (view) (download)

1 : maechler 2112 - Check for DimNames propagation in coercion and other operations.
2 :    
3 : bates 344 - Report the problem in the Linux ldexp manual page. The second and
4 :     third calls in the Synopsis should be to ldexpf and ldexpl.
5 : maechler 472
6 : maechler 634 - provide methods for "dspMatrix" and "dppMatrix"!
7 :    
8 : maechler 538 - implement (more) methods for supporting "packed" (symmetric / triangular)
9 : maechler 634 matrices; particularly something like pack() and unpack() [to/from our
10 :     classes from/to "numeric"] --- have already man/unpack.Rd but no method yet!
11 : maechler 538
12 : maechler 834 (have some dtr* <-> dtp*)
13 :    
14 : bates 645 - combine the C functions for multiplication by special forms and
15 :     solution wrt special forms by using a 'right' argument and a
16 :     'classed' argument.
17 : maechler 675 [done with dgeMatrix_matrix_mm(); not yet for other classes;
18 :     and for _crossprod()]
19 :    
20 : bates 1578 -----
21 : bates 712
22 : maechler 935 - "Math2" , "Math", "Arith":
23 :     keep triangular and symmetric Matrices when appropriate:
24 :     particularly desirable for "Math2": round(), signif()
25 : maechler 956
26 :     - "d" <-> "l" coercion for all "[TCR]" sparse matrices is really trivial:
27 :     "d" -> "l" : drops the 'x' slot
28 :     "l" -> "d" : construct an 'x' slot of all '1'
29 :     We currently have many of these conversions explicitly, e.g.
30 :     setAs("dsTMatrix", "lsTMatrix",
31 :     function(from) new("lsTMatrix", i = from@i, j = from@j, uplo = from@uplo,
32 :     Dim = from@Dim, Dimnames = from@Dimnames))
33 :     but I would rather want to automatically construct all these coercion
34 :     methods at once by a ``method constructor'', i.e.,
35 :     for all "dsparse*" -> "lsparse*" and vice versa.
36 :     How can one do this {in a documented way} ?
37 : maechler 1087
38 : maechler 2048 - Think of constructing setAs(...) calls automatically in order to
39 :     basically enable all ``sensible'' as(fromMatrix, toMatrix) calls,
40 :     possibly using canCoerce(.)
41 :    
42 :     - setAs(<Mcl>, "[dln]Matrix") for <Mcl> in {Matrix or denseMatrix + sparseMatrix}
43 :    
44 :     - When we have a packed matrix, it's a waste to go through "full" to "sparse":
45 :     ==> implement
46 :     setAs("dspMatrix", "sparseMatrix")
47 :     setAs("dppMatrix", "sparseMatrix")
48 :     setAs("dtpMatrix", "sparseMatrix")
49 :     and the same for "lsp" , "ltp" and "nsp" , "ntp" !
50 :    
51 : maechler 1097 - tcrossprod(x, y) : do provide methods for y != NULL
52 :     calling Lapack's DGEMM for "dense"
53 : maechler 1109 [2005-12-xx: done for dgeMatrix at least]
54 :    
55 : maechler 1201 - BUGlet: Shouldn't lose factorization here:
56 :     h6 <- Hilbert(6); chol(h6) ; str(h6) # has factor
57 :     str(H6 <- as(h6, "dspMatrix")) # has lost factor
58 :     ## and the same in a similar situation involving "dpo", "dpp"
59 : maechler 1226
60 : maechler 1592 - Factorizations: LU done; also Schur() for *sparse* Matrices.
61 : maechler 1253
62 : maechler 1575 - is.na() method for all our matrices [ ==> which(*, arr.ind=TRUE) might work ]
63 : maechler 1592
64 : maechler 1619 - use .Call(Csparse_drop, M, tol) in more places,
65 :     both with 'tol = 0.' to drop "values that happen to be 0" and for
66 :     zapsmall() methods for Csparse*
67 : maechler 1654
68 :     - implement .Call(Csparse_scale, ....) interfacing to cholmod_scale()
69 :     in src/CHOLMOD/Include/cholmod_matrixops.h : for another function
70 :     specifically for multiplying a cholmod_sparse object by a diagonal matrix.
71 :     Use it in %*% and [t]crossprod methods.
72 :    
73 :     - chol() and determinant() should ``work'': proper result or "good" error
74 :     message.
75 : maechler 1659
76 : maechler 1714 - make sure *all* group methods have (maybe "bail-out") setMethod for "Matrix".
77 :     e.g. zapsmall(<pMatrix>) fails "badly"
78 : maechler 1725
79 : maechler 1738 - sum(): implement methods which work for *all* our matrices.
80 :    
81 :     - Implement expand(.) for the Cholesky() results
82 :     "dCHMsimpl" and "dCHMsuper" -- currently have no *decent* way to get at
83 :     the matrix factors of the corresponding matrix factorization !!
84 :    
85 : maechler 2112 - rbind2(<sparse>, <dense>) does not work (e.g. <dgC>, <dge>)
86 : maechler 1799
87 : maechler 1833 - <sparse> %*% <dense> {also in crossprod/tcrossprod} currently always
88 :     returns <dense>, since --> Csparse_dense_prod --> cholmod_sdmult
89 :     and that does only return dense.
90 :     When the sparse matrix is very sparse, i.e. has many rows with only zero
91 :     entries, it would make much sense to return sparse.
92 :    
93 :     - sparse-symmetric + diagonal should stay sparse-symmetric
94 :     (only stays sparse): Matrix(0, 4, 4) + Diagonal(4, 1:4)
95 : maechler 1845 --> R/diagMatrix.R ('FIXME')
96 :     but also R/Ops.R to ensure sp-sym. + sp-sym. |-> sp-sym. etc
97 : maechler 1833
98 : maechler 2048 - Diagonal(n) %*% A --- too slow!! --> ~/R/MM/Pkg-ex/Matrix/diag-Tamas-ex.R
99 :    
100 : maechler 1833 - ! <symmetricMatrix> loses symmetry, both for dense and sparse matrices.
101 :     !M where M is "sparseMatrix", currently always gives dense. This only
102 :     makes sense when M is ``really sparse''.
103 : maechler 1855
104 : maechler 2005 - msy <- as(matrix(c(2:1,1:2),2), "dsyMatrix"); str(msy)
105 :    
106 :     shows that the Cholesky factorization is computed ``too quickly''.
107 :     Can be a big pain for largish matrices, when it is unneeded.
108 :    
109 : maechler 2018 - example(Cholesky, echo=FALSE) ; cm <- chol(mtm); str(cm); str(mtm)
110 :    
111 :     shows that chol() does not seems to make use of an already
112 :     present factorization and rather uses one with more '0' in x slot.
113 :    
114 : maechler 2005 - diag(m) <- val currently automatically works via m[cbind(i,i)] <- val
115 : maechler 2115 This (`[<-` method) is now "smart" for diagonalMatrix, but needs also to
116 :     be for triangularMatrix, and probably also "dense*general*Matrix" since the
117 : maechler 2005 above currently goes via "matrix" and back instead of using the 'x' slot
118 : maechler 2115 directly; in particular, the triangular* "class property" is lost!
119 : maechler 2043
120 : maechler 2048 - image(M, ..): Think about an optional smart option which keeps
121 :     "0 |-> transparent" and allows colors to differentiate negative and
122 :     positive entries.
123 : maechler 2043
124 :     - examples for solve( Cholesky(.), b, system = c("A", "LDLt"....))
125 :     probably rather in man/CHMfactor-class.Rd than man/Cholesky.Rd
126 : maechler 2072
127 :     - tr(A %*% B) {and even tr(A %*% B %*% C) ...} are also needed
128 :     frequently in some computations {conditional normal distr. ...}.
129 :     Since this can be done faster than by
130 :     sum(diag(A %*% B)) even for traditional matrices, e.g.
131 :     sum(A * t(B)) or {even faster for "full" mat}
132 :     crossprod(as.vector(A), as.vector(B))
133 :     and even more so for, e.g. <sparse> %*% <dense>
134 :     {used in Soeren's 'gR' computations},
135 :     we should also provide a generic and methods.
136 : maechler 2103
137 :     - qr.R(qr(x)) may differ for the "same" matrix, depending on it being
138 :     sparse or dense:
139 :     "qr.R(<sparse>) may differ from qr.R(<dense>) because of permutations"
140 :    
141 :     This is not really acceptable and currently influences rcond() as well.
142 : maechler 2105
143 : maechler 2112 - chol() and qr() generic: currently have *two* arguments, and give the msg
144 : maechler 2105
145 : maechler 2112 > New generic for "chol" does not agree with implicit generic from package
146 :     > "base"; a new generic will be assigned with package "Matrix"
147 :    
148 : maechler 2106 (and ditto for "qr")
149 : maechler 2105
150 :     It was mentioned by an R-core member that he thought it did not make
151 :     sense to also dispatch on 'tol' or 'pivot' ... --> maybe change that..
152 : maechler 2106
153 :     - eigen() should become generic, and get a method at least for diagonal,
154 :     but also for symmetric -> dsyMatrix [LAPACK dsyev() uses UPLO !],
155 :     but also simply for dgeMatrix (without going via tradition matrices).
156 :     What about Sparse? There's fill-in, but it may still be sensible, e.g.
157 :     mlist <- list(1, 2:3, diag(x=5:3), 27, cbind(1,3:6), 100:101)
158 :     ee <- eigen(tcrossprod(bdiag(lapply(mlist, as.matrix))))
159 :     Matrix( signif(ee$vectors, 3) )
160 :    
161 :     - facmul() has no single method defined; it looks like a good idea though
162 :     (instead of the infamous qr.qy, qr.qty,.... functions)
163 : maechler 2112
164 :     - symmpart() and skewpart() for *sparse* matrices still use (x +/- t(x))/2
165 :     and could be made more efficient.
166 :     Consider going via asTuniq() or something very close to
167 :     .Arith.Csparse() in R/Ops.R
168 :    
169 : maechler 2115 - many setAs(*, "[dl]..Matrix") are still needed, as long as e.g.
170 :     replCmat() uses as_CspClass() and drop0(.) which itself call
171 :     as_CspClass() quite a bit. --> try to replace these by
172 :     as(*, "CsparseMatrix"); forceSymmetric, etc.

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