l, T, 'infEngine', 'libdaiJtree');
    margLD     = dgmInferNodes(dgm, 'localev', X);
    gammaLD = tfMarg2Mat(margLD);
    t = toc;
    fprintf('libdai: %g seconds\n', t);
    assert(approxeq(gamma, gammaLD));
end
%% Compare map assignments
mapDGM = dgmMap(dgm, 'localev', X); 
mapHMM = hmmMap(model, X); 
assert(isequal(mapDGM, mapHMM)); 













##### SOURCE END #####
--></body></html>