Prev | Next |
# include <cppad/utility/pow_int.hpp>
z = pow(x, y)
n
using multiplication and possibly division to compute the value.
The other CppAD pow
function may use logarithms and exponentiation
to compute derivatives of the same value
(which will not work if
x
is less than or equal zero).
cppad/utility/pow_int.hpp
is included by cppad/cppad.hpp
but it can also be included separately with out the rest of
the CppAD
routines.
Including this file defines
this version of the pow
within the CppAD
namespace.
x
has prototype
const Type& x
y
has prototype
const int& y
z
has prototype
Type z
Type
must support the following operations
where
a
and
b
are
Type
objects
and
i
is an int
:
Operation
| Description | Result Type |
Type a(i)
|
construction of a
Type
object from an int
|
Type
|
a * b
|
binary multiplication of
Type
objects
|
Type
|
a / b
|
binary division of
Type
objects
|
Type
|
Type
operation sequence used to calculate
z
is
independent
of
x
.