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
70e767bf
Commit
70e767bf
authored
Apr 21, 2017
by
Davis King
Browse files
merged
parents
6d636ffb
802fc36d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
42 deletions
+40
-42
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+14
-14
dlib/cmake_utils/add_python_module
dlib/cmake_utils/add_python_module
+1
-1
dlib/cmake_utils/dlib.pc.in
dlib/cmake_utils/dlib.pc.in
+2
-4
dlib/graph_cuts/min_cut.h
dlib/graph_cuts/min_cut.h
+14
-14
dlib/matrix/lapack/gees.h
dlib/matrix/lapack/gees.h
+4
-4
dlib/test/optimization_test_functions.cpp
dlib/test/optimization_test_functions.cpp
+1
-1
dlib/test/tuple.cpp
dlib/test/tuple.cpp
+4
-4
No files found.
dlib/CMakeLists.txt
View file @
70e767bf
...
@@ -7,6 +7,9 @@
...
@@ -7,6 +7,9 @@
cmake_minimum_required
(
VERSION 2.8.12
)
cmake_minimum_required
(
VERSION 2.8.12
)
project
(
dlib
)
project
(
dlib
)
# Adhere to GNU filesystem layout conventions
include
(
GNUInstallDirs
)
# default to a Release build (except if CMAKE_BUILD_TYPE is set)
# default to a Release build (except if CMAKE_BUILD_TYPE is set)
include
(
cmake_utils/release_build_by_default
)
include
(
cmake_utils/release_build_by_default
)
include
(
cmake_utils/use_cpp_11.cmake
)
include
(
cmake_utils/use_cpp_11.cmake
)
...
@@ -709,7 +712,6 @@ if (NOT TARGET dlib)
...
@@ -709,7 +712,6 @@ if (NOT TARGET dlib)
# Install the library
# Install the library
if
(
NOT DLIB_IN_PROJECT_BUILD
)
if
(
NOT DLIB_IN_PROJECT_BUILD
)
set
(
LIB_INSTALL_DIR lib CACHE STRING
"Install location of libraries (e.g. lib32 or lib64 for multilib installations)"
)
cmake_minimum_required
(
VERSION 2.8.8
)
cmake_minimum_required
(
VERSION 2.8.8
)
if
(
UNIX
)
if
(
UNIX
)
set_target_properties
(
dlib_shared PROPERTIES
set_target_properties
(
dlib_shared PROPERTIES
...
@@ -717,34 +719,32 @@ if (NOT TARGET dlib)
...
@@ -717,34 +719,32 @@ if (NOT TARGET dlib)
VERSION
${
VERSION
}
)
VERSION
${
VERSION
}
)
install
(
TARGETS dlib dlib_shared
install
(
TARGETS dlib dlib_shared
EXPORT dlib
EXPORT dlib
RUNTIME DESTINATION
bin
# Windows (including cygwin) considers .dll to be runtime artifacts
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
# Windows (including cygwin) considers .dll to be runtime artifacts
LIBRARY DESTINATION
"
${
LIB
_INSTALL_DIR
}
"
LIBRARY DESTINATION
${
CMAKE
_INSTALL_
LIB
DIR
}
ARCHIVE DESTINATION
"
${
LIB
_INSTALL_DIR
}
"
)
ARCHIVE DESTINATION
${
CMAKE
_INSTALL_
LIB
DIR
}
)
else
()
else
()
install
(
TARGETS dlib
install
(
TARGETS dlib
EXPORT dlib
EXPORT dlib
RUNTIME DESTINATION
bin
# Windows considers .dll to be runtime artifacts
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
# Windows considers .dll to be runtime artifacts
LIBRARY DESTINATION
lib
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
lib
)
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
endif
()
endif
()
install
(
DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/ DESTINATION
include
/dlib
install
(
DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/ DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
FILES_MATCHING PATTERN
"*.h"
PATTERN
"*.cmake"
FILES_MATCHING PATTERN
"*.h"
PATTERN
"*.cmake"
REGEX
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
EXCLUDE
)
REGEX
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
EXCLUDE
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/config.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/config.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h
)
# overwrite config.h with the configured one
# overwrite config.h with the configured one
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h DESTINATION
include
/dlib
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/revision.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/revision.h
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/revision.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/revision.h
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/revision.h DESTINATION include/dlib
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/revision.h DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
)
install
(
FILES
"LICENSE.txt"
DESTINATION share/doc/dlib
)
## Config.cmake generation and installation
## Config.cmake generation and installation
set
(
ConfigPackageLocation
"
${
LIB
_INSTALL_DIR
}
/cmake/dlib"
)
set
(
ConfigPackageLocation
"
${
CMAKE
_INSTALL_
LIB
DIR
}
/cmake/dlib"
)
install
(
EXPORT dlib
install
(
EXPORT dlib
NAMESPACE dlib::
NAMESPACE dlib::
DESTINATION
${
ConfigPackageLocation
}
)
DESTINATION
${
ConfigPackageLocation
}
)
...
@@ -768,7 +768,7 @@ if (NOT TARGET dlib)
...
@@ -768,7 +768,7 @@ if (NOT TARGET dlib)
configure_file
(
"cmake_utils/dlib.pc.in"
"dlib-1.pc"
@ONLY
)
configure_file
(
"cmake_utils/dlib.pc.in"
"dlib-1.pc"
@ONLY
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dlib-1.pc"
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dlib-1.pc"
DESTINATION
"
${
LIB
_INSTALL_DIR
}
/pkgconfig"
)
DESTINATION
"
${
CMAKE
_INSTALL_
LIB
DIR
}
/pkgconfig"
)
endif
()
endif
()
...
...
dlib/cmake_utils/add_python_module
View file @
70e767bf
...
@@ -68,7 +68,7 @@ if (PYTHON3)
...
@@ -68,7 +68,7 @@ if (PYTHON3)
if (NOT Boost_FOUND)
if (NOT Boost_FOUND)
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
endif()
endif()
set(Python_ADDITIONAL_VERSIONS 3.5)
set(Python_ADDITIONAL_VERSIONS 3.5
3.6
)
FIND_PACKAGE(PythonLibs 3.4 REQUIRED)
FIND_PACKAGE(PythonLibs 3.4 REQUIRED)
else()
else()
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
...
...
dlib/cmake_utils/dlib.pc.in
View file @
70e767bf
prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
exec_prefix=${prefix}
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=${exec_prefix}/@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: @PROJECT_NAME@
Name: @PROJECT_NAME@
Description: Numerical and networking C++ library
Description: Numerical and networking C++ library
...
...
dlib/graph_cuts/min_cut.h
View file @
70e767bf
...
@@ -162,9 +162,9 @@ namespace dlib
...
@@ -162,9 +162,9 @@ namespace dlib
g
.
set_label
(
sink_node
,
SINK_CUT
);
g
.
set_label
(
sink_node
,
SINK_CUT
);
// used to indicate "no parent"
// used to indicate "no parent"
const
unsigned
long
n
il
=
g
.
number_of_nodes
();
const
unsigned
long
n
o_parent
=
g
.
number_of_nodes
();
parent
.
assign
(
g
.
number_of_nodes
(),
n
il
);
parent
.
assign
(
g
.
number_of_nodes
(),
n
o_parent
);
time
=
1
;
time
=
1
;
dist
.
assign
(
g
.
number_of_nodes
(),
0
);
dist
.
assign
(
g
.
number_of_nodes
(),
0
);
...
@@ -194,14 +194,14 @@ namespace dlib
...
@@ -194,14 +194,14 @@ namespace dlib
private:
private:
unsigned
long
distance_to_origin
(
unsigned
long
distance_to_origin
(
const
unsigned
long
n
il
,
const
unsigned
long
n
o_parent
,
unsigned
long
p
,
unsigned
long
p
,
unsigned
long
unsigned
long
)
const
)
const
{
{
unsigned
long
start
=
p
;
unsigned
long
start
=
p
;
unsigned
long
count
=
0
;
unsigned
long
count
=
0
;
while
(
p
!=
n
il
)
while
(
p
!=
n
o_parent
)
{
{
if
(
ts
[
p
]
==
time
)
if
(
ts
[
p
]
==
time
)
{
{
...
@@ -237,7 +237,7 @@ namespace dlib
...
@@ -237,7 +237,7 @@ namespace dlib
typedef
typename
flow_graph
::
in_edge_iterator
in_edge_iterator
;
typedef
typename
flow_graph
::
in_edge_iterator
in_edge_iterator
;
// used to indicate "no parent"
// used to indicate "no parent"
const
unsigned
long
n
il
=
g
.
number_of_nodes
();
const
unsigned
long
n
o_parent
=
g
.
number_of_nodes
();
while
(
orphans
.
size
()
>
0
)
while
(
orphans
.
size
()
>
0
)
{
{
...
@@ -260,7 +260,7 @@ namespace dlib
...
@@ -260,7 +260,7 @@ namespace dlib
if
(
g
.
get_label
(
id
)
!=
label_p
||
g
.
get_flow
(
q
)
<=
0
)
if
(
g
.
get_label
(
id
)
!=
label_p
||
g
.
get_flow
(
q
)
<=
0
)
continue
;
continue
;
unsigned
long
temp
=
distance_to_origin
(
n
il
,
id
,
source
);
unsigned
long
temp
=
distance_to_origin
(
n
o_parent
,
id
,
source
);
if
(
temp
<
best_dist
)
if
(
temp
<
best_dist
)
{
{
best_dist
=
temp
;
best_dist
=
temp
;
...
@@ -276,7 +276,7 @@ namespace dlib
...
@@ -276,7 +276,7 @@ namespace dlib
}
}
// if we didn't find a parent for p
// if we didn't find a parent for p
if
(
parent
[
p
]
==
n
il
)
if
(
parent
[
p
]
==
n
o_parent
)
{
{
for
(
in_edge_iterator
q
=
begin
;
q
!=
end
;
++
q
)
for
(
in_edge_iterator
q
=
begin
;
q
!=
end
;
++
q
)
{
{
...
@@ -290,7 +290,7 @@ namespace dlib
...
@@ -290,7 +290,7 @@ namespace dlib
if
(
parent
[
id
]
==
p
)
if
(
parent
[
id
]
==
p
)
{
{
parent
[
id
]
=
n
il
;
parent
[
id
]
=
n
o_parent
;
orphans
.
push_back
(
id
);
orphans
.
push_back
(
id
);
}
}
}
}
...
@@ -309,7 +309,7 @@ namespace dlib
...
@@ -309,7 +309,7 @@ namespace dlib
if
(
g
.
get_label
(
id
)
!=
label_p
||
g
.
get_flow
(
q
)
<=
0
)
if
(
g
.
get_label
(
id
)
!=
label_p
||
g
.
get_flow
(
q
)
<=
0
)
continue
;
continue
;
unsigned
long
temp
=
distance_to_origin
(
n
il
,
id
,
sink
);
unsigned
long
temp
=
distance_to_origin
(
n
o_parent
,
id
,
sink
);
if
(
temp
<
best_dist
)
if
(
temp
<
best_dist
)
{
{
...
@@ -326,7 +326,7 @@ namespace dlib
...
@@ -326,7 +326,7 @@ namespace dlib
}
}
// if we didn't find a parent for p
// if we didn't find a parent for p
if
(
parent
[
p
]
==
n
il
)
if
(
parent
[
p
]
==
n
o_parent
)
{
{
for
(
out_edge_iterator
q
=
begin
;
q
!=
end
;
++
q
)
for
(
out_edge_iterator
q
=
begin
;
q
!=
end
;
++
q
)
{
{
...
@@ -340,7 +340,7 @@ namespace dlib
...
@@ -340,7 +340,7 @@ namespace dlib
if
(
parent
[
id
]
==
p
)
if
(
parent
[
id
]
==
p
)
{
{
parent
[
id
]
=
n
il
;
parent
[
id
]
=
n
o_parent
;
orphans
.
push_back
(
id
);
orphans
.
push_back
(
id
);
}
}
}
}
...
@@ -366,7 +366,7 @@ namespace dlib
...
@@ -366,7 +366,7 @@ namespace dlib
typedef
typename
flow_graph
::
edge_type
edge_type
;
typedef
typename
flow_graph
::
edge_type
edge_type
;
// used to indicate "no parent"
// used to indicate "no parent"
const
unsigned
long
n
il
=
g
.
number_of_nodes
();
const
unsigned
long
n
o_parent
=
g
.
number_of_nodes
();
unsigned
long
s
=
source_side
;
unsigned
long
s
=
source_side
;
unsigned
long
t
=
sink_side
;
unsigned
long
t
=
sink_side
;
...
@@ -414,7 +414,7 @@ namespace dlib
...
@@ -414,7 +414,7 @@ namespace dlib
g
.
adjust_flow
(
t
,
s
,
min_cap
);
g
.
adjust_flow
(
t
,
s
,
min_cap
);
if
(
g
.
get_flow
(
s
,
t
)
<=
0
)
if
(
g
.
get_flow
(
s
,
t
)
<=
0
)
{
{
parent
[
t
]
=
n
il
;
parent
[
t
]
=
n
o_parent
;
orphans
.
push_back
(
t
);
orphans
.
push_back
(
t
);
}
}
...
@@ -429,7 +429,7 @@ namespace dlib
...
@@ -429,7 +429,7 @@ namespace dlib
g
.
adjust_flow
(
t
,
s
,
min_cap
);
g
.
adjust_flow
(
t
,
s
,
min_cap
);
if
(
g
.
get_flow
(
s
,
t
)
<=
0
)
if
(
g
.
get_flow
(
s
,
t
)
<=
0
)
{
{
parent
[
s
]
=
n
il
;
parent
[
s
]
=
n
o_parent
;
orphans
.
push_back
(
s
);
orphans
.
push_back
(
s
);
}
}
s
=
t
;
s
=
t
;
...
...
dlib/matrix/lapack/gees.h
View file @
70e767bf
...
@@ -42,12 +42,12 @@ namespace dlib
...
@@ -42,12 +42,12 @@ namespace dlib
integer
info
=
0
;
integer
info
=
0
;
char
sort
=
'N'
;
char
sort
=
'N'
;
L_fp
fnil
=
0
;
L_fp
fnil
=
0
;
logical
nil
=
0
;
logical
bwork
=
0
;
integer
sdim
=
0
;
integer
sdim
=
0
;
DLIB_FORTRAN_ID
(
dgees
)(
&
jobvs
,
&
sort
,
fnil
,
&
n
,
DLIB_FORTRAN_ID
(
dgees
)(
&
jobvs
,
&
sort
,
fnil
,
&
n
,
a
,
&
lda
,
&
sdim
,
wr
,
a
,
&
lda
,
&
sdim
,
wr
,
wi
,
vs
,
&
ldvs
,
work
,
wi
,
vs
,
&
ldvs
,
work
,
&
lwork
,
&
nil
,
&
info
);
&
lwork
,
&
bwork
,
&
info
);
return
info
;
return
info
;
}
}
...
@@ -61,12 +61,12 @@ namespace dlib
...
@@ -61,12 +61,12 @@ namespace dlib
integer
info
=
0
;
integer
info
=
0
;
char
sort
=
'N'
;
char
sort
=
'N'
;
L_fp
fnil
=
0
;
L_fp
fnil
=
0
;
logical
nil
=
0
;
logical
bwork
=
0
;
integer
sdim
=
0
;
integer
sdim
=
0
;
DLIB_FORTRAN_ID
(
sgees
)(
&
jobvs
,
&
sort
,
fnil
,
&
n
,
DLIB_FORTRAN_ID
(
sgees
)(
&
jobvs
,
&
sort
,
fnil
,
&
n
,
a
,
&
lda
,
&
sdim
,
wr
,
a
,
&
lda
,
&
sdim
,
wr
,
wi
,
vs
,
&
ldvs
,
work
,
wi
,
vs
,
&
ldvs
,
work
,
&
lwork
,
&
nil
,
&
info
);
&
lwork
,
&
bwork
,
&
info
);
return
info
;
return
info
;
}
}
...
...
dlib/test/optimization_test_functions.cpp
View file @
70e767bf
...
@@ -378,7 +378,7 @@ namespace dlib
...
@@ -378,7 +378,7 @@ namespace dlib
h
(
0
,
3
)
=
h
(
0
,
3
)
+
8.0E+00
*
f1
*
f2
*
df1dx1
*
df2dx4
;
h
(
0
,
3
)
=
h
(
0
,
3
)
+
8.0E+00
*
f1
*
f2
*
df1dx1
*
df2dx4
;
h
(
1
,
0
)
=
h
(
1
,
0
)
+
12.0E+00
*
pow
(
f1
,
2
)
*
df1dx2
*
df1dx1
+
4.0E+00
*
pow
(
f2
,
2
)
*
df1dx2
*
df1dx1
;
h
(
1
,
0
)
=
h
(
1
,
0
)
+
12.0E+00
*
pow
(
f1
,
2
)
*
df1dx2
*
df1dx1
+
4.0E+00
*
pow
(
f2
,
2
)
*
df1dx2
*
df1dx1
;
h
(
1
,
1
)
=
h
(
1
,
1
)
+
12.0E+00
*
pow
(
f1
,
2
)
*
df1dx2
*
df1dx2
+
4.0E+00
*
pow
(
f2
,
2
)
*
df1dx2
*
df1dx
1
;
h
(
1
,
1
)
=
h
(
1
,
1
)
+
12.0E+00
*
pow
(
f1
,
2
)
*
df1dx2
*
df1dx2
+
4.0E+00
*
pow
(
f2
,
2
)
*
df1dx2
*
df1dx
2
;
h
(
1
,
2
)
=
h
(
1
,
2
)
+
8.0E+00
*
f1
*
f2
*
df1dx2
*
df2dx3
;
h
(
1
,
2
)
=
h
(
1
,
2
)
+
8.0E+00
*
f1
*
f2
*
df1dx2
*
df2dx3
;
h
(
1
,
3
)
=
h
(
1
,
3
)
+
8.0E+00
*
f1
*
f2
*
df1dx2
*
df2dx4
;
h
(
1
,
3
)
=
h
(
1
,
3
)
+
8.0E+00
*
f1
*
f2
*
df1dx2
*
df2dx4
;
...
...
dlib/test/tuple.cpp
View file @
70e767bf
...
@@ -18,7 +18,7 @@ namespace
...
@@ -18,7 +18,7 @@ namespace
logger
dlog
(
"test.tuple"
);
logger
dlog
(
"test.tuple"
);
struct
nil
struct
s_
nil
{
{
template
<
typename
T
>
template
<
typename
T
>
void
operator
()
(
void
operator
()
(
...
@@ -122,10 +122,10 @@ namespace
...
@@ -122,10 +122,10 @@ namespace
b
=
a
;
b
=
a
;
inc
i
;
inc
i
;
nil
n
;
s_
nil
n
;
a
.
for_each
(
inc
());
a
.
for_each
(
inc
());
a
.
for_each
(
i
);
a
.
for_each
(
i
);
const_cast
<
const
T
&>
(
a
).
for_each
(
nil
());
const_cast
<
const
T
&>
(
a
).
for_each
(
s_
nil
());
const_cast
<
const
T
&>
(
a
).
for_each
(
n
);
const_cast
<
const
T
&>
(
a
).
for_each
(
n
);
DLIB_TEST
(
a
.
get
<
0
>
()
==
b
.
get
<
0
>
()
+
2
);
DLIB_TEST
(
a
.
get
<
0
>
()
==
b
.
get
<
0
>
()
+
2
);
...
@@ -145,7 +145,7 @@ namespace
...
@@ -145,7 +145,7 @@ namespace
a
.
for_index
(
i
,
0
);
a
.
for_index
(
i
,
0
);
a
.
for_index
(
inc
(),
1
);
a
.
for_index
(
inc
(),
1
);
const_cast
<
const
T
&>
(
a
).
for_index
(
n
,
2
);
const_cast
<
const
T
&>
(
a
).
for_index
(
n
,
2
);
const_cast
<
const
T
&>
(
a
).
for_index
(
nil
(),
0
);
const_cast
<
const
T
&>
(
a
).
for_index
(
s_
nil
(),
0
);
DLIB_TEST
(
a
.
get
<
0
>
()
==
b
.
get
<
0
>
()
+
1
);
DLIB_TEST
(
a
.
get
<
0
>
()
==
b
.
get
<
0
>
()
+
1
);
DLIB_TEST
(
a
.
get
<
1
>
()
==
b
.
get
<
1
>
()
+
1
);
DLIB_TEST
(
a
.
get
<
1
>
()
==
b
.
get
<
1
>
()
+
1
);
...
...
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