Commit 34dbc02d authored by Davis King's avatar Davis King

Fixed a bug in find_max_factor_graph_viterbi() which sometimes

occurred when the model order was larger than the number of variables.
parent 3a5f99f4
...@@ -18,7 +18,7 @@ namespace dlib ...@@ -18,7 +18,7 @@ namespace dlib
{ {
struct viterbi_data struct viterbi_data
{ {
viterbi_data() :val(0), back_index(0) {} viterbi_data() :val(-std::numeric_limits<double>::infinity()), back_index(0) {}
double val; double val;
unsigned long back_index; unsigned long back_index;
}; };
......
...@@ -187,8 +187,17 @@ namespace ...@@ -187,8 +187,17 @@ namespace
do_test<0,3,8>(); do_test<0,3,8>();
do_test<4,3,1>(); do_test<4,3,1>();
do_test<4,3,0>(); 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<1,2,8>();
do_test<2,2,7>(); do_test<2,2,7>();
do_test<3,2,8>(); do_test<3,2,8>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment