% monte-carlo check for x2 Viterbi == ML
%
%
trials = 100

x2_init;

for SNR=0:20:5

  for trial_count = 1:trials

    x2;

    [ml ml_cost] = es;

    if( any( ex(:)) ~= ml(:) )
      disp 'bad ex';
      ex, ml
    end

    if( abs(VW(1) - ml_cost) > 1e-10)
      disp 'bad cost';
      VW(1), ml_cost
    end

  end

end
