Hello,
Thanks for the great repo. I'm simple using conditional expressions, i.e.
v = CondExpLt(a, b, a, 0)
which compiles and provides an if/else statement, somewhere of the form
if x[15] < x[23]
x[16] = x[16]
else
x[16] = 0
However, I'd like to output a ternary operator, since I believe that (1) it is nicer and has no branching and (2) it follows the same CondExp pattern.
Ideally I'd like x[16] = (x[15] < x[23]) ? x[15] : 0
Could I get some tips/direction on how I can go about that? I'm looking at
|
CG<Base> result(*handler->makeNode(op,{left.argument(), right.argument(), trueCase.argument(), falseCase.argument()})); |
, but feel a bit lost to get what I want. Thank you
Hello,
Thanks for the great repo. I'm simple using conditional expressions, i.e.
which compiles and provides an
if/elsestatement, somewhere of the formHowever, I'd like to output a ternary operator, since I believe that (1) it is nicer and has no branching and (2) it follows the same
CondExppattern.Ideally I'd like
x[16] = (x[15] < x[23]) ? x[15] : 0Could I get some tips/direction on how I can go about that? I'm looking at
CppADCodeGen/include/cppad/cg/cond_exp_op.hpp
Line 101 in 80430a6