Annotate noexcept and constexpr with HEDLEY, and add interval containment, ChaCha, and the dyadic range tables.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
875f09fec1
commit
0d8a5a8131
97 changed files with 9212 additions and 1159 deletions
|
|
@ -1,6 +1,10 @@
|
|||
/// @file dpf/eval_interval.hpp
|
||||
/// @brief
|
||||
/// @details
|
||||
/// @brief Evaluate every input in a closed interval.
|
||||
/// @details `[from, to]` is inclusive. The returned iterable yields one
|
||||
/// share per input, in that order. Pass a named output buffer;
|
||||
/// this overload binds it as a non-const reference. An interval
|
||||
/// memoizer is optional and comes after the buffer.
|
||||
/// @snippet evaluation/eval_interval.cpp eval-interval
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @author Christopher Jiang <christopher.jiang@ucalgary.ca>
|
||||
/// @copyright Copyright (c) 2019-2024 Ryan Henry and [others](@ref authors)
|
||||
|
|
@ -339,7 +343,12 @@ auto eval_interval_impl(const DpfKey & dpf, InputT from, InputT to,
|
|||
|
||||
integral_type from_node = utils::get_from_node<dpf_type>(from),
|
||||
to_node = utils::get_to_node<dpf_type>(to);
|
||||
auto segs = utils::split_leaf_nodes(from_node, to_node, dpf.depth);
|
||||
constexpr auto to_int = utils::to_integral_type<InputT>{};
|
||||
const bool wraps = utils::interval_wraps(
|
||||
static_cast<integral_type>(to_int(from)),
|
||||
static_cast<integral_type>(to_int(to)),
|
||||
utils::bitlength_of_v<InputT>);
|
||||
auto segs = utils::split_leaf_nodes(from_node, to_node, dpf.depth, wraps);
|
||||
|
||||
auto idxs = std::index_sequence<IIs...>{};
|
||||
std::size_t start = 0;
|
||||
|
|
@ -388,6 +397,10 @@ auto eval_interval(const DpfKey & dpf, InputT from, InputT to,
|
|||
|
||||
} // namespace internal
|
||||
|
||||
/// Write outputs `I, Is...` for `[from, to]` into `outbufs`.
|
||||
/// @param outbufs Named buffer, or a tuple of buffers when several outputs
|
||||
/// are selected. Must outlive the returned iterable.
|
||||
/// @param memoizer Workspace sized for at least this interval.
|
||||
template <std::size_t I = 0,
|
||||
std::size_t ...Is,
|
||||
typename DpfKey,
|
||||
|
|
@ -404,6 +417,7 @@ auto eval_interval(const DpfKey & dpf, InputT from, InputT to,
|
|||
return internal::eval_interval<I, Is...>(dpf, dpf.offset_x(from), dpf.offset_x(to), outbufs, memoizer, std::make_index_sequence<1+sizeof...(Is)>());
|
||||
}
|
||||
|
||||
/// Evaluate `[from, to]` into `outbufs`, allocating a basic interval memoizer.
|
||||
template <std::size_t I = 0,
|
||||
std::size_t ...Is,
|
||||
typename DpfKey,
|
||||
|
|
@ -421,6 +435,9 @@ auto eval_interval(const DpfKey & dpf, InputT from, InputT to,
|
|||
dpf::make_basic_interval_memoizer<DpfKey>(from, to));
|
||||
}
|
||||
|
||||
/// Evaluate `[from, to]` with a caller-supplied memoizer.
|
||||
/// @return `std::pair` of a new buffer (or tuple of buffers) and an iterable
|
||||
/// into that buffer.
|
||||
template <std::size_t I = 0,
|
||||
std::size_t ...Is,
|
||||
typename DpfKey,
|
||||
|
|
@ -445,6 +462,7 @@ auto eval_interval(const DpfKey & dpf, InputT from, InputT to,
|
|||
return std::make_pair(std::move(outbufs), std::move(iterable));
|
||||
}
|
||||
|
||||
/// Evaluate `[from, to]`, allocating a basic interval memoizer and a buffer.
|
||||
template <std::size_t I = 0,
|
||||
std::size_t ...Is,
|
||||
typename DpfKey,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue