39template <base::concepts::real_scalar Value,
typename TernaryVector>
99 const auto half =
static_cast<value_type>(0.5);
100 return half * sqrt(squared_sum);
111 -> std::pair<ternary_vector_type, ternary_vector_type> {
112 auto res = std::make_pair(lowest_vertex, lowest_vertex);
113 const auto dim = lowest_vertex.dim();
115 const auto digits = lowest_vertex.digits(i);
117 std::uint_fast32_t one_count = 0;
119 if (lowest_vertex(i, j) ==
120 typename ternary_vector_type::digit_type{1}) {
126 static_cast<std::int_fast32_t
>(lowest_vertex(i, digits - 1));
128 constexpr std::uint_fast32_t odd_mask = 1;
129 if ((one_count & odd_mask) == odd_mask) {
130 res.first(i, digits - 1) =
131 static_cast<typename ternary_vector_type::digit_type
>(
134 res.second(i, digits - 1) =
135 static_cast<typename ternary_vector_type::digit_type
>(
151 for (
index_type i = 0; i < point.dim(); ++i) {
152 for (
index_type j = point.digits(i) - 1; j > 0; --j) {
154 typename ternary_vector_type::digit_type{3}) {
156 std::int_fast32_t temp =
160 static_cast<typename ternary_vector_type::digit_type
>(
Definition of assertion macros.
#define NUM_COLLECT_DEBUG_ASSERT(CONDITION)
Macro to check whether a condition is satisfied in debug build only.
static void normalize_point(ternary_vector_type &point)
Normalize point.
auto ave_value() const -> const value_type &
static auto determine_sample_points(const ternary_vector_type &lowest_vertex) -> std::pair< ternary_vector_type, ternary_vector_type >
Determine sampling points.
auto dist() const -> value_type
Get the distance between center point and vertex.
adc_rectangle(const ternary_vector_type &vertex, const value_type &ave_value)
Constructor.
TernaryVector ternary_vector_type
auto vertex() const -> const ternary_vector_type &
ternary_vector_type vertex_
auto sample_points() const -> std::pair< ternary_vector_type, ternary_vector_type >
Determine sampling points.
Definition of index_type type.
std::ptrdiff_t index_type
Type of indices in this library.
Namespace of internal implementations.
Definition of real_scalar concept.