16#ifdef ROOFIT_WITH_RYML
23template <
class Node_t>
26 using child_iterator = RooFit::Detail::JSONNode::child_iterator_t<Node_t>;
27 ChildItImpl(Node_t &
n,
size_t p) : node(
n), pos(p) {}
28 ChildItImpl(
const ChildItImpl &other) : node(other.node), pos(other.pos) {}
29 std::unique_ptr<typename child_iterator::Impl> clone()
const override
31 return std::make_unique<ChildItImpl>(node, pos);
33 void forward()
override { ++pos; }
35 Node_t ¤t()
override {
return node.child(pos); }
36 bool equal(
const typename child_iterator::Impl &other)
const override
38 auto it =
dynamic_cast<const ChildItImpl<Node_t> *
>(&other);
39 return it && &(it->node) == &(this->node) && (it->pos) == this->pos;
57 std::stringstream ss{
val()};
64 return {
child_iterator(std::make_unique<::ChildItImpl<JSONNode>>(*
this, 0)),
79template <
typename... Args>
83#ifdef ROOFIT_WITH_RYML
84 return std::make_unique<TRYMLTree>(std::forward<Args>(args)...);
86 throw std::runtime_error(
"Requesting JSON tree with rapidyaml backend, which is currently unsupported.");
89 return std::make_unique<TJSONTree>(std::forward<Args>(args)...);
104 std::stringstream ss{str};
112 if (
name ==
"rapidyaml") {
113#ifdef ROOFIT_WITH_RYML
119 if (
name ==
"nlohmann-json")
143 if (
name ==
"rapidyaml")
145 if (
name ==
"nlohmann-json")
children_view_t< const JSONNode > const_children_view
virtual std::string val() const =0
virtual double val_double() const
child_iterator_t< JSONNode > child_iterator
virtual children_view children()
virtual size_t num_children() const =0
virtual void writeJSON(std::ostream &os) const =0
children_view_t< JSONNode > children_view
child_iterator_t< const JSONNode > const_child_iterator
static void setBackend(std::string const &name)
Set the library that serves as the backend for the JSON interface.
static Backend & getBackendEnum()
static std::unique_ptr< JSONTree > create()
static bool hasBackend(std::string const &name)
Check if ROOT was compiled with support for a certain JSON backend library.
static std::string getBackend()
Returns the name of the library that serves as the backend for the JSON interface,...
static std::unique_ptr< JSONTree > createImpl(Args &&...args)
std::ostream & operator<<(std::ostream &os, RooFit::Detail::JSONNode const &s)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
void backward(LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
backward application of the weights (back-propagation of the error)