SCM

SCM Repository

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

Diff of /pkg/src/dense.c

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

revision 2298, Fri Oct 17 13:45:12 2008 UTC revision 2299, Fri Oct 17 16:07:38 2008 UTC
# Line 249  Line 249 
249  SEXP dense_to_Csparse(SEXP x)  SEXP dense_to_Csparse(SEXP x)
250  {  {
251      CHM_DN chxd = AS_CHM_DN(PROTECT(mMatrix_as_geMatrix(x)));      CHM_DN chxd = AS_CHM_DN(PROTECT(mMatrix_as_geMatrix(x)));
252      /* cholmod_dense_to_sparse() in CHOLMOD/Core/ below does only work for      /* cholmod_l_dense_to_sparse() in CHOLMOD/Core/ below does only work for
253         "REAL" 'xtypes', i.e. *not* for "nMatrix".         "REAL" 'xtypes', i.e. *not* for "nMatrix".
254         ===> need "_x" in above call.         ===> need "_x" in above call.
255    
256         Also it cannot keep symmetric / triangular, hence the         Also it cannot keep symmetric / triangular, hence the
257         as_geMatrix() above.  Note that this is already a *waste* for         as_geMatrix() above.  Note that this is already a *waste* for
258         symmetric matrices; However, we could conceivably use an         symmetric matrices; However, we could conceivably use an
259         enhanced cholmod_dense_to_sparse(), with an extra boolean         enhanced cholmod_l_dense_to_sparse(), with an extra boolean
260         argument for symmetry.         argument for symmetry.
261      */      */
262      CHM_SP chxs = cholmod_dense_to_sparse(chxd, 1, &c);      CHM_SP chxs = cholmod_l_dense_to_sparse(chxd, 1, &c);
263      int Rkind = (chxd->xtype == CHOLMOD_REAL) ? Real_KIND2(x) : 0;      int Rkind = (chxd->xtype == CHOLMOD_REAL) ? Real_KIND2(x) : 0;
264      /* Note: when 'x' was integer Matrix, Real_KIND(x) = -1, but *_KIND2(.) = 0 */      /* Note: when 'x' was integer Matrix, Real_KIND(x) = -1, but *_KIND2(.) = 0 */
265      R_CheckStack();      R_CheckStack();

Legend:
Removed from v.2298  
changed lines
  Added in v.2299

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