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 1097, Thu Dec 29 10:34:00 2005 UTC revision 2005, Wed Jul 18 14:46:20 2007 UTC
# Line 1  Line 1 
1  - Migration of lmer from the mer representation to the mer2  Check for DimNames propagation in coercion and other operations.
    representation and the use of the CHOLMOD code for the sparse  
    matrix decomposition.  Some of the things that need to be done.  
    - Matrices in the mer2 representation are classed matrices, in the  
    mer representation they were unclassed.  Any parts inside the C  
    code that would access, for example,  
     REAL(GET_SLOT(x, Matrix_RXXSym))  
    need to be modified to access  
     REAL(GET_SLOT(GET_SLOT(x, Matrix_RXXSym), Matrix_xSym))  
    This is especially important for Omega but I think I have done  
    those changes already.  
    - The components named *X* in an mer object refer to an augmented  
    design matrix of p+1 columns.  In the mer2 object there are  
    separate slots for rZy and rXy.  The scalar y'y is the first  
    element of devComp.  
    - Presently nc is of length nf+1 and the last element is n, the  
    number of observations.  This value should be moved to devComp and  
    nc made of length nf.  
    - The slot L is a list of length 1 that contains an ExternalPointer  
    to a cholmod_factor object.  This contains a permutation which is  
    most easily accessible through cholmod_solve(CHOLMOD_P,...) or  
    cholmod_solve(CHOLMOD_Pt,...).  The ZtX, Zty, RZX and rZy slots actually  
    contain P%*%RZX and P%*%rZy  
2  ------  ------
3  - Sparse matrix methods can now be based on the CHOLMOD package.  We  - rcond methods for sparseMatrix classes
    will need to migrate from the current code to CHOLMOD-based 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  
    - Start adding simple S4 methods (rcond, %*%, +, cbind, t).  
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.
# Line 44  Line 9 
10  - consider moving alloc3Darray from ./src/Mutils.c to  - consider moving alloc3Darray from ./src/Mutils.c to
11    $(RSRC)/src/base/array.c    $(RSRC)/src/base/array.c
12    ------
13  - provide methods for "dspMatrix" and "dppMatrix"!  - provide methods for "dspMatrix" and "dppMatrix"!
15  - implement (more) methods for supporting "packed" (symmetric / triangular)  - implement (more) methods for supporting "packed" (symmetric / triangular)
# Line 55  Line 18 
19    (have some dtr* <-> dtp*)    (have some dtr* <-> dtp*)
21  - 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(2005-10-03): The error message is more helpful now.  
23  - combine the C functions for multiplication by special forms and  - combine the C functions for multiplication by special forms and
24    solution wrt special forms by using a 'right' argument and a    solution wrt special forms by using a 'right' argument and a
# Line 82  Line 34 
34    and "/" and "%/%" at least when the RHS is non-zero a scalar.    and "/" and "%/%" at least when the RHS is non-zero a scalar.
35    Challenge: nice implementation (``common non-0''; but Tsparse* is not uniq).    Challenge: nice implementation (``common non-0''; but Tsparse* is not uniq).
37  ---  -----
 - Create a Harwell-Boeing 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.  
39  - "Math2" , "Math", "Arith":  - "Math2" , "Math", "Arith":
40     keep triangular and symmetric Matrices when appropriate:     keep triangular and symmetric Matrices when appropriate:
# Line 106  Line 54 
55  - tcrossprod(x, y) : do provide methods for y != NULL  - tcrossprod(x, y) : do provide methods for y != NULL
56    calling Lapack's DGEMM for "dense"    calling Lapack's DGEMM for "dense"
57      [2005-12-xx: done for dgeMatrix at least]
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"
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".
70    - Factorizations: LU done; also Schur()  for  *sparse*  Matrices.
72    - band(), triu(), tril() for *all* including "matrix", not just sparse matrices
74    - method for all our matrices [ ==> which(*, arr.ind=TRUE) might work ]
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" !
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*
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.
92    - chol() and determinant() should ``work'': proper result or "good" error
93      message.
95    - Think of constructing  setAs(...) calls automatically in order to
96      basically enable all ``sensible'' as(fromMatrix, toMatrix)  calls,
97      possibly using canCoerce(.)
99    - make sure *all* group methods have (maybe "bail-out") setMethod for "Matrix".
100      e.g. zapsmall(<pMatrix>) fails "badly"
102    - speedup: pass class definition to non0ind() [check all calls ..]
104    - sum(): implement methods which work for *all* our matrices.
106    - Implement  expand(.) for the Cholesky() results
107      "dCHMsimpl" and  "dCHMsuper"  -- currently have no *decent* way to get at
108      the matrix factors of the corresponding matrix factorization !!
110    - rbind(<sparse>, <dense>) does not work  (e.g. <dgC>, <dge>)
112    - setAs(<Mcl>,  "[dln]Matrix" )  for <Mcl> in {Matrix or denseMatrix + sparseMatrix}
114    - Tell users about the possibility to disable the "S4-generic but somewhat slow"
115      cbind/rbind, e.g. via
117      setHook(packageEvent("Matrix", "onLoad"),
118              function(...) methods:::bind_activation(FALSE))
120    - ensure that  M[0], M[FALSE], M[1:2]  works as for traditional Matrices
122    - make sure  M[FALSE, FALSE]  works for all Matrices
123      {e.g. fails for M <- Diagonal(4)}
125    - <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.
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
136    - For a square sparse matrix 'b' {typically dgCMatrix or dgTMatrix},
137      we'd want a function  "Mat_plus_t_Mat" <- function(b) {....}
138      which computes the symmetric sparse matrix   b + t(b)
139      in way that never works with size-doubled vectors from  b@i etc..
141    - ! <symmetricMatrix>  loses symmetry, both for dense and sparse matrices.
142      !M  where M is "sparseMatrix", currently always gives dense. This only
143      makes sense when M is ``really sparse''.
145    - log1p(<sparseMatrix>) "should" give <dsparseMatrix>
146      Pretty surely, this would happen automagically, if "log1p" became part of
147      "Math" group generic ---> which is the case from R 2.6.0 on
149    - msy <- as(matrix(c(2:1,1:2),2), "dsyMatrix"); str(msy)
151      shows that the Cholesky factorization is computed ``too quickly''.
152      Can be a big pain for largish matrices, when it is unneeded.
154    - diag(m) <- val    currently automatically works via  m[cbind(i,i)] <- val
155      However,
156      we need methods for 'diag<-' at least for diagonalMatrix,
157      triangularMatrix, and probably also "dense*general*Matrix" since the
158      above currently goes via "matrix" and back instead of using the 'x' slot
159      directly.

Removed from v.1097  
changed lines
  Added in v.2005
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge