SCM

SCM Repository

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

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

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

revision 1555, Wed Sep 13 14:47:28 2006 UTC revision 1598, Fri Sep 29 09:39:34 2006 UTC
# Line 4  Line 4 
4    
5  SEXP Csparse_validate(SEXP x)  SEXP Csparse_validate(SEXP x)
6  {  {
7        /* NB: we do *NOT* check a potential 'x' slot here, at all */
8      cholmod_sparse *chx = as_cholmod_sparse(x);      cholmod_sparse *chx = as_cholmod_sparse(x);
9      SEXP pslot = GET_SLOT(x, Matrix_pSym),      SEXP pslot = GET_SLOT(x, Matrix_pSym),
10          islot = GET_SLOT(x, Matrix_iSym);          islot = GET_SLOT(x, Matrix_iSym);
# Line 104  Line 105 
105                                GET_SLOT(x, Matrix_DimNamesSym));                                GET_SLOT(x, Matrix_DimNamesSym));
106  }  }
107    
108    #ifdef _not_yet_FIXME_
109    /* MM: This would seem useful; e.g. lsC* can hardly be coerced to ! */
110    SEXP Csparse_general_to_symmetric(SEXP x,
111                                      int stype)/*-1 : "L", +1 : "U" */
112    {
113        cholmod_sparse *chx = as_cholmod_sparse(x), *chgx;
114        int Rkind = (chx->xtype == CHOLMOD_REAL) ? Real_kind(x) : 0;
115    
116        chgx = cholmod_copy(chx, /* stype: */ stype, chx->xtype, &c);
117        /* xtype: pattern, "real", complex or .. */
118        Free(chx);
119        return chm_sparse_to_SEXP(chgx, 1, 0, Rkind, "",
120                                  GET_SLOT(x, Matrix_DimNamesSym));
121    }
122    
123    #endif
124    
125  SEXP Csparse_transpose(SEXP x, SEXP tri)  SEXP Csparse_transpose(SEXP x, SEXP tri)
126  {  {
127      cholmod_sparse *chx = as_cholmod_sparse(x);      cholmod_sparse *chx = as_cholmod_sparse(x);
128        int Rkind = (chx->xtype == CHOLMOD_REAL) ? Real_kind(x) : 0;
129      cholmod_sparse *chxt = cholmod_transpose(chx, (int) chx->xtype, &c);      cholmod_sparse *chxt = cholmod_transpose(chx, (int) chx->xtype, &c);
130      SEXP dn = PROTECT(duplicate(GET_SLOT(x, Matrix_DimNamesSym))), tmp;      SEXP dn = PROTECT(duplicate(GET_SLOT(x, Matrix_DimNamesSym))), tmp;
131      int uploT = 0; char *diag = "";      int uploT = 0; char *diag = "";
     int Rkind = (chx->xtype == CHOLMOD_REAL) ? Real_kind(x) : 0;  
132    
133      Free(chx);      Free(chx);
134      tmp = VECTOR_ELT(dn, 0);    /* swap the dimnames */      tmp = VECTOR_ELT(dn, 0);    /* swap the dimnames */

Legend:
Removed from v.1555  
changed lines
  Added in v.1598

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