This is a static copy of a profile report

Home

Function details for RandStream.RandStream>RandStream.setGlobalStreamThis is a static copy of a profile report

Home

RandStream.RandStream>RandStream.setGlobalStream (Calls: 1, Time: 0.001 s)
Generated 19-Jun-2021 04:39:05 using performance time.
class method in file /nfs/linux/matlab-2019b/toolbox/matlab/randfun/@RandStream/RandStream.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
rngfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
424
localGetSetGlobalStream(stream...
10.001 s95.6%
421
if nargout > 0
10.000 s2.7%
425
end
10.000 s0.5%
423
end
10.000 s0.2%
All other lines  0.000 s1.0%
Totals  0.001 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...RandStream>localGetSetGlobalStreamclass method10.001 s89.6%
Self time (built-ins, overhead, etc.)  0.000 s10.4%
Totals  0.001 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function25
Non-code lines (comments, blank lines)20
Code lines (lines that can run)5
Code lines that did run4
Code lines that did not run1
Coverage (did run/can run)80.00 %
Function listing
time 
Calls 
 line
 401 
        function old = setGlobalStream(stream)
 402 
%RANDSTREAM.SETGLOBALSTREAM Replace the global random number stream.
 403 
%   PREVSTREAM = RandStream.SETGLOBALSTREAM(STREAM) sets STREAM as the current
 404 
%   global random number stream, i.e., designates it as the stream that the
 405 
%   RAND, RANDI, and RANDN functions will draw values from. PREVSTREAM is the
 406 
%   stream that was previously designated as the global random number stream.
 407 
%
 408 
%   RAND, RANDI, and RANDN all rely on the same stream of uniform pseudorandom
 409 
%   numbers, known as the global random number stream.  RAND draws one value
 410 
%   from that stream to generate each uniform value it returns;  RANDI draws
 411 
%   one uniform value from that stream to generate each integer value it
 412 
%   return; and RANDN draws one or more uniform values to generate each normal
 413 
%   value it returns.  Note that there are also RAND, RANDI, and RANDN methods
 414 
%   for which you specify a specific random stream from which to draw values.
 415 
%
 416 
%   The RNG function is a shorter alternative for many uses of
 417 
%   RANDSTREAM.setGlobalStream.
 418 
%
 419 
%   See also RNG, RANDSTREAM, RANDSTREAM.GETGLOBALSTREAM,
 420 
%            RANDFUN/RAND, RANDFUN/RANDN, RANDFUN/RANDI.
< 0.001 
      1 
 421
            if nargout > 0 
 422 
                old = localGetSetGlobalStream();
< 0.001 
      1 
 423
            end 
  0.001 
      1 
 424
            localGetSetGlobalStream(stream); 
< 0.001 
      1 
 425
        end 

Other subfunctions in this file are not included in this listing.