sundialsTB, a Matlab Interface to SUNDIALS - Site Index Page ...
sundialsTB, a Matlab Interface to SUNDIALS - Site Index Page ...
sundialsTB, a Matlab Interface to SUNDIALS - Site Index Page ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
4.1 nvec<strong>to</strong>r functions<br />
Purpose<br />
N_VDotProd<br />
N_VDotProd returns the dot product of two vec<strong>to</strong>rs<br />
Synopsis<br />
function ret = N_VDotProd(x,y,comm)<br />
Description<br />
N_VDotProd returns the dot product of two vec<strong>to</strong>rs<br />
Usage: RET = N_VDotProd ( X, Y [, COMM] )<br />
If COMM is not present, N_VDotProd returns the dot product of the<br />
local portions of X and Y. Otherwise, it returns the global dot<br />
product.<br />
Source Code<br />
1 f u n c t i o n r e t = N VDotProd ( x , y ,comm)<br />
9<br />
10 % Radu Serban <br />
11 % Copyright ( c ) 2005 , The Regents o f the U n i v e r s i t y o f C a l i f o r n i a .<br />
12 % $Revision$Date$<br />
13<br />
14<br />
15 i f nargin == 2<br />
16<br />
17 r e t = dot ( x , y ) ;<br />
18<br />
19 e l s e<br />
20<br />
21 l d o t = dot ( x , y ) ;<br />
22 gdot = 0 . 0 ;<br />
23 MPI Allreduce ( ldot , gdot , ’SUM’ ,comm ) ;<br />
24 r e t = gdot ;<br />
25<br />
26 end<br />
Purpose<br />
N_VL1Norm returns the L1 norm of x<br />
Synopsis<br />
function ret = N_VL1Norm(x,comm)<br />
Description<br />
N_VL1Norm<br />
51