SCM

SCM Repository

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

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

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

revision 3010, Mon Oct 6 16:59:57 2014 UTC revision 3011, Mon Oct 6 17:00:48 2014 UTC
# Line 215  Line 215 
215      // Assuming that ans will have the same basic Matrix type as x :      // Assuming that ans will have the same basic Matrix type as x :
216      ans = PROTECT(NEW_OBJECT(MAKE_CLASS(valid_cM[ctype_x])));      ans = PROTECT(NEW_OBJECT(MAKE_CLASS(valid_cM[ctype_x])));
217      SET_SLOT(ans, Matrix_DimSym,      duplicate(dimslot));      SET_SLOT(ans, Matrix_DimSym,      duplicate(dimslot));
218      SET_SLOT(ans, Matrix_DimNamesSym, duplicate(GET_SLOT(x, Matrix_DimNamesSym)));      slot_dup(ans, x, Matrix_DimNamesSym);
219      SET_SLOT(ans, Matrix_pSym,        duplicate(GET_SLOT(x, Matrix_pSym)));      slot_dup(ans, x, Matrix_pSym);
220      SEXP r_pslot = GET_SLOT(ans, Matrix_pSym);      SEXP r_pslot = GET_SLOT(ans, Matrix_pSym);
221      // and assign the i- and x- slots at the end, as they are potentially modified      // and assign the i- and x- slots at the end, as they are potentially modified
222      // not just in content, but also in their *length*      // not just in content, but also in their *length*
# Line 419  Line 419 
419      }// for( jj )      }// for( jj )
420    
421      if(ctype_x == 1) { // triangularMatrix: copy the 'diag' and 'uplo' slots      if(ctype_x == 1) { // triangularMatrix: copy the 'diag' and 'uplo' slots
422          SET_SLOT(ans, Matrix_uploSym, duplicate(GET_SLOT(x, Matrix_uploSym)));          slot_dup(ans, x, Matrix_uploSym);
423          SET_SLOT(ans, Matrix_diagSym, duplicate(GET_SLOT(x, Matrix_diagSym)));          slot_dup(ans, x, Matrix_diagSym);
424      }      }
425      // now assign the i- and x- slots,  free memory and return :      // now assign the i- and x- slots,  free memory and return :
426      Memcpy(INTEGER(ALLOC_SLOT(ans, Matrix_iSym,  INTSXP, nnz)), ri, nnz);      Memcpy(INTEGER(ALLOC_SLOT(ans, Matrix_iSym,  INTSXP, nnz)), ri, nnz);

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

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