SCM

SCM Repository

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

Diff of /pkg/src/dtrMatrix.c

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

revision 1164, Sat Jan 14 23:40:42 2006 UTC revision 1167, Sun Jan 15 21:13:54 2006 UTC
# Line 45  Line 45 
45      return ScalarReal(get_norm(obj, CHAR(asChar(type))));      return ScalarReal(get_norm(obj, CHAR(asChar(type))));
46  }  }
47    
48  static  SEXP dtrMatrix_rcond(SEXP obj, SEXP type)
 double set_rcond(SEXP obj, char *typstr)  
49  {  {
50      char typnm[] = {'\0', '\0'};      char typnm[] = {'\0', '\0'};
     SEXP rcv = GET_SLOT(obj, Matrix_rcondSym);  
     double rcond = get_double_by_name(rcv, typnm);  
   
     typnm[0] = rcond_type(typstr);  
     if (R_IsNA(rcond)) {  
51          int *dims = INTEGER(GET_SLOT(obj, Matrix_DimSym)), info;          int *dims = INTEGER(GET_SLOT(obj, Matrix_DimSym)), info;
52        double rcond;
53    
54        typnm[0] = rcond_type(CHAR(asChar(type)));
55          F77_CALL(dtrcon)(typnm, uplo_P(obj), diag_P(obj), dims,          F77_CALL(dtrcon)(typnm, uplo_P(obj), diag_P(obj), dims,
56                           REAL(GET_SLOT(obj, Matrix_xSym)), dims, &rcond,                           REAL(GET_SLOT(obj, Matrix_xSym)), dims, &rcond,
57                           (double *) R_alloc(3*dims[0], sizeof(double)),                           (double *) R_alloc(3*dims[0], sizeof(double)),
58                           (int *) R_alloc(dims[0], sizeof(int)), &info);                           (int *) R_alloc(dims[0], sizeof(int)), &info);
59          SET_SLOT(obj, Matrix_rcondSym,      return ScalarReal(rcond);
                  set_double_by_name(rcv, rcond, typnm));  
     }  
     return rcond;  
 }  
   
 SEXP dtrMatrix_rcond(SEXP obj, SEXP type)  
 {  
     return ScalarReal(set_rcond(obj, CHAR(asChar(type))));  
60  }  }
61    
62  SEXP dtrMatrix_solve(SEXP a)  SEXP dtrMatrix_solve(SEXP a)
# Line 138  Line 127 
127  {  {
128      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("dgeMatrix")));      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("dgeMatrix")));
129    
     SET_SLOT(val, Matrix_rcondSym, duplicate(GET_SLOT(from, Matrix_rcondSym)));  
130      SET_SLOT(val, Matrix_xSym, duplicate(GET_SLOT(from, Matrix_xSym)));      SET_SLOT(val, Matrix_xSym, duplicate(GET_SLOT(from, Matrix_xSym)));
131      SET_SLOT(val, Matrix_DimSym, duplicate(GET_SLOT(from, Matrix_DimSym)));      SET_SLOT(val, Matrix_DimSym, duplicate(GET_SLOT(from, Matrix_DimSym)));
132      SET_SLOT(val, Matrix_DimNamesSym, duplicate(GET_SLOT(from, Matrix_DimNamesSym)));      SET_SLOT(val, Matrix_DimNamesSym, duplicate(GET_SLOT(from, Matrix_DimNamesSym)));
# Line 205  Line 193 
193          dimP = GET_SLOT(from, Matrix_DimSym);          dimP = GET_SLOT(from, Matrix_DimSym);
194      int n = *INTEGER(dimP);      int n = *INTEGER(dimP);
195    
     SET_SLOT(val, Matrix_rcondSym,  
              duplicate(GET_SLOT(from, Matrix_rcondSym)));  
196      SET_SLOT(val, Matrix_DimSym, duplicate(dimP));      SET_SLOT(val, Matrix_DimSym, duplicate(dimP));
197      SET_SLOT(val, Matrix_diagSym, duplicate(diag));      SET_SLOT(val, Matrix_diagSym, duplicate(diag));
198      SET_SLOT(val, Matrix_uploSym, duplicate(uplo));      SET_SLOT(val, Matrix_uploSym, duplicate(uplo));

Legend:
Removed from v.1164  
changed lines
  Added in v.1167

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