The R Project SVN R-packages

Rev

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

Rev 4556 Rev 4558
Line 138... Line 138...
138
 
138
 
139
SEXP dgCMatrix_lusol(SEXP x, SEXP y)
139
SEXP dgCMatrix_lusol(SEXP x, SEXP y)
140
{
140
{
141
    SEXP ycp = PROTECT(duplicate(y));
141
    SEXP ycp = PROTECT(duplicate(y));
142
    CSP xc = AS_CSP(x);
142
    CSP xc = AS_CSP(x);
-
 
143
    R_CheckStack();
143
 
144
 
144
    if (xc->m != xc->n || xc->m <= 0)
145
    if (xc->m != xc->n || xc->m <= 0)
145
	error(_("dgCMatrix_lusol requires a square, non-empty matrix"));
146
	error(_("dgCMatrix_lusol requires a square, non-empty matrix"));
146
    if (!isReal(ycp) || LENGTH(ycp) != xc->m)
147
    if (!isReal(ycp) || LENGTH(ycp) != xc->m)
147
	error(_("Dimensions of system to be solved are inconsistent"));
148
	error(_("Dimensions of system to be solved are inconsistent"));
Line 313... Line 314...
313
    CHM_SP cx = AS_CHM_SP(x);
314
    CHM_SP cx = AS_CHM_SP(x);
314
    CHM_FR L;
315
    CHM_FR L;
315
    CHM_DN cy = AS_CHM_DN(y), rhs, cAns;
316
    CHM_DN cy = AS_CHM_DN(y), rhs, cAns;
316
    double one[] = {1,0}, zero[] = {0,0};
317
    double one[] = {1,0}, zero[] = {0,0};
317
    SEXP ans = PROTECT(allocVector(VECSXP, 3));
318
    SEXP ans = PROTECT(allocVector(VECSXP, 3));
-
 
319
    R_CheckStack();
318
 
320
 
319
    if (cx->ncol < cx->nrow || cx->ncol <= 0)
321
    if (cx->ncol < cx->nrow || cx->ncol <= 0)
320
	error(_("dgCMatrix_cholsol requires a 'short, wide' rectangular matrix"));
322
	error(_("dgCMatrix_cholsol requires a 'short, wide' rectangular matrix"));
321
    if (cy->nrow != cx->ncol)
323
    if (cy->nrow != cx->ncol)
322
	error(_("Dimensions of system to be solved are inconsistent"));
324
	error(_("Dimensions of system to be solved are inconsistent"));