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 945, Wed Sep 28 08:54:28 2005 UTC revision 1209, Wed Jan 25 23:42:57 2006 UTC
# Line 7  Line 7 
7      /* 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 */
8  }  }
9    
10    #if 0
11  SEXP tsc_transpose(SEXP x)  SEXP tsc_transpose(SEXP x)
12  {  {
13        cholmod_sparse *cx = as_cholmod_sparse(x);
14    
15      SEXP ans = PROTECT(NEW_OBJECT(MAKE_CLASS("dtCMatrix"))),      SEXP ans = PROTECT(NEW_OBJECT(MAKE_CLASS("dtCMatrix"))),
16          islot = GET_SLOT(x, Matrix_iSym);          islot = GET_SLOT(x, Matrix_iSym);
17      int nnz = length(islot),      int nnz = length(islot),
18          *adims, *xdims = INTEGER(GET_SLOT(x, Matrix_DimSym));          *adims, *xdims = INTEGER(GET_SLOT(x, Matrix_DimSym));
19      int up = CHAR(asChar(GET_SLOT(x, Matrix_uploSym)))[0] == 'U';      int up = uplo_P(x)[0] == 'U';
20    
21      adims = INTEGER(ALLOC_SLOT(ans, Matrix_DimSym, INTSXP, 2));      adims = INTEGER(ALLOC_SLOT(ans, Matrix_DimSym, INTSXP, 2));
22      adims[0] = xdims[1]; adims[1] = xdims[0];      adims[0] = xdims[1]; adims[1] = xdims[0];
23    
24      if(diag_value(x) == 'U')      if(*diag_P(x) == 'U')
25          SET_SLOT(ans, Matrix_diagSym, duplicate(GET_SLOT(x, Matrix_diagSym)));          SET_SLOT(ans, Matrix_diagSym, duplicate(GET_SLOT(x, Matrix_diagSym)));
26      SET_SLOT(ans, Matrix_uploSym, mkString(up ? "L" : "U"));      SET_SLOT(ans, Matrix_uploSym, mkString(up ? "L" : "U"));
27    
# Line 31  Line 34 
34      UNPROTECT(1);      UNPROTECT(1);
35      return ans;      return ans;
36  }  }
37    #endif
38    
39  SEXP tsc_to_dgTMatrix(SEXP x)  SEXP tsc_to_dgTMatrix(SEXP x)
40  {  {
41      SEXP ans;      SEXP ans;
42      if (CHAR(STRING_ELT(GET_SLOT(x, Matrix_diagSym), 0))[0] != 'U')      if (*diag_P(x) != 'U')
43          ans = compressed_to_dgTMatrix(x, ScalarLogical(1));          ans = compressed_to_dgTMatrix(x, ScalarLogical(1));
44      else {                      /* unit triangular matrix */      else {                      /* unit triangular matrix */
45          SEXP islot = GET_SLOT(x, Matrix_iSym),          SEXP islot = GET_SLOT(x, Matrix_iSym),

Legend:
Removed from v.945  
changed lines
  Added in v.1209

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