25#include <hash_tables/maps/open_address_map_st.h>
43template <concepts::
objective_function ObjectiveFunction, index_type MaxDigits>
64 using value_type =
typename objective_function_type::value_type;
95 "Element-wise limits must have the same size.");
97 "Element-wise limits must satisfy lower < upper for each element.");
111 value_dict_.reserve(
static_cast<std::size_t
>(size));
125 point, [
this, &point] {
return evaluate_on(point); });
203 hash_tables::maps::open_address_map_st<ternary_vector_type, value_type>
Definition of adc_ternary_vector class.
Definition of assertion macros.
#define NUM_COLLECT_DEBUG_ASSERT(CONDITION)
Macro to check whether a condition is satisfied in debug build only.
void reserve(index_type size)
Reserve memory for the dictionary.
variable_type lower_
Element-wise lower limit.
auto evaluations() const noexcept -> index_type
Get the number of function evaluations.
variable_type opt_variable_
Current optimal variable.
value_type opt_value_
Current optimal value.
index_type dim_
Number of dimension.
void change_objective_function(const objective_function_type &obj_fun)
Change the objective function.
variable_type width_
Element-wise width.
adc_sample_dict(const objective_function_type &obj_fun=objective_function_type())
Constructor.
typename objective_function_type::value_type value_type
Type of function values.
auto operator()(const ternary_vector_type &point) -> value_type
Evaluate or get function value.
objective_function_type obj_fun_
Objective function.
ternary_vector_type opt_point_
Point in the unit hyper-cube for the current optimal variable.
ObjectiveFunction objective_function_type
Type of the objective function.
auto dim() const -> index_type
Get the number of dimension.
adc_ternary_vector< variable_type, MaxDigits > ternary_vector_type
Type of ternary vectors.
hash_tables::maps::open_address_map_st< ternary_vector_type, value_type > value_dict_
Dictionary of sampled points.
void init(const variable_type &lower, const variable_type &upper)
Initialize this object.
auto opt_value() const -> const value_type &
Get current optimal value.
auto opt_point() const -> const ternary_vector_type &
Get the point in the unit hyper-cube for the current optimal variable.
auto evaluate_on(const ternary_vector_type &point) -> value_type
Evaluate function value.
typename objective_function_type::variable_type variable_type
Type of variables.
auto opt_variable() const -> const variable_type &
Get current optimal variable.
Class of dictionaries of sampling points in num_collect::opt::adaptive_diagonal_curves.
Class of vectors of ternary floating-point numbers in num_collect::opt::adaptive_diagonal_curves.
Concept of multi-variate objective functions in optimization.
Definition of index_type type.
Definition of multi_variate_objective_function concept.
std::ptrdiff_t index_type
Type of indices in this library.
Namespace of internal implementations.
Definition of objective_function concept.
Definition of NUM_COLLECT_PRECONDITION macro.
#define NUM_COLLECT_PRECONDITION(CONDITION,...)
Check whether a precondition is satisfied and throw an exception if not.