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 3011, Mon Oct 6 17:00:48 2014 UTC revision 3018, Sat Oct 11 17:52:10 2014 UTC
# Line 345  Line 345 
345  SEXP Csparse_dense_prod(SEXP a, SEXP b)  SEXP Csparse_dense_prod(SEXP a, SEXP b)
346  {  {
347      CHM_SP cha = AS_CHM_SP(a);      CHM_SP cha = AS_CHM_SP(a);
348      SEXP b_M = PROTECT(mMatrix_as_dgeMatrix(b));      SEXP b_M = PROTECT(mMatrix_as_dgeMatrix2(b, // transpose_if_vector =
349                                                 cha->ncol == 1));
350      CHM_DN chb = AS_CHM_DN(b_M);      CHM_DN chb = AS_CHM_DN(b_M);
351      CHM_DN chc = cholmod_allocate_dense(cha->nrow, chb->ncol, cha->nrow,      CHM_DN chc = cholmod_allocate_dense(cha->nrow, chb->ncol, cha->nrow,
352                                          chb->xtype, &c);                                          chb->xtype, &c);
# Line 376  Line 377 
377  SEXP Csparse_dense_crossprod(SEXP a, SEXP b)  SEXP Csparse_dense_crossprod(SEXP a, SEXP b)
378  {  {
379      CHM_SP cha = AS_CHM_SP(a);      CHM_SP cha = AS_CHM_SP(a);
380      SEXP b_M = PROTECT(mMatrix_as_dgeMatrix(b));      SEXP b_M = PROTECT(mMatrix_as_dgeMatrix2(b, // transpose_if_vector =
381                                                 cha->nrow == 1));
382      CHM_DN chb = AS_CHM_DN(b_M);      CHM_DN chb = AS_CHM_DN(b_M);
383      CHM_DN chc = cholmod_allocate_dense(cha->ncol, chb->ncol, cha->ncol,      CHM_DN chc = cholmod_allocate_dense(cha->ncol, chb->ncol, cha->ncol,
384                                          chb->xtype, &c);                                          chb->xtype, &c);
# Line 584  Line 586 
586          ans = CHM_SUB(tmp, i, j);          ans = CHM_SUB(tmp, i, j);
587          cholmod_free_sparse(&tmp, &c);          cholmod_free_sparse(&tmp, &c);
588      }      }
589    
590      // "FIXME": currently dropping dimnames, and adding them afterwards in R :      // "FIXME": currently dropping dimnames, and adding them afterwards in R :
591        /* // dimnames: */
592        /* SEXP x_dns = GET_SLOT(x, Matrix_DimNamesSym), */
593        /*  dn = PROTECT(allocVector(VECSXP, 2)); */
594      return chm_sparse_to_SEXP(ans, 1, 0, Rkind, "", /* dimnames: */ R_NilValue);      return chm_sparse_to_SEXP(ans, 1, 0, Rkind, "", /* dimnames: */ R_NilValue);
595  }  }
596    

Legend:
Removed from v.3011  
changed lines
  Added in v.3018

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