valvector_ad_split

View page source

Split A AD valvector

Split one AD<valvector> into a vector of AD<valvector> each with size one.

Syntax

valvector_ad_split asplit
asplit( *ax , ay_vec )

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.