AIToolbox
A library that offers tools for AI problem solving.
|
Go to the documentation of this file. 1 #ifndef AI_TOOLBOX_FACTORED_FILTER_MAP_HEADER_FILE
2 #define AI_TOOLBOX_FACTORED_FILTER_MAP_HEADER_FILE
21 template <
typename T,
typename TrieType = FasterTrie>
56 ids_(std::move(t)), items_(std::move(c))
58 if (ids_.size() != items_.size())
59 throw std::invalid_argument(
"Input trie and container have different sizes!");
85 template <
typename... Args>
88 items_.emplace_back(std::forward<Args>(args)...);
103 return Iterable(ids_.filter(f), items_);
133 template <
typename TT = TrieType,
typename = std::enable_if_t<std::is_same_v<TT, Trie>>>
135 return Iterable(ids_.filter(f, offset), items_);
150 template <
typename TT = TrieType,
typename = std::enable_if_t<std::is_same_v<TT, Trie>>>
167 return Iterable(ids_.filter(pf), items_);
191 if constexpr (std::is_same_v<TrieType, Trie>)
194 items_.reserve(
size);
203 return items_.size();
211 typename ItemsContainer::iterator
begin() {
212 return items_.begin();
220 typename ItemsContainer::const_iterator
begin()
const {
221 return items_.begin();
229 typename ItemsContainer::iterator
end() {
238 typename ItemsContainer::const_iterator
end()
const {