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::transform(std::begin(c), std::end(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 );
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;
212 int operator*()
const;
Definition Functional.hpp:202
Definition Functional.hpp:197
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30