Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
deccc99c
Commit
deccc99c
authored
Feb 23, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in unit tests.
parent
af1af6d2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
statistics.cpp
dlib/test/statistics.cpp
+4
-0
No files found.
dlib/test/statistics.cpp
View file @
deccc99c
...
@@ -816,6 +816,7 @@ namespace
...
@@ -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
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment