Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RModel_GraphIndependent.hxx
Go to the documentation of this file.
1#ifndef TMVA_SOFIE_RMODEL_GraphIndependent
2#define TMVA_SOFIE_RMODEL_GraphIndependent
3
4#include <ctime>
5
7#include "TMVA/RModel.hxx"
8#include "TMVA/RFunction.hxx"
9
10namespace TMVA {
11namespace Experimental {
12namespace SOFIE {
13
14class RFunction_Update;
15
17
18 // Explicitly define default constructor so cppyy doesn't attempt
19 // aggregate initialization.
21
22 // update blocks
23 std::unique_ptr<RFunction_Update> edges_update_block;
24 std::unique_ptr<RFunction_Update> nodes_update_block;
25 std::unique_ptr<RFunction_Update> globals_update_block;
26
27 std::size_t num_nodes;
28 std::vector<std::pair<int, int>> edges;
29
33
34 std::string filename;
35
36 template <typename T>
37 void createUpdateFunction(T &updateFunction)
38 {
39 switch (updateFunction.GetFunctionTarget()) {
41 edges_update_block.reset(new T(updateFunction));
42 break;
43 }
45 nodes_update_block.reset(new T(updateFunction));
46 break;
47 }
49 globals_update_block.reset(new T(updateFunction));
50 break;
51 }
52 default: {
53 throw std::runtime_error(
54 "TMVA SOFIE: Invalid Update function supplied for creating GraphIndependent function block.");
55 }
56 }
57 }
58
60 {
61 edges_update_block.reset();
62 nodes_update_block.reset();
64 }
65};
66
68
69private:
70 // updation function for edges, nodes & global attributes
71 std::unique_ptr<RFunction_Update> edges_update_block;
72 std::unique_ptr<RFunction_Update> nodes_update_block;
73 std::unique_ptr<RFunction_Update> globals_update_block;
74
75 std::size_t num_nodes;
76 std::size_t num_edges;
77
78 std::size_t num_node_features;
79 std::size_t num_edge_features;
81
82public:
83 /**
84 Default constructor. Needed to allow serialization of ROOT objects. See
85 https://root.cern/manual/io_custom_classes/#restrictions-on-types-root-io-can-handle
86 */
89
90 // Rule of five: explicitly define move semantics, disallow copy
95 ~RModel_GraphIndependent() final = default;
96
97 void Generate() final;
98};
99
100} // namespace SOFIE
101} // namespace Experimental
102} // namespace TMVA
103
104#endif // TMVA_SOFIE_RMODEL_GNN
RModel_GraphIndependent & operator=(RModel_GraphIndependent &&other)
RModel_GraphIndependent()=default
Default constructor.
RModel_GraphIndependent & operator=(const RModel_GraphIndependent &other)=delete
RModel_GraphIndependent(const RModel_GraphIndependent &other)=delete
create variable transformations
std::unique_ptr< RFunction_Update > globals_update_block