Commit aaa7de3b authored by Radford Neal's avatar Radford Neal

get rid of unused do_math5

parent f245011e
......@@ -3509,114 +3509,6 @@ SEXP do_math4(SEXP call, SEXP op, SEXP args, SEXP env)
}
}
#ifdef WHEN_MATH5_IS_THERE/* as in ./arithmetic.h */
/* Mathematical Functions of Five (Real) Arguments */
#define if_NA_Math5_set(y,a,b,c,d,e) \
if (ISNA (a)|| ISNA (b)|| ISNA (c)|| ISNA (d)|| ISNA (e)) \
y = NA_REAL; \
else if(ISNAN(a)|| ISNAN(b)|| ISNAN(c)|| ISNAN(d)|| ISNAN(e)) \
y = R_NaN;
#define mod_iterate5(n1,n2,n3,n4,n5, i1,i2,i3,i4,i5) \
for (i=i1=i2=i3=i4=i5=0; i<n; \
i1 = (++i1==n1) ? 0 : i1, \
i2 = (++i2==n2) ? 0 : i2, \
i3 = (++i3==n3) ? 0 : i3, \
i4 = (++i4==n4) ? 0 : i4, \
i5 = (++i5==n5) ? 0 : i5, \
++i)
static SEXP math5(SEXP sa, SEXP sb, SEXP sc, SEXP sd, SEXP se, double (*f)())
{
SEXP sy;
int i, ia, ib, ic, id, ie, n, na, nb, nc, nd, ne;
double ai, bi, ci, di, ei, *a, *b, *c, *d, *e, *y;
#define SETUP_Math5 \
if (!isNumeric(sa) || !isNumeric(sb) || !isNumeric(sc) || \
!isNumeric(sd) || !isNumeric(se)) \
non_numeric_errorcall(lcall); \
\
na = LENGTH(sa); \
nb = LENGTH(sb); \
nc = LENGTH(sc); \
nd = LENGTH(sd); \
ne = LENGTH(se); \
if ((na == 0) || (nb == 0) || (nc == 0) || (nd == 0) || (ne == 0)) \
return(allocVector(REALSXP, 0)); \
n = na; \
if (n < nb) n = nb; \
if (n < nc) n = nc; \
if (n < nd) n = nd; \
if (n < ne) n = ne; /* n = max(na,nb,nc,nd,ne) */ \
PROTECT(sa = coerceVector(sa, REALSXP)); \
PROTECT(sb = coerceVector(sb, REALSXP)); \
PROTECT(sc = coerceVector(sc, REALSXP)); \
PROTECT(sd = coerceVector(sd, REALSXP)); \
PROTECT(se = coerceVector(se, REALSXP)); \
PROTECT(sy = allocVector(REALSXP, n)); \
a = REAL(sa); \
b = REAL(sb); \
c = REAL(sc); \
d = REAL(sd); \
e = REAL(se); \
y = REAL(sy); \
naflag = 0
SETUP_Math5;
mod_iterate5 (na, nb, nc, nd, ne,
ia, ib, ic, id, ie) {
ai = a[ia];
bi = b[ib];
ci = c[ic];
di = d[id];
ei = e[ie];
if_NA_Math5_set(y[i], ai,bi,ci,di,ei)
else {
y[i] = f(ai, bi, ci, di, ei);
if (ISNAN(y[i])) naflag = 1;
}
}
#define FINISH_Math5 \
if(naflag) NaN_warning(); \
\
SEXP frm = n==na ? sa : n==nb ? sb : n==nc ? sc : n==nd ? sd : se; \
DUPLICATE_ATTRIB(sy, frm); \
UNPROTECT(6)
FINISH_Math5;
return sy;
} /* math5() */
#define Math5(A, FUN) \
math5(CAR(A), CADR(A), CADDR(A), CAD3R(A), CAD4R(A), FUN);
SEXP do_math5(SEXP call, SEXP op, SEXP args, SEXP env)
{
checkArity(op, args);
lcall = call;
switch (PRIMVAL(op)) {
/* Completely dummy for -Wall -- use math5() at all! : */
case -99: return Math5(args, dhyper);
#ifdef UNIMP
case 2: return Math5(args, p...);
case 3: return Math5(args, q...);
#endif
default:
errorcall(call,
_("unimplemented real function of %d numeric arguments"), 5);
}
} /* do_math5() */
#endif /* Math5 is there */
/* FUNTAB entries defined in this source file. See names.c for documentation. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment