SCM

SCM Repository

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

Diff of /pkg/src/dpoMatrix.c

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

revision 477, Wed Feb 2 14:14:59 2005 UTC revision 478, Wed Feb 2 14:33:51 2005 UTC
# Line 1  Line 1 
1  #include "poMatrix.h"  #include "dpoMatrix.h"
2    
3  SEXP poMatrix_chol(SEXP x)  SEXP dpoMatrix_chol(SEXP x)
4  {  {
5      SEXP val = get_factors(x, "Cholesky"),      SEXP val = get_factors(x, "Cholesky"),
6          dimP = GET_SLOT(x, Matrix_DimSym),          dimP = GET_SLOT(x, Matrix_DimSym),
# Line 31  Line 31 
31      double rcond = get_double_by_name(rcv, typnm);      double rcond = get_double_by_name(rcv, typnm);
32    
33      if (R_IsNA(rcond)) {      if (R_IsNA(rcond)) {
34          SEXP Chol = poMatrix_chol(obj);          SEXP Chol = dpoMatrix_chol(obj);
35          int *dims = INTEGER(GET_SLOT(Chol, Matrix_DimSym)), info;          int *dims = INTEGER(GET_SLOT(Chol, Matrix_DimSym)), info;
36          double anorm = get_norm_sy(obj, typnm);          double anorm = get_norm_sy(obj, typnm);
37    
# Line 46  Line 46 
46      return rcond;      return rcond;
47  }  }
48    
49  SEXP poMatrix_rcond(SEXP obj, SEXP type)  SEXP dpoMatrix_rcond(SEXP obj, SEXP type)
50  {  {
51    return ScalarReal(set_rcond(obj, CHAR(asChar(type))));    return ScalarReal(set_rcond(obj, CHAR(asChar(type))));
52  }  }
53    
54  SEXP poMatrix_solve(SEXP x)  SEXP dpoMatrix_solve(SEXP x)
55  {  {
56      SEXP Chol = poMatrix_chol(x);      SEXP Chol = dpoMatrix_chol(x);
57      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("poMatrix")));      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("dpoMatrix")));
58      int *dims = INTEGER(GET_SLOT(x, Matrix_DimSym)), info;      int *dims = INTEGER(GET_SLOT(x, Matrix_DimSym)), info;
59    
60      SET_SLOT(val, Matrix_factorSym, allocVector(VECSXP, 0));      SET_SLOT(val, Matrix_factorSym, allocVector(VECSXP, 0));
# Line 68  Line 68 
68      return val;      return val;
69  }  }
70    
71  SEXP poMatrix_geMatrix_solve(SEXP a, SEXP b)  SEXP dpoMatrix_dgeMatrix_solve(SEXP a, SEXP b)
72  {  {
73      SEXP Chol = poMatrix_chol(a),      SEXP Chol = dpoMatrix_chol(a),
74          val = PROTECT(NEW_OBJECT(MAKE_CLASS("geMatrix")));          val = PROTECT(NEW_OBJECT(MAKE_CLASS("dgeMatrix")));
75      int *adims = INTEGER(GET_SLOT(a, Matrix_DimSym)),      int *adims = INTEGER(GET_SLOT(a, Matrix_DimSym)),
76          *bdims = INTEGER(GET_SLOT(b, Matrix_DimSym)),          *bdims = INTEGER(GET_SLOT(b, Matrix_DimSym)),
77          info;          info;
# Line 91  Line 91 
91      return val;      return val;
92  }  }
93    
94  SEXP poMatrix_matrix_solve(SEXP a, SEXP b)  SEXP dpoMatrix_matrix_solve(SEXP a, SEXP b)
95  {  {
96      SEXP Chol = poMatrix_chol(a),      SEXP Chol = dpoMatrix_chol(a),
97          val = PROTECT(duplicate(b));          val = PROTECT(duplicate(b));
98      int *adims = INTEGER(GET_SLOT(a, Matrix_DimSym)),      int *adims = INTEGER(GET_SLOT(a, Matrix_DimSym)),
99          *bdims = INTEGER(getAttrib(b, R_DimSymbol)),          *bdims = INTEGER(getAttrib(b, R_DimSymbol)),

Legend:
Removed from v.477  
changed lines
  Added in v.478

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