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 // update blocks
18 std::unique_ptr<RFunction_Update> edges_update_block;
19 std::unique_ptr<RFunction_Update> nodes_update_block;
20 std::unique_ptr<RFunction_Update> globals_update_block;
21
22 std::size_t num_nodes;
23 std::vector<std::pair<int, int>> edges;
24
28
29 std::string filename;
30
31 template <typename T>
32 void createUpdateFunction(T &updateFunction)
33 {
34 switch (updateFunction.GetFunctionTarget()) {
36 edges_update_block.reset(new T(updateFunction));
37 break;
38 }
40 nodes_update_block.reset(new T(updateFunction));
41 break;
42 }
44 globals_update_block.reset(new T(updateFunction));
45 break;
46 }
47 default: {
48 throw std::runtime_error(
49 "TMVA SOFIE: Invalid Update function supplied for creating GraphIndependent function block.");
50 }
51 }
52 }
53
55 {
56 edges_update_block.reset();
57 nodes_update_block.reset();
59 }
60};
61
63
64private:
65 // updation function for edges, nodes & global attributes
66 std::unique_ptr<RFunction_Update> edges_update_block;
67 std::unique_ptr<RFunction_Update> nodes_update_block;
68 std::unique_ptr<RFunction_Update> globals_update_block;
69
70 std::size_t num_nodes;
71 std::size_t num_edges;
72
73 std::size_t num_node_features;
74 std::size_t num_edge_features;
76
77public:
78 /**
79 Default constructor. Needed to allow serialization of ROOT objects. See
80 https://root.cern/manual/io_custom_classes/#restrictions-on-types-root-io-can-handle
81 */
84
85 // Rule of five: explicitly define move semantics, disallow copy
90 ~RModel_GraphIndependent() final = default;
91
92 void Generate() final;
93};
94
95} // namespace SOFIE
96} // namespace Experimental
97} // namespace TMVA
98
99#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