set_all_potentials.m.svn-base

来自「Probabilistic graphical models in matlab」· SVN-BASE 代码 · 共 82 行

SVN-BASE
82
字号
function [model] = set_all_potentials(model, method, pot_mat)if (strcmp (model.type, 'pairwise-discrete' ) )       if (strcmp (method, 'all_random' ) )        model.all_potentials_code = '(all-random)';    end        if (strcmp (method, 'one_random_strongly_diagonal_uniform_noise' ) )        model.all_potentials_code = strcat('(one-random-strongly-diagonal-uniform-noise) (', strcat( num2str(pot_mat), ')')) ;    end    if (strcmp (method, 'one_uniform_strongly_diagonal_uniform_noise' ) )        model.all_potentials_code = strcat('(one-uniform-strongly-diagonal-uniform-noise) (', strcat( num2str(pot_mat), ')')) ;    end    if (strcmp (method, 'one_random_strongly_diagonal_random_noise' ) )        model.all_potentials_code = strcat('(one-random-strongly-diagonal-random-noise) (', strcat( num2str(pot_mat), ')')) ;    end    if (strcmp (method, 'all_random_strongly_diagonal_uniform_noise' ) )        model.all_potentials_code = strcat('(all-random-strongly-diagonal-uniform-noise) (', strcat( num2str(pot_mat), ')')) ;    end    if (strcmp (method, 'normal' ) )        model.all_potentials_code = '(normal) (';        [m,n] = size(pot_mat);        for j = 1: m            for k = 1: n                model.all_potentials_code =  [ model.all_potentials_code ' ' num2str(pot_mat(j,k)) ];            end        end        model.all_potentials_code =  strcat( model.all_potentials_code, ') ');    end    model.all_potentials = 1;    %     [m,n] = size(model.link_matrix);    %    %     for i=1:m    %    %         for j=1:n    %    %             if (model.link_matrix(i,j) == 1)    %    %                 model = set_potential(model, i, j, pot_mat);    %    %             end    %    %         end    %    %     endendif (strcmp (model.type, 'factorgraph-discrete' ) )    error ('set_all_potentials(...) can not be used with a factor Graph.');end

⌨️ 快捷键说明

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