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
1fbd1828
Commit
1fbd1828
authored
7 years ago
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up the code a bit.
parent
0d9043bc
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
28 deletions
+27
-28
global_function_search.cpp
dlib/global_optimization/global_function_search.cpp
+0
-0
global_function_search.h
dlib/global_optimization/global_function_search.h
+5
-5
global_function_search_abstract.h
dlib/global_optimization/global_function_search_abstract.h
+22
-23
No files found.
dlib/global_optimization/global_function_search.cpp
View file @
1fbd1828
This diff is collapsed.
Click to expand it.
dlib/global_optimization/global_function_search.h
View file @
1fbd1828
...
...
@@ -79,7 +79,7 @@ namespace dlib
size_t
function_idx
=
0
;
std
::
shared_ptr
<
std
::
mutex
>
m
;
upper_bound_function
ub
;
std
::
vector
<
outstanding_function_eval_request
>
incomplete
_evals
;
std
::
vector
<
outstanding_function_eval_request
>
outstanding
_evals
;
matrix
<
double
,
0
,
1
>
best_x
;
double
best_objective_value
=
-
std
::
numeric_limits
<
double
>::
infinity
();
double
radius
=
0
;
...
...
@@ -101,7 +101,7 @@ namespace dlib
function_evaluation_request
(
function_evaluation_request
&&
item
);
function_evaluation_request
&
operator
=
(
function_evaluation_request
&&
item
);
void
swap
(
function_evaluation_request
&
item
);
~
function_evaluation_request
(
);
size_t
function_idx
(
)
const
;
...
...
@@ -112,12 +112,12 @@ namespace dlib
bool
has_been_evaluated
(
)
const
;
~
function_evaluation_request
();
void
set
(
double
y
);
void
swap
(
function_evaluation_request
&
item
);
private
:
friend
class
global_function_search
;
...
...
@@ -218,7 +218,7 @@ namespace dlib
size_t
&
idx
)
const
;
bool
has_
incomplete
_trust_region_request
(
bool
has_
outstanding
_trust_region_request
(
)
const
;
...
...
This diff is collapsed.
Click to expand it.
dlib/global_optimization/global_function_search_abstract.h
View file @
1fbd1828
...
...
@@ -89,14 +89,6 @@ namespace dlib
moving from item causes item.has_been_evaluated() == true, TODO, clarify
!*/
void
swap
(
function_evaluation_request
&
item
);
/*!
ensures
- swaps the state of *this and item
!*/
~
function_evaluation_request
(
);
/*!
...
...
@@ -113,7 +105,6 @@ namespace dlib
bool
has_been_evaluated
(
)
const
;
void
set
(
double
y
);
...
...
@@ -124,6 +115,14 @@ namespace dlib
- #has_been_evaluated() == true
!*/
void
swap
(
function_evaluation_request
&
item
);
/*!
ensures
- swaps the state of *this and item
!*/
};
// ----------------------------------------------------------------------------------------
...
...
@@ -143,18 +142,6 @@ namespace dlib
- #num_functions() == 0
!*/
// This object can't be copied.
global_function_search
(
const
global_function_search
&
)
=
delete
;
global_function_search
&
operator
=
(
const
global_function_search
&
item
)
=
delete
;
global_function_search
(
global_function_search
&&
item
)
=
default
;
global_function_search
&
operator
=
(
global_function_search
&&
item
)
=
default
;
/*!
ensures
- moves the state of item into *this
- #item.num_functions() == 0
!*/
explicit
global_function_search
(
const
function_spec
&
function
);
...
...
@@ -169,13 +156,25 @@ namespace dlib
const
double
relative_noise_magnitude
=
0
.
001
);
size_t
num_functions
(
)
const
;
// This object can't be copied.
global_function_search
(
const
global_function_search
&
)
=
delete
;
global_function_search
&
operator
=
(
const
global_function_search
&
item
)
=
delete
;
global_function_search
(
global_function_search
&&
item
)
=
default
;
global_function_search
&
operator
=
(
global_function_search
&&
item
)
=
default
;
/*!
ensures
- moves the state of item into *this
- #item.num_functions() == 0
!*/
void
set_seed
(
time_t
seed
);
size_t
num_functions
(
)
const
;
void
get_function_evaluations
(
std
::
vector
<
function_spec
>&
specs
,
std
::
vector
<
std
::
vector
<
function_evaluation
>>&
function_evals
...
...
This diff is collapsed.
Click to expand it.
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