\(\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}} }\)
unary_minus¶
View page sourceAD Unary Minus Operator¶
Syntax¶
-
xPurpose¶
Computes the negative of x .
Base¶
The operation in the syntax above must be supported for the case where
the operand is a const
Base object.
x¶
The operand x has one of the following prototypes
const AD
< Base > & xconst VecAD
< Base >:: reference &
xy¶
The result y has type
AD
< Base > y
It is equal to the negative of the operand x .
Operation Sequence¶
This is an AD of Base atomic operation and hence is part of the current AD of Base operation sequence .
Derivative¶
If \(f\) is a Base Function ,
Example¶
The file unary_minus.cpp contains an example and test of this operation.