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
22007f66
Commit
22007f66
authored
Jan 18, 2021
by
Davis King
Browse files
work around bug in visual studio
parent
b8807922
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
dlib/test/global_optimization.cpp
dlib/test/global_optimization.cpp
+1
-1
No files found.
dlib/test/global_optimization.cpp
View file @
22007f66
...
...
@@ -234,7 +234,7 @@ namespace
print_spinner
();
constexpr
auto
close_enough
=
-
16.0
;
auto
early_result
=
find_max_global
([
&
early_evals
](
double
x
){
early_evals
++
;
return
-
std
::
pow
(
x
-
2
,
2.0
);
},
-
10
,
1
,
max_function_calls
(
10
),
0.0
,
std
::
vector
<
function_evaluation
>
{},
[](
double
y
){
return
(
y
>=
close_enough
);});
auto
early_result
=
find_max_global
([
&
early_evals
](
double
x
){
early_evals
++
;
return
-
std
::
pow
(
x
-
2
,
2.0
);
},
-
10
,
1
,
max_function_calls
(
10
),
0.0
,
std
::
vector
<
function_evaluation
>
{},
[
&
](
double
y
){
return
(
y
>=
close_enough
);});
dlog
<<
LINFO
<<
"(x-2)^2, bound at 1: "
<<
trans
(
early_result
.
x
);
DLIB_TEST
(
early_result
.
x
.
size
()
==
1
);
DLIB_TEST
(
std
::
abs
(
early_result
.
y
)
<=
std
::
abs
(
close_enough
));
...
...
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