20#ifndef OPM_FUNCTIONAL_HPP
21#define OPM_FUNCTIONAL_HPP
83 template <
typename F,
typename C>
84 auto map(F&& f, C&& c)
86 using Val = std::remove_cv_t<std::remove_reference_t<
87 decltype(std::invoke(std::forward<F>(f), *std::begin(std::forward<C>(c))))>>;
89 std::vector<Val> ret{};
90 ret.reserve(std::size(std::forward<C>(c)));
92 std::ranges::transform(c, std::back_inserter(ret), std::forward<F>(f));
105 template<
typename A >
106 std::vector< A > concat( std::vector< std::vector< A > >&& src ) {
107 const auto size = std::accumulate( src.begin(), src.end(), 0,
108 []( std::size_t acc,
const std::vector< A >& x ) {
109 return acc + x.size();
113 std::vector< A > dst;
117 std::move( x.begin(), x.end(), std::back_inserter( dst ) );
199 explicit iota(
int end );
200 iota(
int begin,
int end );
202 class const_iterator {
204 using difference_type = int;
205 using value_type = int;
206 using pointer =
int*;
207 using reference =
int&;
208 using iterator_category = std::forward_iterator_tag;
210 const_iterator() =
default;
212 int operator*()
const;
214 const_iterator& operator++();
215 const_iterator operator++(
int );
217 bool operator==(
const const_iterator& rhs )
const;
218 bool operator!=(
const const_iterator& rhs )
const;
221 explicit const_iterator(
int );
Definition Functional.hpp:202
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30