SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/src/dense.c
ViewVC logotype

Diff of /pkg/Matrix/src/dense.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1735, Tue Jan 23 17:07:37 2007 UTC revision 1736, Tue Jan 23 17:09:41 2007 UTC
# Line 248  Line 248 
248    
249  SEXP dense_to_Csparse(SEXP x)  SEXP dense_to_Csparse(SEXP x)
250  {  {
251      cholmod_dense *chxd = as_cholmod_dense(PROTECT(mMatrix_as_geMatrix(x)));      cholmod_dense *chxd = as_cholmod_x_dense(PROTECT(mMatrix_as_geMatrix(x)));
252      /* cholmod_dense_to_sparse() in CHOLMOD/Core/ does work for all 'xtypes'  
253         including "nMatrix", but cannot keep symmetric / triangular, hence the      /* cholmod_dense_to_sparse() in CHOLMOD/Core/ below does only work for
254         as_geMatrix() above.         "REAL" 'xtypes', i.e. *not* for "nMatrix".
255         Note that this is already a *waste* for symmetric matrices;         ===> need "_x" in above call.
256         However, we could conceivable use an enhanced cholmod_dense_to_sparse(),  
257         with an extra boolean argument for symmetry.         Also it cannot keep symmetric / triangular, hence the
258           as_geMatrix() above.  Note that this is already a *waste* for
259           symmetric matrices; However, we could conceivably use an
260           enhanced cholmod_dense_to_sparse(), with an extra boolean
261           argument for symmetry.
262      */      */
263      cholmod_sparse *chxs = cholmod_dense_to_sparse(chxd, 1, &c);      cholmod_sparse *chxs = cholmod_dense_to_sparse(chxd, 1, &c);
264      int Rkind = (chxd->xtype == CHOLMOD_REAL) ? Real_KIND(x) : 0;      int Rkind = (chxd->xtype == CHOLMOD_REAL) ? Real_KIND(x) : 0;

Legend:
Removed from v.1735  
changed lines
  Added in v.1736

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge