Commit 025b7aa5 authored by Radford Neal's avatar Radford Neal

use ATTRIB_W rather than ATTRIB to get gradients

parent 645739a8
......@@ -86,7 +86,7 @@ static void NaN_warningcall (SEXP call)
not this macro. */
#define DUPLICATE_ATTRIB(_to_,_from_) do { \
if (ATTRIB((_to_))!=ATTRIB((_from_)) || OBJECT((_from_))) \
if (ATTRIB_W((_to_))!=ATTRIB_W((_from_)) || OBJECT((_from_))) \
(DUPLICATE_ATTRIB)((_to_),(_from_)); \
} while (0)
......@@ -2690,8 +2690,8 @@ SEXP do_math2 (SEXP call, SEXP op, SEXP args, SEXP env)
Dcall = math2_table[ix].Dcall;
SEXP a1 = CAR(args); SEXP g1 = ATTRIB(args); args = CDR(args);
SEXP a2 = CAR(args); SEXP g2 = ATTRIB(args); args = CDR(args);
SEXP a1 = CAR(args); SEXP g1 = ATTRIB_W(args); args = CDR(args);
SEXP a2 = CAR(args); SEXP g2 = ATTRIB_W(args); args = CDR(args);
if (!isNumeric(a1) || !isNumeric(a2))
non_numeric_errorcall(call);
......@@ -3244,9 +3244,9 @@ SEXP do_math3 (SEXP call, SEXP op, SEXP args, SEXP env)
Dcall = math3_table[ix].Dcall;
SEXP a1 = CAR(args); SEXP g1 = ATTRIB(args); args = CDR(args);
SEXP a2 = CAR(args); SEXP g2 = ATTRIB(args); args = CDR(args);
SEXP a3 = CAR(args); SEXP g3 = ATTRIB(args); args = CDR(args);
SEXP a1 = CAR(args); SEXP g1 = ATTRIB_W(args); args = CDR(args);
SEXP a2 = CAR(args); SEXP g2 = ATTRIB_W(args); args = CDR(args);
SEXP a3 = CAR(args); SEXP g3 = ATTRIB_W(args); args = CDR(args);
if (!isNumeric(a1) || !isNumeric(a2) || !isNumeric(a3))
non_numeric_errorcall(call);
......
......@@ -708,7 +708,7 @@ static inline SEXP handle_symbol (SEXP res, SEXP sym, int variant)
return res;
if (HAS_ATTRIB(cell)) {
R_variant_result = VARIANT_GRADIENT_FLAG;
R_gradient = ATTRIB(cell);
R_gradient = ATTRIB_W(cell);
}
if (variant & VARIANT_PENDING_OK)
return res;
......@@ -890,7 +890,7 @@ static SEXP attribute_noinline evalv_other (SEXP e, SEXP rho, int variant)
return res;
if (HAS_ATTRIB(e)) {
R_variant_result = VARIANT_GRADIENT_FLAG;
R_gradient = ATTRIB(e);
R_gradient = ATTRIB_W(e);
}
if (variant & VARIANT_PENDING_OK)
return res;
......@@ -912,7 +912,7 @@ static SEXP attribute_noinline evalv_other (SEXP e, SEXP rho, int variant)
if ( ! (variant & VARIANT_GRADIENT))
return res;
R_variant_result = VARIANT_GRADIENT_FLAG;
R_gradient = ATTRIB(e);
R_gradient = ATTRIB_W(e);
if (variant & VARIANT_PENDING_OK)
return res;
}
......@@ -1030,7 +1030,7 @@ SEXP forcePromise_v (SEXP e, int variant) /* e protected here if necessary */
return r;
if (HAS_ATTRIB(e)) {
R_variant_result = VARIANT_GRADIENT_FLAG;
R_gradient = ATTRIB(e);
R_gradient = ATTRIB_W(e);
}
if (variant & VARIANT_PENDING_OK)
return r;
......
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