Fixed bug in unit tests.

This commit is contained in:
Davis King 2018-02-23 11:40:09 -05:00
parent af1af6d27a
commit deccc99cf7

View File

@ -816,7 +816,8 @@ namespace
{ {
rs.add(rnd.get_random_gaussian() + 1); rs.add(rnd.get_random_gaussian() + 1);
tmp[i] += rs.mean(); tmp[i] += rs.mean();
tmp_var[i] += rs.variance(); if (i > 0)
tmp_var[i] += rs.variance();
} }
} }
@ -845,8 +846,11 @@ namespace
{ {
rs.add(rnd.get_random_gaussian() + 1, rnd.get_random_gaussian() + 1); rs.add(rnd.get_random_gaussian() + 1, rnd.get_random_gaussian() + 1);
tmp[i] += (rs.mean_y()+rs.mean_x())/2; tmp[i] += (rs.mean_y()+rs.mean_x())/2;
tmp_var[i] += (rs.variance_y()+rs.variance_x())/2; if (i > 0)
tmp_covar[i] += rs.covariance(); {
tmp_var[i] += (rs.variance_y()+rs.variance_x())/2;
tmp_covar[i] += rs.covariance();
}
} }
} }