SCM

SCM Repository

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

Diff of /pkg/src/dgeMatrix.c

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

revision 343, Mon Nov 15 23:29:28 2004 UTC revision 345, Tue Nov 23 15:35:55 2004 UTC
# Line 76  Line 76 
76    
77  SEXP geMatrix_crossprod(SEXP x)  SEXP geMatrix_crossprod(SEXP x)
78  {  {
79      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("poMatrix")));      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("poMatrix"))),
80            xslot;
81      int *Dims = INTEGER(GET_SLOT(x, Matrix_DimSym)),      int *Dims = INTEGER(GET_SLOT(x, Matrix_DimSym)),
82          *vDims;          *vDims;
83      int i, n = Dims[1];      int i, n = Dims[1];
# Line 89  Line 90 
90      SET_SLOT(val, Matrix_DimSym, allocVector(INTSXP, 2));      SET_SLOT(val, Matrix_DimSym, allocVector(INTSXP, 2));
91      vDims = INTEGER(GET_SLOT(val, Matrix_DimSym));      vDims = INTEGER(GET_SLOT(val, Matrix_DimSym));
92      vDims[0] = vDims[1] = n;      vDims[0] = vDims[1] = n;
93      SET_SLOT(val, Matrix_xSym, allocVector(REALSXP, n * n));      SET_SLOT(val, Matrix_xSym, allocVector(REALSXP, nsqr));
94      xvals = REAL(GET_SLOT(val, Matrix_xSym));      xvals = REAL(GET_SLOT(val, Matrix_xSym));
95      for (i = 0; i < nsqr; i++) xvals[i] = 0.; /* keep valgrind happy */      for (i = 0; i < nsqr; i++) xvals[i] = 0.; /* keep valgrind happy */
     if (Dims[0] > 0) {  
96          F77_CALL(dsyrk)("U", "T", vDims, Dims,          F77_CALL(dsyrk)("U", "T", vDims, Dims,
97                          &one, REAL(GET_SLOT(x, Matrix_xSym)), Dims,                          &one, REAL(GET_SLOT(x, Matrix_xSym)), Dims,
98                          &zero, REAL(GET_SLOT(val, Matrix_xSym)), vDims);                      &zero, xvals, vDims);
     }  
99      UNPROTECT(1);      UNPROTECT(1);
100      return val;      return val;
101  }  }

Legend:
Removed from v.343  
changed lines
  Added in v.345

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