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 1447, Fri Aug 25 20:38:36 2006 UTC revision 1448, Sat Aug 26 03:29:36 2006 UTC
# Line 80  Line 80 
80                                 GET_SLOT(x, Matrix_DimNamesSym));                                 GET_SLOT(x, Matrix_DimNamesSym));
81  }  }
82    
83  /* this use to be called  sCMatrix_to_gCMatrix(..)   [in ./dsCMatrix.c ]: */  /* this used to be called  sCMatrix_to_gCMatrix(..)   [in ./dsCMatrix.c ]: */
84  SEXP Csparse_symmetric_to_general(SEXP x)  SEXP Csparse_symmetric_to_general(SEXP x)
85  {  {
86      cholmod_sparse *chx = as_cholmod_sparse(x), *chgx;      cholmod_sparse *chx = as_cholmod_sparse(x), *chgx;
# Line 132  Line 132 
132  {  {
133      cholmod_sparse *cha = as_cholmod_sparse(a);      cholmod_sparse *cha = as_cholmod_sparse(a);
134      cholmod_dense *chb = as_cholmod_dense(b);      cholmod_dense *chb = as_cholmod_dense(b);
135      cholmod_dense *chc = cholmod_allocate_dense(cha->nrow, chb->ncol,      cholmod_dense *chc =
136                                                  cha->nrow, chb->xtype, &c);          cholmod_allocate_dense(cha->nrow, chb->ncol, cha->nrow, chb->xtype, &c);
137      double alpha = 1, beta = 0;      double alpha[] = {1,0}, beta[] = {0,0};
138    
139      cholmod_sdmult(cha, 0, &alpha, &beta, chb, chc, &c);      cholmod_sdmult(cha, 0, alpha, beta, chb, chc, &c);
140      Free(cha); Free(chb);      Free(cha); Free(chb);
141      return chm_dense_to_SEXP(chc, 1);      return chm_dense_to_SEXP(chc, 1);
142  }  }
# Line 145  Line 145 
145  {  {
146      cholmod_sparse *cha = as_cholmod_sparse(a);      cholmod_sparse *cha = as_cholmod_sparse(a);
147      cholmod_dense *chb = as_cholmod_dense(b);      cholmod_dense *chb = as_cholmod_dense(b);
148      cholmod_dense *chc = cholmod_allocate_dense(cha->ncol, chb->ncol,      cholmod_dense *chc =
149                                                  cha->ncol, chb->xtype, &c);          cholmod_allocate_dense(cha->ncol, chb->ncol, cha->ncol, chb->xtype, &c);
150      double alpha = 1, beta = 0;      double alpha[] = {1,0}, beta[] = {0,0};
151    
152      cholmod_sdmult(cha, 1, &alpha, &beta, chb, chc, &c);      cholmod_sdmult(cha, 1, alpha, beta, chb, chc, &c);
153      Free(cha); Free(chb);      Free(cha); Free(chb);
154      return chm_dense_to_SEXP(chc, 1);      return chm_dense_to_SEXP(chc, 1);
155  }  }

Legend:
Removed from v.1447  
changed lines
  Added in v.1448

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