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 476, Wed Feb 2 11:51:24 2005 UTC revision 478, Wed Feb 2 14:33:51 2005 UTC
# Line 1  Line 1 
1  #include "trMatrix.h"  #include "dtrMatrix.h"
2    
3  SEXP trMatrix_validate(SEXP obj)  SEXP dtrMatrix_validate(SEXP obj)
4  {  {
5      SEXP uplo = GET_SLOT(obj, Matrix_uploSym),      SEXP uplo = GET_SLOT(obj, Matrix_uploSym),
6          diag = GET_SLOT(obj, Matrix_diagSym);          diag = GET_SLOT(obj, Matrix_diagSym);
# Line 43  Line 43 
43  }  }
44    
45    
46  SEXP trMatrix_norm(SEXP obj, SEXP type)  SEXP dtrMatrix_norm(SEXP obj, SEXP type)
47  {  {
48      return ScalarReal(get_norm(obj, CHAR(asChar(type))));      return ScalarReal(get_norm(obj, CHAR(asChar(type))));
49  }  }
# Line 71  Line 71 
71      return rcond;      return rcond;
72  }  }
73    
74  SEXP trMatrix_rcond(SEXP obj, SEXP type)  SEXP dtrMatrix_rcond(SEXP obj, SEXP type)
75  {  {
76      return ScalarReal(set_rcond(obj, CHAR(asChar(type))));      return ScalarReal(set_rcond(obj, CHAR(asChar(type))));
77  }  }
78    
79  SEXP trMatrix_solve(SEXP a)  SEXP dtrMatrix_solve(SEXP a)
80  {  {
81      SEXP val = PROTECT(duplicate(a));      SEXP val = PROTECT(duplicate(a));
82      int info, *Dim = INTEGER(GET_SLOT(val, Matrix_DimSym));      int info, *Dim = INTEGER(GET_SLOT(val, Matrix_DimSym));
# Line 87  Line 87 
87      return val;      return val;
88  }  }
89    
90  SEXP trMatrix_matrix_solve(SEXP a, SEXP b)  SEXP dtrMatrix_matrix_solve(SEXP a, SEXP b)
91  {  {
92      SEXP val = PROTECT(duplicate(b));      SEXP val = PROTECT(duplicate(b));
93      int *Dim = INTEGER(GET_SLOT(a, Matrix_DimSym)),      int *Dim = INTEGER(GET_SLOT(a, Matrix_DimSym)),
# Line 132  Line 132 
132      }      }
133  }  }
134    
135  SEXP trMatrix_as_geMatrix(SEXP from)  SEXP dtrMatrix_as_dgeMatrix(SEXP from)
136  {  {
137      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("geMatrix")));      SEXP val = PROTECT(NEW_OBJECT(MAKE_CLASS("dgeMatrix")));
138    
139      SET_SLOT(val, Matrix_rcondSym,      SET_SLOT(val, Matrix_rcondSym,
140               duplicate(GET_SLOT(from, Matrix_rcondSym)));               duplicate(GET_SLOT(from, Matrix_rcondSym)));
# Line 147  Line 147 
147      return val;      return val;
148  }  }
149    
150  SEXP trMatrix_as_matrix(SEXP from)  SEXP dtrMatrix_as_matrix(SEXP from)
151  {  {
152      int *Dim = INTEGER(GET_SLOT(from, Matrix_DimSym));      int *Dim = INTEGER(GET_SLOT(from, Matrix_DimSym));
153      int m = Dim[0], n = Dim[1];      int m = Dim[0], n = Dim[1];
# Line 160  Line 160 
160      return val;      return val;
161  }  }
162    
163  SEXP trMatrix_getDiag(SEXP x)  SEXP dtrMatrix_getDiag(SEXP x)
164  {  {
165      int i, n = INTEGER(GET_SLOT(x, Matrix_DimSym))[0];      int i, n = INTEGER(GET_SLOT(x, Matrix_DimSym))[0];
166      SEXP ret = PROTECT(allocVector(REALSXP, n)),      SEXP ret = PROTECT(allocVector(REALSXP, n)),
# Line 177  Line 177 
177      return ret;      return ret;
178  }  }
179    
180  SEXP trMatrix_geMatrix_mm(SEXP a, SEXP b)  SEXP dtrMatrix_dgeMatrix_mm(SEXP a, SEXP b)
181  {  {
182      int *adims = INTEGER(GET_SLOT(a, Matrix_DimSym)),      int *adims = INTEGER(GET_SLOT(a, Matrix_DimSym)),
183          *bdims = INTEGER(GET_SLOT(b, Matrix_DimSym)),          *bdims = INTEGER(GET_SLOT(b, Matrix_DimSym)),
# Line 198  Line 198 
198      return val;      return val;
199  }  }
200    
201  SEXP trMatrix_geMatrix_mm_R(SEXP a, SEXP b)  SEXP dtrMatrix_dgeMatrix_mm_R(SEXP a, SEXP b)
202  {  {
203      int *adims = INTEGER(GET_SLOT(a, Matrix_DimSym)),      int *adims = INTEGER(GET_SLOT(a, Matrix_DimSym)),
204          *bdims = INTEGER(GET_SLOT(b, Matrix_DimSym)),          *bdims = INTEGER(GET_SLOT(b, Matrix_DimSym)),

Legend:
Removed from v.476  
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