SCM

SCM Repository

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

Diff of /pkg/src/dsyMatrix.c

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

revision 2004, Tue Jul 17 22:12:30 2007 UTC revision 2005, Wed Jul 18 14:46:20 2007 UTC
# Line 94  Line 94 
94      return val;      return val;
95  }  }
96    
97  SEXP dsyMatrix_as_matrix(SEXP from)  SEXP dsyMatrix_as_matrix(SEXP from, SEXP keep_dimnames)
98  {  {
99      int n = INTEGER(GET_SLOT(from, Matrix_DimSym))[0];      int n = INTEGER(GET_SLOT(from, Matrix_DimSym))[0];
100      SEXP val = PROTECT(allocMatrix(REALSXP, n, n));      SEXP val = PROTECT(allocMatrix(REALSXP, n, n));
# Line 102  Line 102 
102      make_d_matrix_symmetric(Memcpy(REAL(val),      make_d_matrix_symmetric(Memcpy(REAL(val),
103                                     REAL(GET_SLOT(from, Matrix_xSym)), n * n),                                     REAL(GET_SLOT(from, Matrix_xSym)), n * n),
104                              from);                              from);
105        if(asLogical(keep_dimnames))
106      setAttrib(val, R_DimNamesSymbol, GET_SLOT(from, Matrix_DimNamesSym));      setAttrib(val, R_DimNamesSymbol, GET_SLOT(from, Matrix_DimNamesSym));
107      UNPROTECT(1);      UNPROTECT(1);
108      return val;      return val;

Legend:
Removed from v.2004  
changed lines
  Added in v.2005

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