Commit 1fbd1828 authored by Davis King's avatar Davis King

Cleaned up the code a bit.

parent 0d9043bc
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment