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