# HG changeset patch # User matthiasm # Date 1301324691 -3600 # Node ID bf894897436d95ccb13d85cb160fd9686677a2a7 # Parent ea5d533536abd68f176a6e8e197548a7e4ef442c repaired viterbi diff -r ea5d533536ab -r bf894897436d viterbi.cpp --- a/viterbi.cpp Sun Dec 19 22:01:14 2010 +0900 +++ b/viterbi.cpp Mon Mar 28 16:04:51 2011 +0100 @@ -68,10 +68,10 @@ } /* initialise backward step */ - int bestValue = 0; + double bestValue = 0; for (int iState = 0; iState < nState; ++iState) { double currentValue = delta[(nFrame-1) * nState + iState]; - if (currentValue > path[nFrame-1]) { + if (currentValue > bestValue) { bestValue = currentValue; path[nFrame-1] = iState; }