valvector_ad_sum

View page source

Sum 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

valvector_ad_sum asum
asum ( ax , ay )

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.