The R Project SVN R-packages

Rev

Rev 4529 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4529 Rev 4530
Line 37... Line 37...
37
 
37
 
38
/* Should generalize this, also for ltT -> lgC --
38
/* Should generalize this, also for ltT -> lgC --
39
 * along the lines in ./TMatrix_as.c  ..... or drop completely : */
39
 * along the lines in ./TMatrix_as.c  ..... or drop completely : */
40
SEXP dtTMatrix_as_dgCMatrix(SEXP x)
40
SEXP dtTMatrix_as_dgCMatrix(SEXP x)
41
{
41
{
42
    cholmod_triplet *tx = as_cholmod_triplet(x);
42
    CHM_TR tx = AS_CHM_TR(x);
43
    cholmod_sparse *cx = cholmod_triplet_to_sparse(tx, tx->nzmax, &c);
43
    CHM_SP cx = cholmod_triplet_to_sparse(tx, tx->nzmax, &c);
44
 
44
 
45
 /* FIXME
45
 /* FIXME
46
 * int Rkind = (tx->xtype == CHOLMOD_REAL) ? Real_kind(x) : 0;
46
 * int Rkind = (tx->xtype == CHOLMOD_REAL) ? Real_kind(x) : 0;
47
 */
47
 */
48
    Free(tx);
-
 
49
				/* chm_sparse_to_SEXP cholmod_frees cx */
-
 
50
    return chm_sparse_to_SEXP(cx, 1, 0, /*Rkind*/ 0, "",
48
    return chm_sparse_to_SEXP(cx, 1/*do_free*/, 0, /*Rkind*/ 0, "",
51
			      GET_SLOT(x, Matrix_DimNamesSym));
49
			      GET_SLOT(x, Matrix_DimNamesSym));
52
}
50
}
53
 
51