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
b44e784a
Commit
b44e784a
authored
Mar 12, 2018
by
Lukas-Buricin
Committed by
Davis E. King
Mar 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed VS 2017 level-3 warnings (#1193)
parent
973f4536
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
global_function_search.cpp
dlib/global_optimization/global_function_search.cpp
+6
-4
matrix.h
dlib/matrix/matrix.h
+8
-1
No files found.
dlib/global_optimization/global_function_search.cpp
View file @
b44e784a
...
...
@@ -168,7 +168,9 @@ namespace dlib
DLIB_CASSERT
(
x
.
size
()
>
0
);
for
(
size_t
i
=
0
;
i
<
x
.
size
();
++
i
)
DLIB_CASSERT
(
anchor
.
size
()
==
x
[
i
].
size
());
DLIB_CASSERT
(
anchor
.
size
()
+
1
<=
x
.
size
()
&&
x
.
size
()
<=
(
anchor
.
size
()
+
1
)
*
(
anchor
.
size
()
+
2
)
/
2
);
long
x_size
=
static_cast
<
long
>
(
x
.
size
());
DLIB_CASSERT
(
anchor
.
size
()
+
1
<=
x_size
&&
x_size
<=
(
anchor
.
size
()
+
1
)
*
(
anchor
.
size
()
+
2
)
/
2
);
matrix
<
double
>
X
(
anchor
.
size
(),
x
.
size
());
...
...
@@ -214,7 +216,7 @@ namespace dlib
// their best observed value and use the QP to optimize the real variables. So the
// number of dimensions, as far as the QP is concerned, is the number of non-integer
// variables.
long
dims
=
0
;
size_t
dims
=
0
;
for
(
auto
is_int
:
is_integer_variable
)
{
if
(
!
is_int
)
...
...
@@ -225,7 +227,7 @@ namespace dlib
// Use enough points to fill out a quadratic model or the max available if we don't
// have quite enough.
const
long
N
=
std
::
min
(
(
long
)
samples
.
size
(),
(
dims
+
1
)
*
(
dims
+
2
)
/
2
);
const
long
N
=
std
::
min
(
samples
.
size
(),
(
dims
+
1
)
*
(
dims
+
2
)
/
2
);
// first find the best sample;
...
...
@@ -376,7 +378,7 @@ namespace dlib
lower
(
std
::
move
(
bound1
)),
upper
(
std
::
move
(
bound2
))
{
DLIB_CASSERT
(
lower
.
size
()
==
upper
.
size
());
for
(
size_t
i
=
0
;
i
<
lower
.
size
();
++
i
)
for
(
long
i
=
0
;
i
<
lower
.
size
();
++
i
)
{
if
(
upper
(
i
)
<
lower
(
i
))
std
::
swap
(
lower
(
i
),
upper
(
i
));
...
...
dlib/matrix/matrix.h
View file @
b44e784a
...
...
@@ -33,6 +33,12 @@
// warning off and then turning it back on at the end of the file.
#pragma warning(disable : 4355)
// "warning C4723: potential divide by 0" - This warning is triggered in
// matrix(const std::initializer_list<T>& l) where the compiler can see that
// matrix<> was templated in a way making NR ending up 0, but division by 0 at runtime
// is not possible because the division operation is inside "if (NR!=0)" block.
#pragma warning(disable : 4723)
#endif
namespace
dlib
...
...
@@ -2147,8 +2153,9 @@ namespace dlib
}
#ifdef _MSC_VER
// put
that warning back to its default setting
// put
warnings back to their default settings
#pragma warning(default : 4355)
#pragma warning(default : 4723)
#endif
#endif // DLIB_MATRIx_
...
...
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