ATLAS Offline Software
Loading...
Searching...
No Matches
HyPERGraph.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef HYPERANALYSISALGORITHMS_HYPERGRAPH_H
6#define HYPERANALYSISALGORITHMS_HYPERGRAPH_H
7
8#include <math.h>
9
10#include <iostream>
11#include <list>
12#include <map>
13#include <vector>
14
16
17namespace EventReco {
18// @class HyPERGraph
19// @brief This class is in charge of storing the graph structure and features of
20// the HyPER model. It inherits from the GraphBase class.
21class HyPERGraph : public GraphBase {
22 using HyperEdgeIndex = std::vector<int64_t>;
23
24 public:
26 virtual ~HyPERGraph() = default;
27
28 virtual void addNode(const Features& attributes) override;
29 virtual void addEdge(int64_t source, int64_t target,
30 const Features& attributes) override;
31 virtual void addGlobal(const Features& attributes) override;
32
33 void buildEdgeIndices();
34 void buildHyperEdges(int64_t order);
35 const std::vector<EdgeIndex>& getEdgeIndicesVector() const {
36 return m_edgeIndices;
37 }
40 }
41 int64_t nHyperEdges() const { return m_nHyperEdges; }
42 int64_t hyperEdgeOrder() const { return m_hyperEdgeOrder; }
43
44 virtual void printGraph() const;
45 virtual void printGraphInputsForValidation() const;
46 virtual void clearGraph();
47
48 protected:
49 std::vector<EdgeIndex> m_edgeIndices = {};
50 std::vector<HyperEdgeIndex> m_hyperEdgeIndices = {};
51 int64_t m_nHyperEdges = 0;
52 int64_t m_hyperEdgeOrder = 0;
53};
54} // namespace EventReco
55
56#endif // HYPERANALYSISALGORITHMS_HYPERGRAPH_H
std::vector< EdgeIndex > m_edgeIndices
Definition HyPERGraph.h:49
int64_t hyperEdgeOrder() const
Definition HyPERGraph.h:42
std::vector< HyperEdgeIndex > m_hyperEdgeIndices
Definition HyPERGraph.h:50
virtual void clearGraph()
virtual void addNode(const Features &attributes) override
const std::vector< EdgeIndex > & getEdgeIndicesVector() const
Definition HyPERGraph.h:35
virtual void addEdge(int64_t source, int64_t target, const Features &attributes) override
int64_t nHyperEdges() const
Definition HyPERGraph.h:41
std::vector< int64_t > HyperEdgeIndex
Definition HyPERGraph.h:22
void buildHyperEdges(int64_t order)
virtual void printGraphInputsForValidation() const
virtual void printGraph() const
virtual ~HyPERGraph()=default
virtual void addGlobal(const Features &attributes) override
HyperEdgeIndex getHyperEdgeIndices(std::size_t index) const
Definition HyPERGraph.h:38
std::vector< float > Features
Definition GraphBase.h:16
Definition index.py:1