numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class of vectors of ternary floating-point numbers in num_collect::opt::adaptive_diagonal_curves. More...
#include <num_collect/opt/impl/adc_ternary_vector.h>
Public Types | |
using | digit_type = std::int8_t |
Type of a digit. | |
Public Member Functions | |
adc_ternary_vector ()=default | |
Constructor. | |
adc_ternary_vector (index_type dim) | |
Constructor. | |
auto | as_variable (const VariableType &lower_bound, const VariableType &width) const -> VariableType |
Convert this vector to a variable. | |
auto | current_max_digits () const -> index_type |
Get the current maximum number of digits. | |
auto | digits (index_type dim) const -> index_type |
Get the number of digits in a dimension. | |
auto | dim () const -> index_type |
Get the number of dimensions. | |
template<typename Scalar> | |
auto | elem_as (index_type dim) const -> Scalar |
Get the element of this vector as a floating-point number. | |
auto | hash () const -> std::size_t |
Calculate the hash of this vector. | |
auto | is_full () const -> bool |
Check whether this vector is full. | |
auto | next_divided_dimension_index () const -> index_type |
Get the next dimension index to add a digit. | |
auto | operator!= (const adc_ternary_vector &right) const -> bool |
Compare with another object. | |
auto | operator() (index_type dim, index_type digit) -> digit_type & |
Access a digit. | |
auto | operator() (index_type dim, index_type digit) const -> digit_type |
Access a digit. | |
auto | operator== (const adc_ternary_vector &right) const -> bool |
Compare with another object. | |
auto | push_back (digit_type digit) -> std::pair< index_type, index_type > |
Add a digit to a dimension specified by next_divided_dimension_index(). | |
Static Public Attributes | |
static constexpr index_type | dimensions_at_compile_time |
Dimensions at compile time. | |
static constexpr index_type | max_digits_at_compile_time = MaxDigits |
Maximum number of digits per dimension at compile time. | |
static constexpr index_type | max_dimensions_at_compile_time |
Maximum number of dimensions at compile time. | |
Private Types | |
using | data_type |
Type of data matrix. | |
Private Attributes | |
index_type | current_max_digits_ {0} |
Current maximum number of digits. | |
data_type | data_ |
Data matrix. | |
index_type | next_divided_dimension_index_ {0} |
Next dimension index to add a digit. | |
Class of vectors of ternary floating-point numbers in num_collect::opt::adaptive_diagonal_curves.
VariableType | Type of variables. |
MaxDigits | Maximum number of digits per dimension at compile time. |
Definition at line 46 of file adc_ternary_vector.h.
|
private |
Type of data matrix.
Definition at line 261 of file adc_ternary_vector.h.
using num_collect::opt::impl::adc_ternary_vector< VariableType, MaxDigits >::digit_type = std::int8_t |
Type of a digit.
Definition at line 51 of file adc_ternary_vector.h.
|
inlineexplicit |
Constructor.
[in] | dim | Number of digits. |
Definition at line 74 of file adc_ternary_vector.h.
|
inlinenodiscard |
Convert this vector to a variable.
[in] | lower_bound | Element-wise lower bound of the search range. |
[in] | width | Element-wise width of the search range. |
Definition at line 233 of file adc_ternary_vector.h.
|
inlinenodiscard |
Get the current maximum number of digits.
Definition at line 89 of file adc_ternary_vector.h.
|
inlinenodiscard |
Get the number of digits in a dimension.
[in] | dim | Dimension index. |
Definition at line 119 of file adc_ternary_vector.h.
|
inlinenodiscard |
Get the number of dimensions.
Definition at line 82 of file adc_ternary_vector.h.
|
inlinenodiscard |
Get the element of this vector as a floating-point number.
Scalar | Type of resulting floating-point number. |
[in] | dim | Dimension index. |
Definition at line 213 of file adc_ternary_vector.h.
|
inlinenodiscard |
Calculate the hash of this vector.
Definition at line 248 of file adc_ternary_vector.h.
|
inlinenodiscard |
Check whether this vector is full.
true | This vector is full. |
false | This vector is not full. |
Definition at line 108 of file adc_ternary_vector.h.
|
inlinenodiscard |
Get the next dimension index to add a digit.
Definition at line 98 of file adc_ternary_vector.h.
|
inlinenodiscard |
Compare with another object.
[in] | right | Right-hand-side object. |
Definition at line 200 of file adc_ternary_vector.h.
|
inlinenodiscard |
Access a digit.
[in] | dim | Dimension index. |
[in] | digit | Digit index. |
Definition at line 148 of file adc_ternary_vector.h.
|
inlinenodiscard |
Access a digit.
[in] | dim | Dimension index. |
[in] | digit | Digit index. |
Definition at line 134 of file adc_ternary_vector.h.
|
inlinenodiscard |
Compare with another object.
[in] | right | Right-hand-side object. |
Definition at line 189 of file adc_ternary_vector.h.
|
inline |
Add a digit to a dimension specified by next_divided_dimension_index().
[in] | digit | Digit. |
Definition at line 163 of file adc_ternary_vector.h.
|
private |
Current maximum number of digits.
Definition at line 268 of file adc_ternary_vector.h.
|
private |
Data matrix.
Definition at line 265 of file adc_ternary_vector.h.
|
staticconstexpr |
Dimensions at compile time.
Definition at line 54 of file adc_ternary_vector.h.
|
staticconstexpr |
Maximum number of digits per dimension at compile time.
Definition at line 62 of file adc_ternary_vector.h.
|
staticconstexpr |
Maximum number of dimensions at compile time.
Definition at line 58 of file adc_ternary_vector.h.
|
private |
Next dimension index to add a digit.
Definition at line 271 of file adc_ternary_vector.h.