The R Project SVN R

Rev

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

Rev 60321 Rev 60327
Line 1565... Line 1565...
1565
   UNPROTECT(nprotect);
1565
   UNPROTECT(nprotect);
1566
   return ans;
1566
   return ans;
1567
}
1567
}
1568
 
1568
 
1569
 
1569
 
1570
// backsolve(r, x, k, upper.tri, transpose)
1570
/* backsolve(r, x, k, upper.tri, transpose) */
1571
SEXP attribute_hidden do_backsolve(SEXP call, SEXP op, SEXP args, SEXP rho)
1571
SEXP attribute_hidden do_backsolve(SEXP call, SEXP op, SEXP args, SEXP rho)
1572
{
1572
{
1573
    int nprot = 1;
1573
    int nprot = 1;
1574
    checkArity(op, args);
1574
    checkArity(op, args);
1575
 
1575
 
Line 1593... Line 1593...
1593
	error(_("singular matrix in 'backsolve'. First zero in diagonal [%d]"),
1593
	error(_("singular matrix in 'backsolve'. First zero in diagonal [%d]"),
1594
	    info);
1594
	    info);
1595
    UNPROTECT(nprot);
1595
    UNPROTECT(nprot);
1596
    return ans;
1596
    return ans;
1597
}
1597
}
-
 
1598
 
-
 
1599
/* max.col(m, ties.method) */
-
 
1600
SEXP attribute_hidden do_maxcol(SEXP call, SEXP op, SEXP args, SEXP rho)
-
 
1601
{
-
 
1602
    checkArity(op, args);
-
 
1603
    SEXP m = CAR(args);
-
 
1604
    int method = asInteger(CADR(args));
-
 
1605
    int nr = nrows(m), nc = ncols(m), nprot = 1;
-
 
1606
    if (TYPEOF(m) != REALSXP) PROTECT(m = coerceVector(m, REALSXP));
-
 
1607
    SEXP ans = allocVector(INTSXP, nr);
-
 
1608
    PROTECT(ans);
-
 
1609
    R_max_col(REAL(m), &nr, &nc, INTEGER(ans), &method);
-
 
1610
    UNPROTECT(nprot);
-
 
1611
    return ans;
-
 
1612
}