1 #ifndef CPPAD_CG_EVALUATOR_ADOLC_INCLUDED
2 #define CPPAD_CG_EVALUATOR_ADOLC_INCLUDED
18 #include <adolc/adolc.h>
19 #include <adolc/drivers/drivers.h>
24 inline adouble abs(
const adouble& val) {
28 inline adouble
sign(
const adouble& val) {
35 inline adouble condExpLt(
const adouble& left,
const adouble& right,
36 const adouble& exp_if_true,
const adouble& exp_if_false) {
38 condassign(temp, right - left, exp_if_true, exp_if_false);
42 inline adouble condExpLe(
const adouble& left,
const adouble& right,
const adouble& exp_if_true,
const adouble& exp_if_false) {
46 inline adouble condExpEq(
const adouble& left,
const adouble& right,
47 const adouble& exp_if_true,
const adouble& exp_if_false) {
51 inline adouble condExpGe(
const adouble& left,
const adouble& right,
52 const adouble& exp_if_true,
const adouble& exp_if_false) {
56 inline adouble condExpGt(
const adouble& left,
const adouble& right,
57 const adouble& exp_if_true,
const adouble& exp_if_false) {
59 condassign(temp, left - right, exp_if_true, exp_if_false);
63 inline adouble condExpNe(
const adouble& left,
const adouble& right,
64 const adouble& exp_if_true,
const adouble& exp_if_false) {
68 inline adouble CondExpOp(
enum CppAD::CompareOp cop,
71 const adouble& trueCase,
72 const adouble& falseCase) {
74 case CppAD::CompareLt:
75 return condExpLt(left, right, trueCase, falseCase);
76 case CppAD::CompareLe:
77 return condExpLe(left, right, trueCase, falseCase);
78 case CppAD::CompareEq:
79 return condExpEq(left, right, trueCase, falseCase);
80 case CppAD::CompareGe:
81 return condExpGe(left, right, trueCase, falseCase);
82 case CppAD::CompareGt:
83 return condExpGt(left, right, trueCase, falseCase);
84 case CppAD::CompareNe:
85 return condExpNe(left, right, trueCase, falseCase);
97 template<
class ScalarIn>
100 using ActiveOut = adouble;