SCM

SCM Repository

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

Diff of /pkg/src/Csparse.c

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

revision 1654, Fri Oct 27 16:58:15 2006 UTC revision 1657, Wed Nov 1 16:29:53 2006 UTC
# Line 156  Line 156 
156      return chm_sparse_to_SEXP(chc, 1, 0, 0, "", dn);      return chm_sparse_to_SEXP(chc, 1, 0, 0, "", dn);
157  }  }
158    
159    SEXP Csparse_Csparse_crossprod(SEXP a, SEXP b)
160    {
161        cholmod_sparse *cha = as_cholmod_sparse(a),
162            *chb = as_cholmod_sparse(b);
163        cholmod_sparse *chta = cholmod_transpose(cha, 1, &c);
164        cholmod_sparse *chc = cholmod_ssmult(chta, chb, 0, cha->xtype, 1, &c);
165        SEXP dn = allocVector(VECSXP, 2);
166    
167        Free(cha); Free(chb); cholmod_free_sparse(&chta, &c);
168        SET_VECTOR_ELT(dn, 0,       /* establish dimnames */
169                       duplicate(VECTOR_ELT(GET_SLOT(a, Matrix_DimNamesSym), 1)));
170        SET_VECTOR_ELT(dn, 1,
171                       duplicate(VECTOR_ELT(GET_SLOT(b, Matrix_DimNamesSym), 1)));
172        return chm_sparse_to_SEXP(chc, 1, 0, 0, "", dn);
173    }
174    
175  SEXP Csparse_dense_prod(SEXP a, SEXP b)  SEXP Csparse_dense_prod(SEXP a, SEXP b)
176  {  {
177      cholmod_sparse *cha = as_cholmod_sparse(a);      cholmod_sparse *cha = as_cholmod_sparse(a);

Legend:
Removed from v.1654  
changed lines
  Added in v.1657

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