Fixed a bug in find_max_factor_graph_viterbi() which sometimes

occurred when the model order was larger than the number of variables.
This commit is contained in:
Davis King 2012-05-09 18:13:32 -04:00
parent 3a5f99f497
commit 34dbc02d97
2 changed files with 11 additions and 2 deletions

View File

@ -18,7 +18,7 @@ namespace dlib
{
struct viterbi_data
{
viterbi_data() :val(0), back_index(0) {}
viterbi_data() :val(-std::numeric_limits<double>::infinity()), back_index(0) {}
double val;
unsigned long back_index;
};

View File

@ -187,8 +187,17 @@ namespace
do_test<0,3,8>();
do_test<4,3,1>();
do_test<4,3,0>();
do_test<0,3,0>();
do_test<3,2,1>();
do_test<3,2,0>();
do_test<3,2,2>();
do_test<2,2,1>();
do_test_negative<3,2,1>();
do_test_negative<3,2,0>();
do_test_negative<3,2,2>();
do_test_negative<2,2,1>();
do_test<0,3,0>();
do_test<1,2,8>();
do_test<2,2,7>();
do_test<3,2,8>();