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.
13<br />
14 i f nargin == 1<br />
15<br />
16 r e t = max( x ) ;<br />
17<br />
18 e l s e<br />
19<br />
20 lmax = max( x ) ;<br />
21 gmax = 0 . 0 ;<br />
22 MPI Allreduce ( lmax , gmax , ’MAX’ ,comm ) ;<br />
23 r e t = gmax ;<br />
24<br />
25 end<br />
Purpose<br />
N_VMaxNorm<br />
N_VMaxNorm returns the L-infinity norm of x<br />
Synopsis<br />
function ret = N_VMaxNorm(x, comm)<br />
Description<br />
N_VMaxNorm returns the L-infinity norm of x<br />
Usage: RET = N_VMaxNorm ( X [, COMM] )<br />
If COMM is not present, N_VMaxNorm returns the L-infinity norm<br />
of the local portion of X. Otherwise, it returns the global<br />
L-infinity norm..<br />
Source Code<br />
1 f u n c t i o n r e t = N VMaxNorm( x , 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 i f nargin == 1<br />
15<br />
16 r e t = norm ( x , ’ i n f ’ ) ;<br />
17<br />
18 e l s e<br />
19<br />
20 lnrm = norm ( x , ’ i n f ’ ) ;<br />
21 gnrm = 0 . 0 ;<br />
22 MPI Allreduce ( lnrm , gnrm , ’MAX’ ,comm ) ;<br />
23 r e t = gnrm ;<br />
24<br />
25 end<br />
53