SCM Repository
[matrix] Diff of /pkg/src/Csparse.c
Diff of /pkg/src/Csparse.c
Parent Directory
|
Revision Log
|
Patch
40 |
return ScalarLogical(1); |
return ScalarLogical(1); |
41 |
} |
} |
42 |
|
|
43 |
|
/* Called from ../R/Csparse.R : */ |
44 |
|
/* Can only return [dln]geMatrix (no symm/triang); |
45 |
|
* FIXME: replace by non-CHOLMOD code ! */ |
46 |
SEXP Csparse_to_dense(SEXP x) |
SEXP Csparse_to_dense(SEXP x) |
47 |
{ |
{ |
48 |
cholmod_sparse *chxs = as_cholmod_sparse(x); |
cholmod_sparse *chxs = as_cholmod_sparse(x); |
49 |
|
/* This loses the symmetry property, since cholmod_dense has none, |
50 |
|
* BUT, much worse (FIXME!), it also transforms CHOLMOD_PATTERN ("n") matrices |
51 |
|
* to numeric (CHOLMOD_REAL) ones : */ |
52 |
cholmod_dense *chxd = cholmod_sparse_to_dense(chxs, &c); |
cholmod_dense *chxd = cholmod_sparse_to_dense(chxs, &c); |
53 |
int Rkind = (chxs->xtype == CHOLMOD_PATTERN)? 0 : Real_kind(x); |
int Rkind = (chxs->xtype == CHOLMOD_PATTERN)? -1 : Real_kind(x); |
54 |
|
|
55 |
Free(chxs); |
Free(chxs); |
56 |
return chm_dense_to_SEXP(chxd, 1, Rkind, GET_SLOT(x, Matrix_DimNamesSym)); |
return chm_dense_to_SEXP(chxd, 1, Rkind, GET_SLOT(x, Matrix_DimNamesSym)); |
|
Legend:
Removed from v.1736 |
|
changed lines |
|
Added in v.1751 |
|
|