Loading [MathJax]/extensions/TeX/AMSsymbols.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ filter_map()

template<template< typename... > class Filter, typename F , typename T , require_tuple_t< T > * = nullptr>
constexpr decltype(auto) stan::math::filter_map ( F &&  f,
T &&  x 
)
inlineconstexpr

Filter a tuple and apply a functor to each element that passes the filter.

Note
The Filter will only check T and if T is a tuple, it will recursively check each element of the tuple. But it will not inspect into std::vector elements automatically. If you want to inspect the inner element of an std::vector your type trait must do that itself.
Template Parameters
Filtera struct that accepts one template parameter and has a static constexpr bool member named value that is true if the type should be included in the output tuple.
FType of functor
TA tuple
Parameters
ffunctor callable
xtuple of arguments
Returns
a tuple with the functor applied to each element which passed the filter.

Definition at line 154 of file filter_map.hpp.