recursive_combine_pots.m

来自「麻省理工学院的人工智能工具箱,很珍贵,希望对大家有用!」· M 代码 · 共 21 行

M
21
字号
function pot = recursive_combine_pots(pot1, pot2)
% RECURSIVE_COMBINE_POTS recursive combine two potentials
% pot = recursive_combine_pots(pot1, pot2)

% recursive combine was defined under condition that the setdiff(heads of pot1, domain of pot2) or
% setdiff(head of pot2, domain of pot1) if not empty

D12 = mysubset(pot1.cheaddom, pot2.domain);
D21 = mysubset(pot2.cheaddom, pot1.domain);

if isempty(D12) & isempty(D21)
    return;
end

if ~isempty(D12)
    [margpot, comppot] = complement(pot1,D12);
    pot = direct_combine_pots( recursive_combine_pots(margpot, pot2), comppot);
elseif ~isempty(D21)
    [margpot, comppot] = complement(pot2,D21);
    pot = direct_combine_pots( recursive_combine_pots(pot1, margpot), comppot);
end

⌨️ 快捷键说明

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