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
tianlh
LightGBM-DCU
Commits
3a665f62
Unverified
Commit
3a665f62
authored
Jan 12, 2018
by
Guolin Ke
Committed by
GitHub
Jan 12, 2018
Browse files
fix a bug in `ArgMaxAtK` (#1196)
* fix a bug in `ArgMaxAtK`
parent
9e223c3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
include/LightGBM/utils/array_args.h
include/LightGBM/utils/array_args.h
+2
-1
No files found.
include/LightGBM/utils/array_args.h
View file @
3a665f62
...
...
@@ -133,7 +133,8 @@ public:
int
l
=
start
;
int
r
=
end
-
1
;
Partition
(
arr
,
start
,
end
,
&
l
,
&
r
);
if
((
k
>
l
&&
k
<
r
)
||
l
==
0
||
r
==
end
-
1
)
{
// if find or all elements are the same.
if
((
k
>
l
&&
k
<
r
)
||
(
l
==
start
-
1
&&
r
==
end
-
1
))
{
return
k
;
}
else
if
(
k
<=
l
)
{
return
ArgMaxAtK
(
arr
,
start
,
l
+
1
,
k
);
...
...
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