13#ifndef ROOT_RDF_HELPERS
14#define ROOT_RDF_HELPERS
32template <
typename... ArgTypes,
typename F>
35 return std::function<bool(ArgTypes...)>([=](ArgTypes... args)
mutable {
return !
f(args...); });
38template <
typename... ArgTypes,
typename Ret,
typename... Args>
41 return std::function<bool(ArgTypes...)>([=](ArgTypes... args)
mutable {
return !
f(args...); });
44template <
typename I,
typename T,
typename F>
47template <std::size_t...
N,
typename T,
typename F>
49 template <std::
size_t Idx>
55 auto operator()(AlwaysT<N>... args) ->
decltype(fFunc({args...})) {
return fFunc({args...}); }
58template <std::
size_t N,
typename T,
typename F>
82 static_assert(std::is_same<Ret, bool>::value,
"RDF::Not requires a callable that returns a bool.");
99template <std::
size_t N,
typename T,
typename F>
104template <
typename Proxied,
typename DataSource>
112template <
typename NodeType>
124template <
typename NodeType>
125void SaveGraph(NodeType node,
const std::string &outputFile)
128 std::string dotGraph = helper(node);
130 std::ofstream out(outputFile);
131 if (!out.is_open()) {
132 throw std::runtime_error(
"Could not open output file \"" + outputFile +
"\"for reading");
143template <
typename NodeType>
TRObject operator()(const T1 &t1) const
The public interface to the RDataFrame federation of classes.
std::function< bool(ArgTypes...)> NotHelper(ROOT::TypeTraits::TypeList< ArgTypes... >, Ret(*f)(Args...))
std::function< bool(ArgTypes...)> NotHelper(ROOT::TypeTraits::TypeList< ArgTypes... >, F &&f)
auto PassAsVec(F &&f) -> PassAsVecHelper< std::make_index_sequence< N >, T, F >
auto PassAsVec(F &&f) -> RDFInternal::PassAsVecHelper< std::make_index_sequence< N >, T, F >
PassAsVec is a callable generator that allows passing N variables of type T to a function as a single...
auto Not(F &&f) -> decltype(RDFInternal::NotHelper(Args(), std::forward< F >(f)))
Given a callable with signature bool(T1, T2, ...) return a callable with same signature that returns ...
std::string SaveGraph(NodeType node)
Create a graphviz representation of the dataframe computation graph, return it as a string.
RNode AsRNode(NodeType node)
Cast a RDataFrame node to the common type ROOT::RDF::RNode.
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Namespace for new ROOT classes and functions.
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
Lightweight storage for a collection of types.