ACEC/circuit.hpp
2022-10-14 14:04:57 +08:00

16 lines
489 B
C++

#ifndef circuit_hpp_INCLUDED
#define circuit_hpp_INCLUDED
enum gate_type {And, Xor, Majority, HA, FA};
const std::string gate_type[5] = {"and", "xor", "majority", "HA", "FA"};
struct circuit {
vec<int> to;
int sz, outs, type, neg, carrier;
circuit() : sz(0), outs(0), type(0), neg(0), carrier(0) {}
void push(int x) { to.push(x); sz++; }
int &operator [] (int index) { return to[index]; }
const int& operator [] (int index) const { return to[index]; }
};
#endif