----------------------------------------------------------- lines 8-42 of file: include/cppad/example/valvector/sum.hpp ----------------------------------------------------------- {xrst_begin valvector_ad_sum} {xrst_spell asum } Sum The Elements of and AD valvector #################################### Sum the elements of an AD and return the result as one AD with size one. Syntax ****** | valvector_ad_sum *asum* | *asum* ( *ax* , *ay* ) ax ** This CppAD::AD is ``const`` and passed by reference. ay ** This CppAD::AD 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* . {xrst_toc_hidden example/valvector/ad_sum.cpp } Example ******* The file :ref:`valvector_ad_sum.cpp-name` is an example and test of this operation. {xrst_end valvector_ad_sum}