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
0aa8b4cb
Unverified
Commit
0aa8b4cb
authored
Apr 13, 2022
by
Juha Reunanen
Committed by
GitHub
Apr 12, 2022
Browse files
Treat warnings as errors (#2490)
parent
49314c12
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
64 additions
and
148 deletions
+64
-148
dlib/algs.h
dlib/algs.h
+1
-1
dlib/array2d/array2d_kernel.h
dlib/array2d/array2d_kernel.h
+6
-4
dlib/bayes_utils/bayes_utils.h
dlib/bayes_utils/bayes_utils.h
+0
-1
dlib/crc32/crc32_kernel_1.h
dlib/crc32/crc32_kernel_1.h
+3
-18
dlib/crc32/crc32_kernel_abstract.h
dlib/crc32/crc32_kernel_abstract.h
+1
-1
dlib/cuda/cpu_dlib.cpp
dlib/cuda/cpu_dlib.cpp
+1
-1
dlib/dnn/core.h
dlib/dnn/core.h
+3
-3
dlib/dnn/input.h
dlib/dnn/input.h
+4
-5
dlib/dnn/visitors.h
dlib/dnn/visitors.h
+4
-4
dlib/geometry/rectangle.h
dlib/geometry/rectangle.h
+2
-2
dlib/interfaces/map_pair.h
dlib/interfaces/map_pair.h
+3
-0
dlib/pixel.h
dlib/pixel.h
+10
-0
dlib/static_map/static_map_kernel_1.h
dlib/static_map/static_map_kernel_1.h
+3
-3
dlib/svm/assignment_function.h
dlib/svm/assignment_function.h
+1
-1
dlib/svm/function.h
dlib/svm/function.h
+0
-46
dlib/svm/function_abstract.h
dlib/svm/function_abstract.h
+1
-52
dlib/svm/pegasos.h
dlib/svm/pegasos.h
+1
-1
dlib/svm/structural_svm_assignment_problem.h
dlib/svm/structural_svm_assignment_problem.h
+1
-1
dlib/test/CMakeLists.txt
dlib/test/CMakeLists.txt
+18
-3
dlib/test/compress_stream.cpp
dlib/test/compress_stream.cpp
+1
-1
No files found.
dlib/algs.h
View file @
0aa8b4cb
...
@@ -370,7 +370,7 @@ namespace dlib
...
@@ -370,7 +370,7 @@ namespace dlib
and the fact that this has a different name (global swap has the same name as
and the fact that this has a different name (global swap has the same name as
the member functions called swap) makes them compile right.
the member functions called swap) makes them compile right.
So this is a workaround but not too ugly of one. But hopefully I
get
get
So this is a workaround but not too ugly of one. But hopefully I
can
get
rid of this in a few years. So this function is already deprecated.
rid of this in a few years. So this function is already deprecated.
This also means you should NOT use this function in your own code unless
This also means you should NOT use this function in your own code unless
...
...
dlib/array2d/array2d_kernel.h
View file @
0aa8b4cb
...
@@ -117,14 +117,16 @@ namespace dlib
...
@@ -117,14 +117,16 @@ namespace dlib
private:
private:
row
(
T
*
data_
,
long
cols
)
:
data
(
data_
),
nc_
(
cols
)
{}
row
(
T
*
data_
,
long
cols
)
:
data
(
data_
),
nc_
(
cols
)
{}
row
(
row
&&
r
)
=
default
;
row
&
operator
=
(
row
&&
r
)
=
default
;
T
*
data
;
T
*
data
=
nullptr
;
long
nc_
;
long
nc_
=
0
;
// restricted functions
// restricted functions
row
(
){}
row
(
const
row
&
)
=
delete
;
row
&
operator
=
(
row
&
)
;
row
&
operator
=
(
const
row
&
)
=
delete
;
};
};
// -----------------------------------
// -----------------------------------
...
...
dlib/bayes_utils/bayes_utils.h
View file @
0aa8b4cb
...
@@ -1518,7 +1518,6 @@ namespace dlib
...
@@ -1518,7 +1518,6 @@ namespace dlib
bool
message_sent
=
true
;
bool
message_sent
=
true
;
std
::
vector
<
unsigned
long
>::
iterator
iter
;
while
(
message_sent
)
while
(
message_sent
)
{
{
message_sent
=
false
;
message_sent
=
false
;
...
...
dlib/crc32/crc32_kernel_1.h
View file @
0aa8b4cb
...
@@ -65,10 +65,6 @@ namespace dlib
...
@@ -65,10 +65,6 @@ namespace dlib
crc32
&
item
crc32
&
item
);
);
inline
crc32
&
operator
=
(
const
crc32
&
);
private:
private:
unsigned
long
checksum
;
unsigned
long
checksum
;
...
@@ -243,17 +239,6 @@ namespace dlib
...
@@ -243,17 +239,6 @@ namespace dlib
exchange
(
checksum
,
item
.
checksum
);
exchange
(
checksum
,
item
.
checksum
);
}
}
// ----------------------------------------------------------------------------------------
crc32
&
crc32
::
operator
=
(
const
crc32
&
item
)
{
checksum
=
item
.
checksum
;
return
*
this
;
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
}
}
...
...
dlib/crc32/crc32_kernel_abstract.h
View file @
0aa8b4cb
dlib/cuda/cpu_dlib.cpp
View file @
0aa8b4cb
...
@@ -2479,7 +2479,7 @@ namespace dlib
...
@@ -2479,7 +2479,7 @@ namespace dlib
float
*
t
=
&
output
(
0
,
0
);
float
*
t
=
&
output
(
0
,
0
);
// now fill in the Toeplitz output matrix for the n-th sample in data.
// now fill in the Toeplitz output matrix for the n-th sample in data.
size_t
cnt
=
0
;
long
cnt
=
0
;
const
long
max_r
=
data
.
nr
()
+
padding_y
-
(
filter_nr
-
1
);
const
long
max_r
=
data
.
nr
()
+
padding_y
-
(
filter_nr
-
1
);
const
long
max_c
=
data
.
nc
()
+
padding_x
-
(
filter_nc
-
1
);
const
long
max_c
=
data
.
nc
()
+
padding_x
-
(
filter_nc
-
1
);
for
(
long
r
=
-
padding_y
;
r
<
max_r
;
r
+=
stride_y
)
for
(
long
r
=
-
padding_y
;
r
<
max_r
;
r
+=
stride_y
)
...
...
dlib/dnn/core.h
View file @
0aa8b4cb
...
@@ -2259,7 +2259,7 @@ namespace dlib
...
@@ -2259,7 +2259,7 @@ namespace dlib
void
back_propagate_error
(
void
back_propagate_error
(
const
tensor
&
/*x*/
,
const
tensor
&
/*x*/
,
const
tensor
&
/*gradient_input*/
,
const
tensor
&
/*gradient_input*/
,
zero_gradients
zero_grads
=
zero_gradients
::
yes
zero_gradients
/*
zero_grads
*/
=
zero_gradients
::
yes
)
)
{
{
// nothing to do
// nothing to do
...
@@ -3746,7 +3746,7 @@ namespace dlib
...
@@ -3746,7 +3746,7 @@ namespace dlib
typename
visitor
typename
visitor
>
>
static
void
visit
(
static
void
visit
(
net_type
&
net
,
net_type
&
,
const
add_tag_layer
<
tag_id
,
SUBNET
>&
next_net
,
const
add_tag_layer
<
tag_id
,
SUBNET
>&
next_net
,
visitor
&&
v
visitor
&&
v
)
)
...
@@ -3760,7 +3760,7 @@ namespace dlib
...
@@ -3760,7 +3760,7 @@ namespace dlib
typename
visitor
typename
visitor
>
>
static
void
visit
(
static
void
visit
(
net_type
&
net
,
net_type
&
,
add_tag_layer
<
tag_id
,
SUBNET
>&
next_net
,
add_tag_layer
<
tag_id
,
SUBNET
>&
next_net
,
visitor
&&
v
visitor
&&
v
)
)
...
...
dlib/dnn/input.h
View file @
0aa8b4cb
...
@@ -476,7 +476,6 @@ namespace dlib
...
@@ -476,7 +476,6 @@ namespace dlib
typedef
matrix
<
T
,
NR
,
NC
,
MM
,
L
>
input_type
;
typedef
matrix
<
T
,
NR
,
NC
,
MM
,
L
>
input_type
;
input
()
{}
input
()
{}
input
(
const
input
&
)
{}
template
<
typename
mm
>
template
<
typename
mm
>
input
(
const
input
<
array2d
<
T
,
mm
>>&
)
{}
input
(
const
input
<
array2d
<
T
,
mm
>>&
)
{}
...
@@ -728,25 +727,25 @@ namespace dlib
...
@@ -728,25 +727,25 @@ namespace dlib
}
}
friend
void
serialize
(
const
input
&
item
,
std
::
ostream
&
out
)
friend
void
serialize
(
const
input
&
,
std
::
ostream
&
out
)
{
{
serialize
(
"input<array2d>"
,
out
);
serialize
(
"input<array2d>"
,
out
);
}
}
friend
void
deserialize
(
input
&
item
,
std
::
istream
&
in
)
friend
void
deserialize
(
input
&
,
std
::
istream
&
in
)
{
{
std
::
string
version
;
std
::
string
version
;
deserialize
(
version
,
in
);
deserialize
(
version
,
in
);
if
(
version
!=
"input<array2d>"
)
if
(
version
!=
"input<array2d>"
)
throw
serialization_error
(
"Unexpected version found while deserializing dlib::input."
);
throw
serialization_error
(
"Unexpected version found while deserializing dlib::input."
);
}
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
input
&
item
)
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
input
&
)
{
{
out
<<
"input<array2d>"
;
out
<<
"input<array2d>"
;
return
out
;
return
out
;
}
}
friend
void
to_xml
(
const
input
&
item
,
std
::
ostream
&
out
)
friend
void
to_xml
(
const
input
&
,
std
::
ostream
&
out
)
{
{
out
<<
"<input/>"
;
out
<<
"<input/>"
;
}
}
...
...
dlib/dnn/visitors.h
View file @
0aa8b4cb
...
@@ -552,7 +552,7 @@ namespace dlib
...
@@ -552,7 +552,7 @@ namespace dlib
visitor_net_to_dot
(
std
::
ostream
&
out
)
:
out
(
out
)
{}
visitor_net_to_dot
(
std
::
ostream
&
out
)
:
out
(
out
)
{}
template
<
typename
input_layer_type
>
template
<
typename
input_layer_type
>
void
operator
()(
size_t
i
,
input_layer_type
&
l
)
void
operator
()(
size_t
i
,
input_layer_type
&
)
{
{
start_node
(
i
,
"input"
);
start_node
(
i
,
"input"
);
end_node
();
end_node
();
...
@@ -609,7 +609,7 @@ namespace dlib
...
@@ -609,7 +609,7 @@ namespace dlib
}
}
template
<
template
<
typename
>
class
TAG
,
typename
U
>
template
<
template
<
typename
>
class
TAG
,
typename
U
>
void
operator
()(
size_t
i
,
const
add_skip_layer
<
TAG
,
U
>&
)
void
operator
()(
size_t
,
const
add_skip_layer
<
TAG
,
U
>&
)
{
{
const
auto
t
=
tag_id
<
TAG
>::
id
;
const
auto
t
=
tag_id
<
TAG
>::
id
;
from
=
tag_to_layer
.
at
(
t
);
from
=
tag_to_layer
.
at
(
t
);
...
@@ -887,7 +887,7 @@ namespace dlib
...
@@ -887,7 +887,7 @@ namespace dlib
}
}
template
<
template
<
typename
>
class
...
TAGS
,
typename
U
,
typename
E
>
template
<
template
<
typename
>
class
...
TAGS
,
typename
U
,
typename
E
>
void
operator
()(
size_t
i
,
const
add_layer
<
concat_
<
TAGS
...
>
,
U
,
E
>&
l
)
void
operator
()(
size_t
i
,
const
add_layer
<
concat_
<
TAGS
...
>
,
U
,
E
>&
)
{
{
start_node
(
i
,
"concat"
);
start_node
(
i
,
"concat"
);
end_node
();
end_node
();
...
@@ -930,7 +930,7 @@ namespace dlib
...
@@ -930,7 +930,7 @@ namespace dlib
}
}
template
<
typename
T
,
typename
U
,
typename
E
>
template
<
typename
T
,
typename
U
,
typename
E
>
void
operator
()(
size_t
i
,
const
add_layer
<
T
,
U
,
E
>&
l
)
void
operator
()(
size_t
i
,
const
add_layer
<
T
,
U
,
E
>&
)
{
{
start_node
(
i
,
"unhandled layer"
);
start_node
(
i
,
"unhandled layer"
);
update
(
i
);
update
(
i
);
...
...
dlib/geometry/rectangle.h
View file @
0aa8b4cb
...
@@ -750,7 +750,7 @@ namespace dlib
...
@@ -750,7 +750,7 @@ namespace dlib
// Circumvent what appears to be a bug in Visual Studio 2019's optimizer
// Circumvent what appears to be a bug in Visual Studio 2019's optimizer
// (see: https://forum.juce.com/t/warning-in-the-lastest-vs2019/38267)
// (see: https://forum.juce.com/t/warning-in-the-lastest-vs2019/38267)
#if defined (_MS
V
C_VER)
#if defined (_MSC_VER)
#pragma warning ( push )
#pragma warning ( push )
#pragma warning ( disable: 4723 )
#pragma warning ( disable: 4723 )
#endif
#endif
...
@@ -774,7 +774,7 @@ namespace dlib
...
@@ -774,7 +774,7 @@ namespace dlib
return
centered_rect
(
rect
,
(
long
)
std
::
round
(
rect
.
width
()
*
scale
),
(
long
)
std
::
round
(
rect
.
height
()
*
scale
));
return
centered_rect
(
rect
,
(
long
)
std
::
round
(
rect
.
width
()
*
scale
),
(
long
)
std
::
round
(
rect
.
height
()
*
scale
));
}
}
}
}
#if defined (_MS
V
C_VER)
#if defined (_MSC_VER)
#pragma warning ( pop )
#pragma warning ( pop )
#endif
#endif
...
...
dlib/interfaces/map_pair.h
View file @
0aa8b4cb
...
@@ -31,6 +31,9 @@ namespace dlib
...
@@ -31,6 +31,9 @@ namespace dlib
typedef
T1
key_type
;
typedef
T1
key_type
;
typedef
T2
value_type
;
typedef
T2
value_type
;
map_pair
()
=
default
;
map_pair
(
const
map_pair
&
)
=
default
;
virtual
~
map_pair
(
virtual
~
map_pair
(
)
=
0
;
)
=
0
;
...
...
dlib/pixel.h
View file @
0aa8b4cb
...
@@ -710,6 +710,12 @@ namespace dlib
...
@@ -710,6 +710,12 @@ namespace dlib
}
}
// -----------------------------
// -----------------------------
// Apparently Visual Studio's optimizer complains about branches that would not be taken anyway.
#if defined (_MSC_VER)
#pragma warning ( push )
#pragma warning ( disable: 4756 )
#endif
template
<
typename
P1
,
typename
P2
>
template
<
typename
P1
,
typename
P2
>
typename
enable_if_c
<
pixel_traits
<
P1
>::
grayscale
&&
pixel_traits
<
P2
>::
grayscale
>::
type
typename
enable_if_c
<
pixel_traits
<
P1
>::
grayscale
&&
pixel_traits
<
P2
>::
grayscale
>::
type
assign
(
P1
&
dest
,
const
P2
&
src
)
assign
(
P1
&
dest
,
const
P2
&
src
)
...
@@ -728,6 +734,10 @@ namespace dlib
...
@@ -728,6 +734,10 @@ namespace dlib
dest
=
pixel_traits
<
P1
>::
max
();
dest
=
pixel_traits
<
P1
>::
max
();
}
}
#if defined (_MSC_VER)
#pragma warning ( pop )
#endif
// -----------------------------
// -----------------------------
// -----------------------------
// -----------------------------
// -----------------------------
// -----------------------------
...
...
dlib/static_map/static_map_kernel_1.h
View file @
0aa8b4cb
...
@@ -51,8 +51,8 @@ namespace dlib
...
@@ -51,8 +51,8 @@ namespace dlib
class
mpair
:
public
map_pair
<
domain
,
range
>
class
mpair
:
public
map_pair
<
domain
,
range
>
{
{
public:
public:
const
domain
*
d
;
const
domain
*
d
=
nullptr
;
range
*
r
;
range
*
r
=
nullptr
;
const
domain
&
key
(
const
domain
&
key
(
)
const
{
return
*
d
;
}
)
const
{
return
*
d
;
}
...
...
dlib/svm/assignment_function.h
View file @
0aa8b4cb
...
@@ -154,7 +154,7 @@ namespace dlib
...
@@ -154,7 +154,7 @@ namespace dlib
{
{
// max_cost_assignment() only works with integer matrices, so convert from
// max_cost_assignment() only works with integer matrices, so convert from
// double to integer.
// double to integer.
const
double
scale
=
(
std
::
numeric_limits
<
dlib
::
int64
>::
max
()
/
1000
)
/
max
(
abs
(
cost
));
const
double
scale
=
static_cast
<
double
>
(
std
::
numeric_limits
<
dlib
::
int64
>::
max
()
)
/
1000
/
max
(
abs
(
cost
));
matrix
<
dlib
::
int64
>
int_cost
=
matrix_cast
<
dlib
::
int64
>
(
round
(
cost
*
scale
));
matrix
<
dlib
::
int64
>
int_cost
=
matrix_cast
<
dlib
::
int64
>
(
round
(
cost
*
scale
));
assignment
=
max_cost_assignment
(
int_cost
);
assignment
=
max_cost_assignment
(
int_cost
);
assignment
.
resize
(
lhs
.
size
());
assignment
.
resize
(
lhs
.
size
());
...
...
dlib/svm/function.h
View file @
0aa8b4cb
...
@@ -43,15 +43,6 @@ namespace dlib
...
@@ -43,15 +43,6 @@ namespace dlib
decision_function
(
decision_function
(
)
:
b
(
0
),
kernel_function
(
K
())
{}
)
:
b
(
0
),
kernel_function
(
K
())
{}
decision_function
(
const
decision_function
&
d
)
:
alpha
(
d
.
alpha
),
b
(
d
.
b
),
kernel_function
(
d
.
kernel_function
),
basis_vectors
(
d
.
basis_vectors
)
{}
decision_function
(
decision_function
(
const
scalar_vector_type
&
alpha_
,
const
scalar_vector_type
&
alpha_
,
const
scalar_type
&
b_
,
const
scalar_type
&
b_
,
...
@@ -137,14 +128,6 @@ namespace dlib
...
@@ -137,14 +128,6 @@ namespace dlib
probabilistic_function
(
probabilistic_function
(
)
:
alpha
(
0
),
beta
(
0
),
decision_funct
(
function_type
())
{}
)
:
alpha
(
0
),
beta
(
0
),
decision_funct
(
function_type
())
{}
probabilistic_function
(
const
probabilistic_function
&
d
)
:
alpha
(
d
.
alpha
),
beta
(
d
.
beta
),
decision_funct
(
d
.
decision_funct
)
{}
probabilistic_function
(
probabilistic_function
(
const
scalar_type
a_
,
const
scalar_type
a_
,
const
scalar_type
b_
,
const
scalar_type
b_
,
...
@@ -232,14 +215,6 @@ namespace dlib
...
@@ -232,14 +215,6 @@ namespace dlib
decision_funct
(
d
.
decision_funct
)
decision_funct
(
d
.
decision_funct
)
{}
{}
probabilistic_decision_function
(
const
probabilistic_decision_function
&
d
)
:
alpha
(
d
.
alpha
),
beta
(
d
.
beta
),
decision_funct
(
d
.
decision_funct
)
{}
probabilistic_decision_function
(
probabilistic_decision_function
(
const
scalar_type
a_
,
const
scalar_type
a_
,
const
scalar_type
b_
,
const
scalar_type
b_
,
...
@@ -353,16 +328,6 @@ namespace dlib
...
@@ -353,16 +328,6 @@ namespace dlib
);
);
}
}
distance_function
(
const
distance_function
&
d
)
:
alpha
(
d
.
alpha
),
b
(
d
.
b
),
kernel_function
(
d
.
kernel_function
),
basis_vectors
(
d
.
basis_vectors
)
{
}
distance_function
(
distance_function
(
const
scalar_vector_type
&
alpha_
,
const
scalar_vector_type
&
alpha_
,
const
scalar_type
&
b_
,
const
scalar_type
&
b_
,
...
@@ -586,13 +551,6 @@ namespace dlib
...
@@ -586,13 +551,6 @@ namespace dlib
normalized_function
(
normalized_function
(
){}
){}
normalized_function
(
const
normalized_function
&
f
)
:
normalizer
(
f
.
normalizer
),
function
(
f
.
function
)
{}
const
std
::
vector
<
result_type
>
get_labels
(
const
std
::
vector
<
result_type
>
get_labels
(
)
const
{
return
function
.
get_labels
();
}
)
const
{
return
function
.
get_labels
();
}
...
@@ -673,10 +631,6 @@ namespace dlib
...
@@ -673,10 +631,6 @@ namespace dlib
projection_function
(
projection_function
(
)
{}
)
{}
projection_function
(
const
projection_function
&
f
)
:
weights
(
f
.
weights
),
kernel_function
(
f
.
kernel_function
),
basis_vectors
(
f
.
basis_vectors
)
{}
projection_function
(
projection_function
(
const
scalar_matrix_type
&
weights_
,
const
scalar_matrix_type
&
weights_
,
const
K
&
kernel_function_
,
const
K
&
kernel_function_
,
...
...
dlib/svm/function_abstract.h
View file @
0aa8b4cb
...
@@ -64,14 +64,6 @@ namespace dlib
...
@@ -64,14 +64,6 @@ namespace dlib
- #basis_vectors.nr() == 0
- #basis_vectors.nr() == 0
!*/
!*/
decision_function
(
const
decision_function
&
f
);
/*!
ensures
- #*this is a copy of f
!*/
decision_function
(
decision_function
(
const
scalar_vector_type
&
alpha_
,
const
scalar_vector_type
&
alpha_
,
const
scalar_type
&
b_
,
const
scalar_type
&
b_
,
...
@@ -169,14 +161,6 @@ namespace dlib
...
@@ -169,14 +161,6 @@ namespace dlib
- #decision_funct has its initial value
- #decision_funct has its initial value
!*/
!*/
probabilistic_function
(
const
probabilistic_function
&
f
);
/*!
ensures
- #*this is a copy of f
!*/
probabilistic_function
(
probabilistic_function
(
const
scalar_type
a
,
const
scalar_type
a
,
const
scalar_type
b
,
const
scalar_type
b
,
...
@@ -282,15 +266,7 @@ namespace dlib
...
@@ -282,15 +266,7 @@ namespace dlib
!*/
!*/
probabilistic_decision_function
(
probabilistic_decision_function
(
const
probabilistic_decision_function
&
f
const
probabilistic_function
<
decision_function
<
K
>
>&
f
);
/*!
ensures
- #*this is a copy of f
!*/
probabilistic_decision_function
(
const
probabilistic_function
<
decision_function
<
K
>
>&
d
);
);
/*!
/*!
ensures
ensures
...
@@ -445,17 +421,6 @@ namespace dlib
...
@@ -445,17 +421,6 @@ namespace dlib
- #get_basis_vectors() == f.basis_vectors
- #get_basis_vectors() == f.basis_vectors
!*/
!*/
distance_function
(
const
distance_function
&
f
);
/*!
requires
- f is a valid distance_function. In particular, this means that
f.alpha.size() == f.basis_vectors.size()
ensures
- #*this is a copy of f
!*/
distance_function
(
distance_function
(
const
scalar_vector_type
&
alpha
,
const
scalar_vector_type
&
alpha
,
const
scalar_type
&
squared_norm
,
const
scalar_type
&
squared_norm
,
...
@@ -679,14 +644,6 @@ namespace dlib
...
@@ -679,14 +644,6 @@ namespace dlib
- the members of this object have their default values
- the members of this object have their default values
!*/
!*/
normalized_function
(
const
normalized_function
&
f
);
/*!
ensures
- #*this is a copy of f
!*/
normalized_function
(
normalized_function
(
const
vector_normalizer
<
sample_type
>&
normalizer_
,
const
vector_normalizer
<
sample_type
>&
normalizer_
,
const
function_type
&
funct
const
function_type
&
funct
...
@@ -791,14 +748,6 @@ namespace dlib
...
@@ -791,14 +748,6 @@ namespace dlib
- #basis_vectors.size() == 0
- #basis_vectors.size() == 0
!*/
!*/
projection_function
(
const
projection_function
&
f
);
/*!
ensures
- #*this is a copy of f
!*/
projection_function
(
projection_function
(
const
scalar_matrix_type
&
weights_
,
const
scalar_matrix_type
&
weights_
,
const
K
&
kernel_function_
,
const
K
&
kernel_function_
,
...
...
dlib/svm/pegasos.h
View file @
0aa8b4cb
...
@@ -655,7 +655,7 @@ namespace dlib
...
@@ -655,7 +655,7 @@ namespace dlib
trainer_type
trainer
;
trainer_type
trainer
;
scalar_type
min_learning_rate
;
scalar_type
min_learning_rate
;
bool
verbose
;
bool
verbose
=
true
;
bool
use_cache
;
bool
use_cache
;
long
cache_size
;
long
cache_size
;
...
...
dlib/svm/structural_svm_assignment_problem.h
View file @
0aa8b4cb
...
@@ -247,7 +247,7 @@ namespace dlib
...
@@ -247,7 +247,7 @@ namespace dlib
{
{
// max_cost_assignment() only works with integer matrices, so convert from
// max_cost_assignment() only works with integer matrices, so convert from
// double to integer.
// double to integer.
const
double
scale
=
(
std
::
numeric_limits
<
dlib
::
int64
>::
max
()
/
1000
)
/
max
(
abs
(
cost
));
const
double
scale
=
static_cast
<
double
>
(
std
::
numeric_limits
<
dlib
::
int64
>::
max
()
)
/
1000
/
max
(
abs
(
cost
));
matrix
<
dlib
::
int64
>
int_cost
=
matrix_cast
<
dlib
::
int64
>
(
round
(
cost
*
scale
));
matrix
<
dlib
::
int64
>
int_cost
=
matrix_cast
<
dlib
::
int64
>
(
round
(
cost
*
scale
));
assignment
=
max_cost_assignment
(
int_cost
);
assignment
=
max_cost_assignment
(
int_cost
);
assignment
.
resize
(
samples
[
idx
].
first
.
size
());
assignment
.
resize
(
samples
[
idx
].
first
.
size
());
...
...
dlib/test/CMakeLists.txt
View file @
0aa8b4cb
...
@@ -166,13 +166,22 @@ set (tests
...
@@ -166,13 +166,22 @@ set (tests
# cmake that they are part of our target (which is the executable named dtest)
# cmake that they are part of our target (which is the executable named dtest)
ADD_EXECUTABLE
(
${
target_name
}
main.cpp tester.cpp
${
tests
}
)
ADD_EXECUTABLE
(
${
target_name
}
main.cpp tester.cpp
${
tests
}
)
# Turn on all warnings when using gcc.
if
(
CMAKE_COMPILER_IS_GNUCXX
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
add_definitions
(
"-W -Wall"
)
# Turn on all warnings, and treat them as errors.
add_definitions
(
"-W -Wall -Wextra -Werror"
)
# I don't care about unused testing functions though. I like to keep them
# I don't care about unused testing functions though. I like to keep them
# around. Don't warn about it.
# around. Don't warn about it.
add_definitions
(
"-Wno-unused-function"
)
add_definitions
(
"-Wno-unused-function"
)
add_definitions
(
"-Wno-strict-overflow"
)
add_definitions
(
"-Wno-strict-overflow"
)
add_definitions
(
"-Wno-maybe-uninitialized"
)
elseif
(
MSVC
)
# Treat warnings as errors.
add_definitions
(
"/WX"
)
else
()
# basically Clang
# Treat warnings as errors, but do not turn on all warnings.
add_definitions
(
"-W -Werror"
)
# This is for the comment in face_detection_ex.cpp that says "faces/*.jpg"
add_definitions
(
"-Wno-comment"
)
endif
()
endif
()
...
@@ -181,6 +190,12 @@ TARGET_LINK_LIBRARIES(${target_name} dlib::dlib )
...
@@ -181,6 +190,12 @@ TARGET_LINK_LIBRARIES(${target_name} dlib::dlib )
if
(
NOT DLIB_NO_GUI_SUPPORT
)
if
(
NOT DLIB_NO_GUI_SUPPORT
)
add_subdirectory
(
gui
)
add_subdirectory
(
gui
)
add_subdirectory
(
examples
)
add_subdirectory
(
tools
)
add_subdirectory
(
tools
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
# The tutorials set some variables that are not used.
add_definitions
(
"-Wno-unused-but-set-variable"
)
endif
()
add_subdirectory
(
examples
)
endif
()
endif
()
dlib/test/compress_stream.cpp
View file @
0aa8b4cb
...
@@ -75,7 +75,7 @@ namespace
...
@@ -75,7 +75,7 @@ namespace
bool
detected_error
=
false
;
bool
detected_error
=
false
;
try
{
try
{
test
.
decompress
(
sin
,
sout
);
test
.
decompress
(
sin
,
sout
);
}
catch
(
typename
cs
::
decompression_error
&
e
)
}
catch
(
typename
cs
::
decompression_error
&
)
{
{
detected_error
=
true
;
detected_error
=
true
;
++
count
;
++
count
;
...
...
Prev
1
2
Next
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