SCM

SCM Repository

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

Diff of /pkg/src/geMatrix.c

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

revision 341, Fri Nov 12 21:20:14 2004 UTC revision 342, Mon Nov 15 13:55:52 2004 UTC
# Line 78  Line 78 
78  {  {
79      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("poMatrix")));      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("poMatrix")));
80      int *Dims = INTEGER(GET_SLOT(x, Matrix_DimSym)),      int *Dims = INTEGER(GET_SLOT(x, Matrix_DimSym)),
81          *vDims = INTEGER(GET_SLOT(val, Matrix_DimSym));          *vDims;
82      int k = Dims[0], n = Dims[1];      int n = Dims[1];
83      double one = 1.0, zero = 0.0;      double one = 1.0, zero = 0.0;
84    
85      SET_SLOT(val, Matrix_factorization, allocVector(VECSXP, 0));      SET_SLOT(val, Matrix_factorization, allocVector(VECSXP, 0));
86      SET_SLOT(val, Matrix_rcondSym, allocVector(REALSXP, 0));      SET_SLOT(val, Matrix_rcondSym, allocVector(REALSXP, 0));
87      SET_SLOT(val, Matrix_uploSym, ScalarString(mkChar("U")));      SET_SLOT(val, Matrix_uploSym, ScalarString(mkChar("U")));
88        SET_SLOT(val, Matrix_DimSym, allocVector(INTSXP, 2));
89        vDims = INTEGER(GET_SLOT(val, Matrix_DimSym));
90      vDims[0] = vDims[1] = n;      vDims[0] = vDims[1] = n;
91      SET_SLOT(val, Matrix_xSym, allocVector(REALSXP, n * n));      SET_SLOT(val, Matrix_xSym, allocVector(REALSXP, n * n));
92      if (k > 0) {      if (Dims[0] > 0) {
93          F77_CALL(dsyrk)("U", "T", &n, &k,          F77_CALL(dsyrk)("U", "T", vDims, Dims,
94                          &one, REAL(GET_SLOT(x, Matrix_xSym)), &k,                          &one, REAL(GET_SLOT(x, Matrix_xSym)), Dims,
95                          &zero, REAL(GET_SLOT(val, Matrix_xSym)), &n);                          &zero, REAL(GET_SLOT(val, Matrix_xSym)), vDims);
96      } else {      } else {
97          int i, nsqr = n * n;          int i, nsqr = n * n;
98          double *xvals = REAL(GET_SLOT(val, Matrix_xSym));          double *xvals = REAL(GET_SLOT(val, Matrix_xSym));

Legend:
Removed from v.341  
changed lines
  Added in v.342

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