mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Fixed bug in unit tests.
This commit is contained in:
parent
af1af6d27a
commit
deccc99cf7
@ -816,6 +816,7 @@ namespace
|
|||||||
{
|
{
|
||||||
rs.add(rnd.get_random_gaussian() + 1);
|
rs.add(rnd.get_random_gaussian() + 1);
|
||||||
tmp[i] += rs.mean();
|
tmp[i] += rs.mean();
|
||||||
|
if (i > 0)
|
||||||
tmp_var[i] += rs.variance();
|
tmp_var[i] += rs.variance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -845,10 +846,13 @@ 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;
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
tmp_var[i] += (rs.variance_y()+rs.variance_x())/2;
|
tmp_var[i] += (rs.variance_y()+rs.variance_x())/2;
|
||||||
tmp_covar[i] += rs.covariance();
|
tmp_covar[i] += rs.covariance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// should print all 1s basically since the mean and variance should always be 1.
|
// should print all 1s basically since the mean and variance should always be 1.
|
||||||
for (size_t i = 0; i < tmp.size(); ++i)
|
for (size_t i = 0; i < tmp.size(); ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user