aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/PBQP/ReductionRules.h
blob: 1b28e33e5c4f7ce7a814e687b7c61069a3b6a74c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef RCC_CODEGEN_PBQP_REDUCTIONRULES_H
#define RCC_CODEGEN_PBQP_REDUCTIONRULES_H

#include "rcc/CodeGen/PBQP/Graph.h"

#include <cstdint>

namespace rcc::pbqp {

enum class ReductionKind : std::uint8_t {
  DegreeZero,
  DegreeOne,
  DegreeTwo,
  Heuristic,
};

struct ReductionRecord final {
  ReductionKind Kind = ReductionKind::DegreeZero;
  NodeID Node;
  NodeID FirstNeighbor;
  NodeID SecondNeighbor;
  std::size_t FixedSelection = 0;
  CostVector NodeCosts{1};
  CostMatrix FirstCosts{1, 1};
  CostMatrix SecondCosts{1, 1};
};

} // namespace rcc::pbqp

#endif // RCC_CODEGEN_PBQP_REDUCTIONRULES_H