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 3272, Fri Mar 23 15:29:36 2018 UTC revision 3273, Sat Mar 24 16:29:40 2018 UTC
# Line 349  Line 349 
349          }          }
350          else {          else {
351              /* Copy ans to a *trMatrix object (must be square) */              /* Copy ans to a *trMatrix object (must be square) */
352              SEXP aa= PROTECT(NEW_OBJECT(MAKE_CLASS(M_type == ddense? "dtrMatrix":              SEXP aa= PROTECT(NEW_OBJECT_OF_CLASS(M_type == ddense? "dtrMatrix":
353                                                     (M_type== ldense? "ltrMatrix"                                                   (M_type== ldense? "ltrMatrix": "ntrMatrix")));
                                                     : "ntrMatrix"))));  
354              /* Because slots of ans are freshly allocated and ans will not be              /* Because slots of ans are freshly allocated and ans will not be
355               * used, we use the slots themselves and don't duplicate */               * used, we use the slots themselves and don't duplicate */
356              SET_SLOT(aa, Matrix_xSym,       GET_SLOT(ans, Matrix_xSym));              SET_SLOT(aa, Matrix_xSym,       GET_SLOT(ans, Matrix_xSym));
# Line 409  Line 408 
408      }      }
409  #   undef CHECK_SYMMETRIC  #   undef CHECK_SYMMETRIC
410    
411      ans = PROTECT(NEW_OBJECT(MAKE_CLASS( M_type == ddense ? "dsyMatrix" :      ans = PROTECT(NEW_OBJECT_OF_CLASS(M_type == ddense ? "dsyMatrix" :
412                                          (M_type == ldense ? "lsyMatrix" :                                        (M_type == ldense ? "lsyMatrix" : "nsyMatrix")));
                                          "nsyMatrix"))));  
   
413    
414  // --- FIXME: Use MK_SYMMETRIC_DIMNAMES_AND_RETURN  from below -- with "uplo" argument  // --- FIXME: Use MK_SYMMETRIC_DIMNAMES_AND_RETURN  from below -- with "uplo" argument
415    
# Line 459  Line 456 
456          return R_NilValue; /* -Wall */          return R_NilValue; /* -Wall */
457      } else {      } else {
458          PROTECT(dx);          PROTECT(dx);
459          SEXP ans = PROTECT(NEW_OBJECT(MAKE_CLASS("dsyMatrix"))), dns, nms_dns;          SEXP ans = PROTECT(NEW_OBJECT_OF_CLASS("dsyMatrix")), dns, nms_dns;
460          double *xx = REAL(GET_SLOT(dx, Matrix_xSym));          double *xx = REAL(GET_SLOT(dx, Matrix_xSym));
461    
462          /* only need to assign the *upper* triangle (uplo = "U");          /* only need to assign the *upper* triangle (uplo = "U");
# Line 518  Line 515 
515          return R_NilValue; /* -Wall */          return R_NilValue; /* -Wall */
516      } else {      } else {
517          PROTECT(dx);          PROTECT(dx);
518          SEXP ans = PROTECT(NEW_OBJECT(MAKE_CLASS("dgeMatrix"))), dns, nms_dns;          SEXP ans = PROTECT(NEW_OBJECT_OF_CLASS("dgeMatrix")), dns, nms_dns;
519          double *xx = REAL(GET_SLOT(dx, Matrix_xSym));          double *xx = REAL(GET_SLOT(dx, Matrix_xSym));
520    
521          for (int j = 0; j < n; j++) {          for (int j = 0; j < n; j++) {

Legend:
Removed from v.3272  
changed lines
  Added in v.3273

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