CppAD: A C++ Algorithmic Differentiation Package
20130918
|
#define CPPAD_FOLD_ASSIGNMENT_OPERATOR | ( | Op | ) |
/* ----------------------------------------------------------------*/ \ template <class Base> \ inline AD<Base>& operator Op \ (AD<Base> &left, double right) \ { return left Op AD<Base>(right); } \ \ template <class Base> \ inline AD<Base>& operator Op \ (AD<Base> &left, const Base &right) \ { return left Op AD<Base>(right); } \ \ inline AD<double>& operator Op \ (AD<double> &left, const double &right) \ { return left Op AD<double>(right); } \ \ template <class Base> \ inline AD<Base>& operator Op \ (AD<Base> &left, const VecAD_reference<Base> &right) \ { return left Op right.ADBase(); }
Declares automatic coercion for certain AD assignment operations.
This macro assumes that the operator
left Op right
is defined for the case where left and right have type AD<Base>. It uses this case to define the cases where left has type AD<Base> and right has type VecAD_reference<Base>, Base, or double. The argument right is const and call by reference. This macro converts the operands to AD<Base> and then uses the definition of the same operation for that case.
Definition at line 94 of file define.hpp.