SCM

SCM Repository

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

Diff of /pkg/src/ssclme.c

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

revision 28, Sun Mar 28 17:06:05 2004 UTC revision 34, Mon Mar 29 01:49:38 2004 UTC
# Line 924  Line 924 
924      ssclme_invert(x);      ssclme_invert(x);
925      ryyinv = REAL(GET_SLOT(x, Matrix_RXXSym))[pp1*pp1 - 1];      ryyinv = REAL(GET_SLOT(x, Matrix_RXXSym))[pp1*pp1 - 1];
926      for (i = 0; i < nf; i++) {      for (i = 0; i < nf; i++) {
927          int nci = nc[i], Mi = (Gp[i+1] - Gp[i]), mi = Mi/nci;          int nci = nc[i], Mi = Gp[i+1] - Gp[i];
928          double *mm;          double *mm;
929    
930          SET_VECTOR_ELT(val, i, allocMatrix(REALSXP, nci, mi));          SET_VECTOR_ELT(val, i, allocMatrix(REALSXP, nci, Mi/nci));
931          mm = Memcpy(REAL(VECTOR_ELT(val, i)), b, Mi);          mm = Memcpy(REAL(VECTOR_ELT(val, i)), b, Mi);
932          b += nci * mi;          b += Mi;
933          for (j = 0; j < Mi; j++) mm[j] /= ryyinv;          for (j = 0; j < Mi; j++) mm[j] /= ryyinv;
934      }      }
935      UNPROTECT(1);      UNPROTECT(1);
936      return val;      return val;
937  }  }
938    
939  /**  /**
940   * Extract the ML or REML conditional estimate of sigma   * Extract the ML or REML conditional estimate of sigma
941   *   *
# Line 1237  Line 1238 
1238      return val;      return val;
1239  }  }
1240    
   
1241  SEXP ssclme_fitted(SEXP x, SEXP facs, SEXP mmats)  SEXP ssclme_fitted(SEXP x, SEXP facs, SEXP mmats)
1242  {  {
1243      SEXP val, b;      SEXP val, b;
# Line 1271  Line 1271 
1271              while (ff[j + nn] == lev) nn++;              while (ff[j + nn] == lev) nn++;
1272              F77_CALL(dgemm)("N", "N", &nn, &ione, &nci,              F77_CALL(dgemm)("N", "N", &nn, &ione, &nci,
1273                              &one, mm + j, &nobs,                              &one, mm + j, &nobs,
1274                              bb + lev - 1, &nci,                              bb + (lev - 1) * nci, &nci,
1275                              &one, vv + j, &nobs);                              &one, vv + j, &nobs);
1276              j += nn;              j += nn;
1277          }          }

Legend:
Removed from v.28  
changed lines
  Added in v.34

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