The R Project SVN R-packages

Rev

Rev 4530 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4530 Rev 4558
Line 152... Line 152...
152
SEXP gCMatrix_colSums(SEXP x, SEXP NArm, SEXP spRes, SEXP trans, SEXP means)
152
SEXP gCMatrix_colSums(SEXP x, SEXP NArm, SEXP spRes, SEXP trans, SEXP means)
153
{
153
{
154
    int mn = asLogical(means), sp = asLogical(spRes), tr = asLogical(trans);
154
    int mn = asLogical(means), sp = asLogical(spRes), tr = asLogical(trans);
155
    /* cholmod_sparse: drawback of coercing lgC to double: */
155
    /* cholmod_sparse: drawback of coercing lgC to double: */
156
    CHM_SP cx = AS_CHM_SP(x);
156
    CHM_SP cx = AS_CHM_SP(x);
-
 
157
    R_CheckStack();
157
 
158
 
158
    if (tr) {
159
    if (tr) {
159
	cholmod_sparse *cxt = cholmod_transpose(cx, (int)cx->xtype, &c);
160
	cholmod_sparse *cxt = cholmod_transpose(cx, (int)cx->xtype, &c);
160
	cx = cxt;
161
	cx = cxt;
161
    }
162
    }
Line 203... Line 204...
203
	for (j = 0; j < nc; j++) {
204
	for (j = 0; j < nc; j++) {
204
	    ColSUM_column(xp[j], xp[j + 1], a[j]);
205
	    ColSUM_column(xp[j], xp[j + 1], a[j]);
205
	}
206
	}
206
    }
207
    }
207
 
208
 
208
    if (tr) cholmod_free_sparse(&cx, &c); 
209
    if (tr) cholmod_free_sparse(&cx, &c);
209
    UNPROTECT(1);
210
    UNPROTECT(1);
210
    return ans;
211
    return ans;
211
}
212
}
212
 
213
 
213
#undef ColSUM_column
214
#undef ColSUM_column