 pkg/TODO 2005/10/07 20:18:29 976
+++ pkg/TODO 2007/06/07 09:04:34 1887
@@ 1,12 +1,6 @@
 Sparse matrix methods can now be based on the CHOLMOD package. We
 will need to migrate from the current code to CHOLMODbased code
 using #ifdef USE_CHOLMOD. Some of the things to be done

  Move documentation from subdirectories of src to inst/doc
  Write utilities to create a cholmod_sparse pointer from a
 dgCMatrix or lgCMatrix (or zgCMatrix) object without copying and
 allocating.
  Start adding simple S4 methods (rcond, %*%, +, cbind, t).
+Check for DimNames propagation in coercion and other operations.
+
+ rcond methods for sparseMatrix classes
 Report the problem in the Linux ldexp manual page. The second and
third calls in the Synopsis should be to ldexpf and ldexpl.
@@ 15,9 +9,7 @@
 consider moving alloc3Darray from ./src/Mutils.c to
$(RSRC)/src/base/array.c



+
 provide methods for "dspMatrix" and "dppMatrix"!
 implement (more) methods for supporting "packed" (symmetric / triangular)
@@ 26,18 +18,7 @@
(have some dtr* <> dtp*)
 implement diagonal Matrix class "ddiMatrix" etc
 using constructor function Diagonal() or Diag().

 rcond() of a singular dpoMatrix gives a LaPack error instead of just 0:
 MM < crossprod(M < Matrix(c(1:4,9:6), 2,4)) ; rcond(MM)
 ##> Error in rcond(MM) : Lapack routine dpotrf returned error code 4
 It's .Call("dpoMatrix_rcond") > set_rcond() in src/dpoMatrix.c
 and in src/dppMatrix.c similarly.

 Done(20051003): The error message is more helpful now.


+
 combine the C functions for multiplication by special forms and
solution wrt special forms by using a 'right' argument and a
@@ 53,11 +34,7 @@
and "/" and "%/%" at least when the RHS is nonzero a scalar.
Challenge: nice implementation (``common non0''; but Tsparse* is not uniq).


 Create a HarwellBoeing version of the matrix mm and the response
 vector y in inst/external and remove them from the data directory.
 Modify any examples that use them and modify the Comparisons vignette.
+
 "Math2" , "Math", "Arith":
keep triangular and symmetric Matrices when appropriate:
@@ 74,3 +51,103 @@
methods at once by a ``method constructor'', i.e.,
for all "dsparse*" > "lsparse*" and vice versa.
How can one do this {in a documented way} ?
+
+ tcrossprod(x, y) : do provide methods for y != NULL
+ calling Lapack's DGEMM for "dense"
+ [200512xx: done for dgeMatrix at least]
+
+ BUGlet: Shouldn't lose factorization here:
+ h6 < Hilbert(6); chol(h6) ; str(h6) # has factor
+ str(H6 < as(h6, "dspMatrix")) # has lost factor
+ ## and the same in a similar situation involving "dpo", "dpp"
+
+ Things like M[upper.tri(M)] are not really most useful for sparse
+ matrices. > provide generic functions
+ upperTriMatrix(), lowerTriMatrix() both with argument 'diag = TRUE'
+ (which can be set to FALSE of course) which are used to extract a
+ triangle from an arbitrary sparse matrix and return a "dtCMatrix".
+
+ Factorizations: LU done; also Schur() for *sparse* Matrices.
+
+ band(), triu(), tril() for *all* including "matrix", not just sparse matrices
+
+ is.na() method for all our matrices [ ==> which(*, arr.ind=TRUE) might work ]
+
+ 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" !
+
+ use .Call(Csparse_drop, M, tol) in more places,
+ both with 'tol = 0.' to drop "values that happen to be 0" and for
+ zapsmall() methods for Csparse*
+
+ implement .Call(Csparse_scale, ....) interfacing to cholmod_scale()
+ in src/CHOLMOD/Include/cholmod_matrixops.h : for another function
+ specifically for multiplying a cholmod_sparse object by a diagonal matrix.
+ Use it in %*% and [t]crossprod methods.
+
+ chol() and determinant() should ``work'': proper result or "good" error
+ message.
+
+ Think of constructing setAs(...) calls automatically in order to
+ basically enable all ``sensible'' as(fromMatrix, toMatrix) calls,
+ possibly using canCoerce(.)
+
+ make sure *all* group methods have (maybe "bailout") setMethod for "Matrix".
+ e.g. zapsmall() fails "badly"
+
+ speedup: pass class definition to non0ind() [check all calls ..]
+
+ sum(): implement methods which work for *all* our matrices.
+
+ Implement expand(.) for the Cholesky() results
+ "dCHMsimpl" and "dCHMsuper"  currently have no *decent* way to get at
+ the matrix factors of the corresponding matrix factorization !!
+
+ rbind(, ) does not work (e.g. , )
+
+ setAs(, "[dln]Matrix" ) for in {Matrix or denseMatrix + sparseMatrix}
+
+ Tell users about the possibility to disable the "S4generic 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
+
+ make sure M[FALSE, FALSE] works for all Matrices
+ {e.g. fails for M < Diagonal(4)}
+
+ %*% {also in crossprod/tcrossprod} currently always
+ returns , since > Csparse_dense_prod > cholmod_sdmult
+ and that does only return dense.
+ When the sparse matrix is very sparse, i.e. has many rows with only zero
+ entries, it would make much sense to return sparse.
+
+ sparsesymmetric + diagonal should stay sparsesymmetric
+ (only stays sparse): Matrix(0, 4, 4) + Diagonal(4, 1:4)
+ > R/diagMatrix.R ('FIXME')
+ but also R/Ops.R to ensure spsym. + spsym. > spsym. etc
+
+ For a square sparse matrix 'b' {typically dgCMatrix or dgTMatrix},
+ we'd want a function "Mat_plus_t_Mat" < function(b) {....}
+ which computes the symmetric sparse matrix b + t(b)
+ in way that never works with sizedoubled vectors from b@i etc..
+
+ ! loses symmetry, both for dense and sparse matrices.
+ !M where M is "sparseMatrix", currently always gives dense. This only
+ makes sense when M is ``really sparse''.
+
+ column names of sparse matrices are not printed;
+ we now "mention" them (if they are nonempty).
+ Option:
+ build show( ) on a function, possibly
+ print.sparseMatrix(), which gets an argument such as
+ 'col.names.show = FALSE' which is documented and can be set to TRUE
+
+ 'arules' needs fast colSums() and rowSums()  for ngCMatrix;
+ do it for "nMatrix" and "lMatrix" and return *integer*