⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 converged.m

📁 五点差分型多重网格方法:各种插值算子的比较)
💻 M
字号:
%CONVERGED  Return whether the method has converged
%
%       C = CONVERGED (BN,PBN,RN,PRN,ITER,RTOL,PRTOL,MAX_IT,MAX_TIME,MAX_MFLOP)
%       Performs a series of tests to determine whether the calling iterative
%       method has converged.  
%
%         BN and PBN are the 2-norms of the original system and the 
%            preconditioned system respectively.
%         RN and PRN are the 2-norms of the residuals of the system and the 
%            preconditioned system respectively.
%         ITER is the current iteration number.
%         RTOL and PRTOL are the tolerances for the residuals RN and PRN
%            respectively.
%         MAX_IT is the limit on the number of iterations.
%         MAX_TIME is the limit on the time (not implemented yet).
%         MAX_MFLOP is the limit on the number of megaflops (not implemented 
%            yet).
%         

% James Bordner and Faisal Saied
% Department of Computer Science
% University of Illinois at Urbana-Champaign
% 7 June 1995

% Modified for Matlab Version 6 Compatability
% Ryan McKenzie
% University of Kentucky Center for Computational Sciences
% April 2004
%
% Flop counts no longer available in Matlab 6, so removed from the MGLab system.

function c = converged (bn,pbn,rn,prn,iter,rtol,prtol,max_it,max_time)

    c = (( rtol~=0 &  rn <= rtol*bn) ...
       | (prtol~=0 & prn <= prtol*pbn) ...
       | (iter >= max_it));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -