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 3204, Tue Feb 7 11:17:03 2017 UTC revision 3213, Tue Apr 18 20:14:20 2017 UTC
# Line 413  Line 413 
413      tmp = VECTOR_ELT(dn, 0);    /* swap the dimnames */      tmp = VECTOR_ELT(dn, 0);    /* swap the dimnames */
414      SET_VECTOR_ELT(dn, 0, VECTOR_ELT(dn, 1));      SET_VECTOR_ELT(dn, 0, VECTOR_ELT(dn, 1));
415      SET_VECTOR_ELT(dn, 1, tmp);      SET_VECTOR_ELT(dn, 1, tmp);
416      if(!isNull(tmp = getAttrib(dn, R_NamesSymbol))) { // swap names(dimnames(.)):      tmp = PROTECT(getAttrib(dn, R_NamesSymbol));
417        if(!isNull(tmp)) { // swap names(dimnames(.)):
418          SEXP nms_dns = PROTECT(allocVector(VECSXP, 2));          SEXP nms_dns = PROTECT(allocVector(VECSXP, 2));
419          SET_VECTOR_ELT(nms_dns, 1, STRING_ELT(tmp, 0));          SET_VECTOR_ELT(nms_dns, 1, STRING_ELT(tmp, 0));
420          SET_VECTOR_ELT(nms_dns, 0, STRING_ELT(tmp, 1));          SET_VECTOR_ELT(nms_dns, 0, STRING_ELT(tmp, 1));
421          setAttrib(dn, R_NamesSymbol, nms_dns);          setAttrib(dn, R_NamesSymbol, nms_dns);
422          UNPROTECT(1);          UNPROTECT(1);
423      }      }
424      UNPROTECT(1);  
425      return chm_sparse_to_SEXP(chxt, 1, /* SWAP 'uplo' for triangular */      SEXP ans = chm_sparse_to_SEXP(chxt, 1, /* SWAP 'uplo' for triangular */
426                                tr ? ((*uplo_P(x) == 'U') ? -1 : 1) : 0,                                tr ? ((*uplo_P(x) == 'U') ? -1 : 1) : 0,
427                                Rkind, tr ? diag_P(x) : "", dn);                                Rkind, tr ? diag_P(x) : "", dn);
428        UNPROTECT(2);
429        return ans;
430  }  }
431    
432  /** @brief  A %*% B  - for matrices of class CsparseMatrix (R package "Matrix")  /** @brief  A %*% B  - for matrices of class CsparseMatrix (R package "Matrix")

Legend:
Removed from v.3204  
changed lines
  Added in v.3213

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge