14 #ifndef DP_MATRIX_MINIMIZE_H
15 #define DP_MATRIX_MINIMIZE_H
21 template <u
int32_t M, u
int32_t C>
22 bool is_vec_equal(
const uint32_t q[M][C],
const uint32_t c[M][C][C],
const uint32_t i)
24 for (uint32_t k = 0; k < M; ++k)
25 for (uint32_t j = 0; j < C; ++j)
26 if (q[k][j] != c[k][i][j])
32 template <u
int32_t M, u
int32_t C>
33 uint32_t find_state(
const uint32_t q[M][C],
const uint32_t c[M][C][C],
const uint32_t n)
35 for (uint32_t i = 0; i < n; ++i)
36 if (is_vec_equal<M>(q, c, i))
42 template <u
int32_t M, u
int32_t N, u
int32_t C>
43 uint32_t combine_equiv(
const uint32_t m[M][N][N], uint32_t c[M][C][C])
45 uint32_t r[2][N] = {{0}};
54 for (uint32_t i = 0; i < N; ++i) {
55 uint32_t q[M][C] = {{0}};
57 for (uint32_t k = 0; k < M; ++k) {
58 for (uint32_t j = 0; j < N; ++j) {
59 q[k][s[j]] += m[k][i][j];
63 t[i] = find_state<M>(q, c, n);
68 for (uint32_t k = 0; k < M; ++k) {
69 for (uint32_t j = 0; j < C; ++j) {
85 #endif // #ifndef DP_MATRIX_MINIMIZE_H
Header file for common.cc.