\(\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_join¶
View page sourceJoin a Vector of AD valvectors¶
Join a vector of AD<valvector>, each with size one, into one AD<valvector>.
Syntax¶
m¶
We use m to denote ax_vec .size() .
ax_vec¶
This is a SimpleVector with elements of type CppAD::AD<valvector> .
It is const
and is passed by reference.
For i = 0 , … , m - 1 ,
the size ax [ i ].size() is one.
ay¶
This CppAD::AD<valvector> is passed by reference and its input value does not matter. Upon return, its size in m and for i = 0 , … , m - 1
ay[i] = ax_vec[i][0]
Example¶
The file valvector_ad_join.cpp is an example and test of this operation.