1 #ifndef CommonToolsUtilsExpressionEvaluatorTemplates_H 2 #define CommonToolsUtilsExpressionEvaluatorTemplates_H 12 template<
typename Ret,
typename... Args>
19 template<
typename Object>
21 virtual bool eval(Object
const&)
const = 0;
25 template<
typename Object>
27 virtual double eval(Object
const&)
const =0;
31 template<
typename Object>
34 using Mask = std::vector<bool>;
37 mask.resize(cands.size());
44 template<
typename Object>
49 cands.erase(std::remove_if(cands.begin(),cands.end(),[&](
typename Collection::value_type const &
c){
return !
f(*
c);}),cands.end());
55 template<
typename Object>
58 using Indices = std::vector<unsigned int>;
62 for (
auto const &
c : cands) {
if(
f(*
c)) inds.push_back(i); ++
i; }
71 #endif // CommonToolsUtilsExpressionEvaluatorTemplates_H std::vector< Object const * > Collection
std::vector< Object const * > Collection
void mask(Collection const &cands, Mask &mask, F f) const
virtual ~MaskCollection()
Container::value_type value_type
std::vector< unsigned int > Indices
virtual ~genericExpression()
std::vector< Object const * > Collection
void select(Collection &cands, F f) const
virtual Ret operator()(Args...) const =0
virtual ~SelectInCollection()
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
void select(Collection const &cands, Indices &inds, F f) const
virtual ~SelectIndecesInCollection()