Open andrjohns opened 2 years ago
Great! if_else()
is deprecated and will not be supported as of Stan 2.32, so there is probably no need to bother with that one?
Ah cool. How does stanc3 handle the ternary operator? I was thinking that the vectorised if_else
would allow us to have vectorised ternary expressions as well
With the ternary C++ operator:
real a = k > 0 ? 5 : 10;
is generated as:
a = (logical_gt(k, 0) ? 5 : 10);
Maybe we should think about using if_else
for that case though. So the ternary operator in Stan is generated to if_else. Maybe open an issue in stanc3 so we discuss it?
Sounds good, will do!
Description
As with the unary and binary functions, it would useful to add a framework for vectorising ternary functions (like
fma
,inc_beta
, andif_else
).Eigen has a framework
CwiseTernaryOp
which we can use in combination with the existingapply_scalar_binary
framework to cover the various combinationsCurrent Version:
v4.2.1