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 31... Line 31...
31
    return ScalarLogical(1);
31
    return ScalarLogical(1);
32
}
32
}
33
 
33
 
34
SEXP Tsparse_to_Csparse(SEXP x, SEXP tri)
34
SEXP Tsparse_to_Csparse(SEXP x, SEXP tri)
35
{
35
{
36
    cholmod_triplet *chxt = as_cholmod_triplet(x);
36
    CHM_TR chxt = AS_CHM_TR(x);
37
    cholmod_sparse *chxs = cholmod_triplet_to_sparse(chxt, chxt->nnz, &c);
37
    CHM_SP chxs = cholmod_triplet_to_sparse(chxt, chxt->nnz, &c);
38
    int tr = asLogical(tri);
38
    int tr = asLogical(tri);
39
    int Rkind = (chxt->xtype != CHOLMOD_PATTERN) ? Real_kind(x) : 0;
39
    int Rkind = (chxt->xtype != CHOLMOD_PATTERN) ? Real_kind(x) : 0;
40
 
40
 
41
    Free(chxt);
-
 
42
    return chm_sparse_to_SEXP(chxs, 1, 
41
    return chm_sparse_to_SEXP(chxs, 1, 
43
			      tr ? ((*uplo_P(x) == 'U') ? 1 : -1) : 0,
42
			      tr ? ((*uplo_P(x) == 'U') ? 1 : -1) : 0,
44
			      Rkind, tr ? diag_P(x) : "",
43
			      Rkind, tr ? diag_P(x) : "",
45
			      GET_SLOT(x, Matrix_DimNamesSym));
44
			      GET_SLOT(x, Matrix_DimNamesSym));
46
}
45
}