\(\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}} }\)
valvector_ad_sum¶
View page sourceSum The Elements of and AD valvector¶
Sum the elements of an AD<valvector> and return the result as one AD<valvector> with size one.
Syntax¶
ax¶
This CppAD::AD<valvector> is const
and passed by reference.
ay¶
This CppAD::AD<valvector> is passed by reference. Its input value does not matter. Upon return, it has size one and its element is the sum of the elements in ax .
Example¶
The file valvector_ad_sum.cpp is an example and test of this operation.