SCM

SCM Repository

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

Diff of /pkg/src/Tsparse.c

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

revision 1365, Thu Aug 10 18:52:55 2006 UTC revision 1366, Sat Aug 12 17:31:39 2006 UTC
# Line 28  Line 28 
28      return ScalarLogical(1);      return ScalarLogical(1);
29  }  }
30    
31  SEXP Tsparse_to_Csparse(SEXP x)  SEXP Tsparse_to_Csparse(SEXP x, SEXP tri)
32  {  {
33      cholmod_triplet *chxt = as_cholmod_triplet(x);      cholmod_triplet *chxt = as_cholmod_triplet(x);
34      cholmod_sparse *chxs = cholmod_triplet_to_sparse(chxt, chxt->nnz, &c);      cholmod_sparse *chxs = cholmod_triplet_to_sparse(chxt, chxt->nnz, &c);
35        int uploT = 0; char *diag = "";
36    
37      Free(chxt);      Free(chxt);
38      return chm_sparse_to_SEXP(chxs, 1);      if (asLogical(tri)) {       /* triangular sparse matrices */
39            uploT = (strcmp(CHAR(asChar(GET_SLOT(x, Matrix_uploSym))), "U")) ?
40                -1 : 1;
41            diag = CHAR(asChar(GET_SLOT(x, Matrix_diagSym)));
42        }
43        return chm_sparse_to_SEXP(chxs, 1, uploT, diag,
44                                  duplicate(GET_SLOT(x, Matrix_DimNamesSym)));
45  }  }
46    

Legend:
Removed from v.1365  
changed lines
  Added in v.1366

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