SCM

SCM Repository

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

Diff of /pkg/src/Csparse.c

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

revision 1736, Tue Jan 23 17:09:41 2007 UTC revision 1751, Tue Jan 30 17:41:02 2007 UTC
# Line 40  Line 40 
40      return ScalarLogical(1);      return ScalarLogical(1);
41  }  }
42    
43    /* Called from ../R/Csparse.R : */
44    /* Can only return [dln]geMatrix (no symm/triang);
45     * FIXME: replace by non-CHOLMOD code ! */
46  SEXP Csparse_to_dense(SEXP x)  SEXP Csparse_to_dense(SEXP x)
47  {  {
48      cholmod_sparse *chxs = as_cholmod_sparse(x);      cholmod_sparse *chxs = as_cholmod_sparse(x);
49        /* This loses the symmetry property, since cholmod_dense has none,
50         * BUT, much worse (FIXME!), it also transforms CHOLMOD_PATTERN ("n") matrices
51         * to numeric (CHOLMOD_REAL) ones : */
52      cholmod_dense *chxd = cholmod_sparse_to_dense(chxs, &c);      cholmod_dense *chxd = cholmod_sparse_to_dense(chxs, &c);
53      int Rkind = (chxs->xtype == CHOLMOD_PATTERN)? 0 : Real_kind(x);      int Rkind = (chxs->xtype == CHOLMOD_PATTERN)? -1 : Real_kind(x);
54    
55      Free(chxs);      Free(chxs);
56      return chm_dense_to_SEXP(chxd, 1, Rkind, GET_SLOT(x, Matrix_DimNamesSym));      return chm_dense_to_SEXP(chxd, 1, Rkind, GET_SLOT(x, Matrix_DimNamesSym));

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

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