numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle Class Reference

Class of hyper rectangle in DIRECT method. More...

+ Collaboration diagram for num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle:

Public Member Functions

 rectangle (const variable_type &lower, const variable_type &upper, const value_type &value)
 Constructor.
 
auto dist () const -> const value_type &
 Get distance between center point and end point.
 
auto divide (index_type dim, value_type lower, value_type upper, value_type value) const -> std::shared_ptr< rectangle >
 Divide this object and return the divided rectangle.
 
void divide_in_place (index_type dim, value_type lower, value_type upper, value_type value)
 Divide this object in place.
 
auto is_divided () const -> const std::vector< bool > &
 Get whether each dimension is divided.
 
auto lower () const -> const variable_type &
 Get element-wise lower limit.
 
auto upper () const -> const variable_type &
 Get element-wise upper limit.
 
auto value () const -> const value_type &
 Get function value at the center.
 

Private Attributes

value_type dist_
 Distance between center point and end point.
 
std::vector< bool > is_divided_
 Whether each dimension is divided.
 
variable_type lower_
 Element-wise lower limit.
 
variable_type upper_
 Element-wise upper limit.
 
value_type value_
 Function value at the center.
 

Static Private Attributes

static const auto half = static_cast<value_type>(0.5)
 Half.
 

Detailed Description

template<concepts::objective_function ObjectiveFunction>
class num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle

Class of hyper rectangle in DIRECT method.

Definition at line 230 of file dividing_rectangles.h.

Constructor & Destructor Documentation

◆ rectangle()

template<concepts::objective_function ObjectiveFunction>
num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::rectangle ( const variable_type & lower,
const variable_type & upper,
const value_type & value )
inline

Constructor.

Parameters
[in]lowerElement-wise lower limit.
[in]upperElement-wise upper limit.
[in]valueFunction value at the center.

Definition at line 239 of file dividing_rectangles.h.

Member Function Documentation

◆ dist()

template<concepts::objective_function ObjectiveFunction>
auto num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::dist ( ) const -> const value_type&
inlinenodiscard

Get distance between center point and end point.

Returns
Distance between center point and end point.

Definition at line 279 of file dividing_rectangles.h.

◆ divide()

template<concepts::objective_function ObjectiveFunction>
auto num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::divide ( index_type dim,
value_type lower,
value_type upper,
value_type value ) const -> std::shared_ptr<rectangle>
inlinenodiscard

Divide this object and return the divided rectangle.

Parameters
[in]dimDimension index.
[in]lowerNew lower bound.
[in]upperNew upper bound.
[in]valueNew value.
Returns
Divided rectangle.

Definition at line 327 of file dividing_rectangles.h.

◆ divide_in_place()

template<concepts::objective_function ObjectiveFunction>
void num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::divide_in_place ( index_type dim,
value_type lower,
value_type upper,
value_type value )
inline

Divide this object in place.

Parameters
[in]dimDimension index.
[in]lowerNew lower bound.
[in]upperNew upper bound.
[in]valueNew value.

Definition at line 296 of file dividing_rectangles.h.

◆ is_divided()

template<concepts::objective_function ObjectiveFunction>
auto num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::is_divided ( ) const -> const std::vector<bool>&
inlinenodiscard

Get whether each dimension is divided.

Returns
Whether each dimension is divided.

Definition at line 270 of file dividing_rectangles.h.

◆ lower()

template<concepts::objective_function ObjectiveFunction>
auto num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::lower ( ) const -> const variable_type&
inlinenodiscard

Get element-wise lower limit.

Returns
Element-wise lower limit.

Definition at line 252 of file dividing_rectangles.h.

◆ upper()

template<concepts::objective_function ObjectiveFunction>
auto num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::upper ( ) const -> const variable_type&
inlinenodiscard

Get element-wise upper limit.

Returns
Element-wise upper limit.

Definition at line 261 of file dividing_rectangles.h.

◆ value()

template<concepts::objective_function ObjectiveFunction>
auto num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::value ( ) const -> const value_type&
inlinenodiscard

Get function value at the center.

Returns
Function value at the center.

Definition at line 286 of file dividing_rectangles.h.

Member Data Documentation

◆ dist_

template<concepts::objective_function ObjectiveFunction>
value_type num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::dist_
private

Distance between center point and end point.

Definition at line 353 of file dividing_rectangles.h.

◆ half

template<concepts::objective_function ObjectiveFunction>
const auto num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::half = static_cast<value_type>(0.5)
inlinestaticprivate

Half.

Definition at line 337 of file dividing_rectangles.h.

◆ is_divided_

template<concepts::objective_function ObjectiveFunction>
std::vector<bool> num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::is_divided_
private

Whether each dimension is divided.

If all dimensions are divided once, flags are reset.

Definition at line 350 of file dividing_rectangles.h.

◆ lower_

template<concepts::objective_function ObjectiveFunction>
variable_type num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::lower_
private

Element-wise lower limit.

Definition at line 340 of file dividing_rectangles.h.

◆ upper_

template<concepts::objective_function ObjectiveFunction>
variable_type num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::upper_
private

Element-wise upper limit.

Definition at line 343 of file dividing_rectangles.h.

◆ value_

template<concepts::objective_function ObjectiveFunction>
value_type num_collect::opt::dividing_rectangles< ObjectiveFunction >::rectangle::value_
private

Function value at the center.

Definition at line 356 of file dividing_rectangles.h.


The documentation for this class was generated from the following file: