-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
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
CppADCodeGen/include/cppad/cg/cond_exp_op.hpp
Line 101 in 80430a6
| CG<Base> result(*handler->makeNode(op,{left.argument(), right.argument(), trueCase.argument(), falseCase.argument()})); |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels