\(\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_split¶
View page sourceSplit A AD valvector¶
Split one AD<valvector> into a vector of AD<valvector> each with size one.
Syntax¶
m¶
We use m to denote ay_vec .size()
ax¶
This CppAD::AD<valvector> is const
and passed by reference.
The size ax.size() must be equal to one or m
ay_vec¶
This is a SimpleVector with elements of type CppAD::AD<valvector> and is passed by reference. The size of ay_vec is not changed. Upon return, for i = 0 , … , m - 1 , the size ay [ i ].size() is one and:
ay[i][0] = ax[i]
Example¶
The file valvector_ad_split.cpp is an example and test of this operation.