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 1959, Fri Jul 6 16:40:47 2007 UTC revision 1960, Fri Jul 6 16:54:43 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_x_dense(PROTECT(mMatrix_as_geMatrix(x)));      CHM_DN chxd = AS_CHM_DN(PROTECT(mMatrix_as_geMatrix(x)));
252        R_CheckStack();
253    
254      /* cholmod_dense_to_sparse() in CHOLMOD/Core/ below does only work for      /* cholmod_dense_to_sparse() in CHOLMOD/Core/ below does only work for
255         "REAL" 'xtypes', i.e. *not* for "nMatrix".         "REAL" 'xtypes', i.e. *not* for "nMatrix".
# Line 260  Line 261 
261         enhanced cholmod_dense_to_sparse(), with an extra boolean         enhanced cholmod_dense_to_sparse(), with an extra boolean
262         argument for symmetry.         argument for symmetry.
263      */      */
264      cholmod_sparse *chxs = cholmod_dense_to_sparse(chxd, 1, &c);      CHM_SP chxs = cholmod_dense_to_sparse(chxd, 1, &c);
265      int Rkind = (chxd->xtype == CHOLMOD_REAL) ? Real_KIND(x) : 0;      int Rkind = (chxd->xtype == CHOLMOD_REAL) ? Real_KIND(x) : 0;
266    
267      Free(chxd); UNPROTECT(1);      UNPROTECT(1);
268      /* chm_sparse_to_SEXP() *could* deal with symmetric      /* chm_sparse_to_SEXP() *could* deal with symmetric
269       * if chxs had such an stype; and we should be able to use uplo below */       * if chxs had such an stype; and we should be able to use uplo below */
270      return chm_sparse_to_SEXP(chxs, 1, 0/*TODO: uplo_P(x) if x has an uplo slot*/,      return chm_sparse_to_SEXP(chxs, 1, 0/*TODO: uplo_P(x) if x has an uplo slot*/,

Legend:
Removed from v.1959  
changed lines
  Added in v.1960

root@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