SCM

SCM Repository

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

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

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

revision 2685, Fri Aug 5 19:52:10 2011 UTC revision 2731, Mon Oct 17 18:07:09 2011 UTC
# Line 601  Line 601 
601      if (csize >= 0 && !isInteger(j))      if (csize >= 0 && !isInteger(j))
602          error(_("Index j must be NULL or integer"));          error(_("Index j must be NULL or integer"));
603    
604      if (chx->stype) /* symmetricMatrix */      if (!chx->stype) {/* non-symmetric Matrix */
         /* for now, cholmod_submatrix() only accepts "generalMatrix" */  
         chx = cholmod_copy(chx, /* stype: */ 0, chx->xtype, &c);  
   
605      return chm_sparse_to_SEXP(cholmod_submatrix(chx,      return chm_sparse_to_SEXP(cholmod_submatrix(chx,
606                                  (rsize < 0) ? NULL : INTEGER(i), rsize,                                  (rsize < 0) ? NULL : INTEGER(i), rsize,
607                                  (csize < 0) ? NULL : INTEGER(j), csize,                                  (csize < 0) ? NULL : INTEGER(j), csize,
# Line 612  Line 609 
609                                1, 0, Rkind, "",                                1, 0, Rkind, "",
610                                /* FIXME: drops dimnames */ R_NilValue);                                /* FIXME: drops dimnames */ R_NilValue);
611  }  }
612                                    /* for now, cholmod_submatrix() only accepts "generalMatrix" */
613        CHM_SP tmp = cholmod_copy(chx, /* stype: */ 0, chx->xtype, &c);
614        CHM_SP ans = cholmod_submatrix(tmp,
615                                       (rsize < 0) ? NULL : INTEGER(i), rsize,
616                                       (csize < 0) ? NULL : INTEGER(j), csize,
617                                       TRUE, TRUE, &c);
618        cholmod_free_sparse(&tmp, &c);
619        return chm_sparse_to_SEXP(ans, 1, 0, Rkind, "", R_NilValue);
620    }
621    
622  #define _d_Csp_  #define _d_Csp_
623  #include "t_Csparse_subassign.c"  #include "t_Csparse_subassign.c"

Legend:
Removed from v.2685  
changed lines
  Added in v.2731

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