@(@\newcommand{\W}[1]{ \; #1 \; }
\newcommand{\R}[1]{ {\rm #1} }
\newcommand{\B}[1]{ {\bf #1} }
\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }
\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }
\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }
\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@
This is cppad-20221105 documentation. Here is a link to its
current documentation
.
Enable use of AD<Base> where Base is double
CondExpOp
The type double is a relatively simple type that supports
<, <=, ==, >=, and > operators; see
ordered type
.
Hence its CondExpOp function is defined by
Unary Standard Math
The following macro invocations import the double versions of
the unary standard math functions into the CppAD namespace.
Importing avoids ambiguity errors when using both the
CppAD and std namespaces.
Note this also defines the float
versions of these functions.
namespace CppAD {
using std::acos;
using std::asin;
using std::atan;
using std::cos;
using std::cosh;
using std::exp;
using std::fabs;
using std::log;
using std::log10;
using std::sin;
using std::sinh;
using std::sqrt;
using std::tan;
using std::tanh;
using std::asinh;
using std::acosh;
using std::atanh;
using std::erf;
using std::erfc;
using std::expm1;
using std::log1p;
}
The absolute value function is special because its std name is
fabs
pow
The following defines a CppAD::pow function that
is required to use AD<double>.
As with the unary standard math functions,
this has the exact same signature as std::pow,
so use it instead of defining another function.
to_string
There is no need to define to_string for double
because it is defined by including cppad/utility/to_string.hpp;
see to_string
.
See base_complex.hpp
for an example where
it is necessary to define to_string for a
Base
type.
Input File: include/cppad/core/base_double.hpp