Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
6c66d22b
"...transform/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "6014623d8f01bbb6858febb08e20596682b75175"
Commit
6c66d22b
authored
Oct 03, 2016
by
Davis King
Browse files
Made find_upper_quantile() more general
parent
5fe0a5f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
dlib/statistics/running_gradient.h
dlib/statistics/running_gradient.h
+5
-1
dlib/statistics/running_gradient_abstract.h
dlib/statistics/running_gradient_abstract.h
+1
-1
No files found.
dlib/statistics/running_gradient.h
View file @
6c66d22b
...
@@ -222,11 +222,15 @@ namespace dlib
...
@@ -222,11 +222,15 @@ namespace dlib
typename
T
typename
T
>
>
double
find_upper_quantile
(
double
find_upper_quantile
(
T
container
,
const
T
&
container
_
,
double
quantile
double
quantile
)
)
{
{
DLIB_CASSERT
(
0
<=
quantile
&&
quantile
<=
1.0
);
DLIB_CASSERT
(
0
<=
quantile
&&
quantile
<=
1.0
);
// copy container into a std::vector
std
::
vector
<
double
>
container
(
container_
.
begin
(),
container_
.
end
());
DLIB_CASSERT
(
container
.
size
()
>
0
);
DLIB_CASSERT
(
container
.
size
()
>
0
);
size_t
idx_upper
=
std
::
round
((
container
.
size
()
-
1
)
*
(
1
-
quantile
));
size_t
idx_upper
=
std
::
round
((
container
.
size
()
-
1
)
*
(
1
-
quantile
));
...
...
dlib/statistics/running_gradient_abstract.h
View file @
6c66d22b
...
@@ -251,7 +251,7 @@ namespace dlib
...
@@ -251,7 +251,7 @@ namespace dlib
typename
T
typename
T
>
>
double
find_upper_quantile
(
double
find_upper_quantile
(
T
container
,
const
T
&
container
,
double
quantile
double
quantile
);
);
/*!
/*!
...
...
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