SCM

SCM Repository

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

Diff of /pkg/Matrix/src/dtCMatrix.c

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

revision 1310, Thu Jul 6 15:27:14 2006 UTC revision 1386, Thu Aug 17 22:30:40 2006 UTC
# Line 8  Line 8 
8      /* see ./dsCMatrix.c or ./dtpMatrix.c  on how to do more testing here */      /* see ./dsCMatrix.c or ./dtpMatrix.c  on how to do more testing here */
9  }  }
10    
 #if 0  
 SEXP tsc_transpose(SEXP x)  
 {  
     cholmod_sparse *cx = as_cholmod_sparse(x);  
   
     SEXP ans = PROTECT(NEW_OBJECT(MAKE_CLASS("dtCMatrix"))),  
         islot = GET_SLOT(x, Matrix_iSym);  
     int nnz = length(islot),  
         *adims, *xdims = INTEGER(GET_SLOT(x, Matrix_DimSym));  
     int up = uplo_P(x)[0] == 'U';  
   
     adims = INTEGER(ALLOC_SLOT(ans, Matrix_DimSym, INTSXP, 2));  
     adims[0] = xdims[1]; adims[1] = xdims[0];  
   
     if(*diag_P(x) == 'U')  
         SET_SLOT(ans, Matrix_diagSym, duplicate(GET_SLOT(x, Matrix_diagSym)));  
     SET_SLOT(ans, Matrix_uploSym, mkString(up ? "L" : "U"));  
   
     csc_compTr(xdims[0], xdims[1], nnz,  
                INTEGER(GET_SLOT(x, Matrix_pSym)), INTEGER(islot),  
                REAL(GET_SLOT(x, Matrix_xSym)),  
                INTEGER(ALLOC_SLOT(ans, Matrix_pSym, INTSXP, xdims[0] + 1)),  
                INTEGER(ALLOC_SLOT(ans, Matrix_iSym, INTSXP, nnz)),  
                REAL(ALLOC_SLOT(ans, Matrix_xSym, REALSXP, nnz)));  
     UNPROTECT(1);  
     return ans;  
 }  
 #endif  
11    
12  SEXP tsc_to_dgTMatrix(SEXP x)  SEXP tsc_to_dgTMatrix(SEXP x)
13  {  {
# Line 274  Line 246 
246      double *ax = REAL(GET_SLOT(a, Matrix_xSym)), *tx = Calloc(bnz, double),      double *ax = REAL(GET_SLOT(a, Matrix_xSym)), *tx = Calloc(bnz, double),
247          *tmp = Calloc(n, double);          *tmp = Calloc(n, double);
248    
249      if (lo || (!unit)) error(_("Code written for unit upper triangular unit matrices"));      if (lo || (!unit))
250            error(_("Code written for unit upper triangular unit matrices"));
251      bp[0] = 0;      bp[0] = 0;
252      for (j = 0; j < n; j++) {      for (j = 0; j < n; j++) {
253          int i, i1 = ap[j + 1];          int i, i1 = ap[j + 1];

Legend:
Removed from v.1310  
changed lines
  Added in v.1386

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge