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

📄 solver.m.txt

📁 这是马尔可夫-蒙特卡罗算法的MATLAB源程序.
💻 TXT
字号:
function G = Solver(DR,d,pperm,rperm)
% G = Solver1(DR,d)
% Form the Green's functions by solving matrix eqn 

% Colin Fox, 29 Nov 2005

cf = 1; % 0=left divide (Gaussian elimination), 1=Cholesky factorise once and use factor to solve

[nnps,nnodes,nres,nbn]=nodenums(d.N);

SR = RedNodalMat(DR,d.RefNode);       % form the reduced nodal matrix
nelecs = length(d.ElecNodes);         % number of electrodes
%G = zeros(nnodes-1,nelecs);           % Allocate space for matrix of Green's functions

if ~cf
    % Make the data (in the simplest way)
    for ce = 1:nelecs 
        currvec = sparse(d.ElecNodes(ce),1,1,nnodes-1,1); % sparse current vector
        G(:,ce) = SR\currvec;          % solve using MatLab's left-divide
    end
else
    R = chol(SR(pperm,pperm));                      % Cholesky factorise 
    currmat = sparse(rperm(d.ElecNodes),1:nelecs,1,nnodes-1,nelecs); % make permuted currents
    U = R\(R'\currmat);
    G = full(U(rperm,:));
end

⌨️ 快捷键说明

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