#include #include #include #include #include void inner_logbp( size_t m, size_t n, size_t bits_count, size_t nodes_count, const uint32_t bits_values[], const uint32_t nodes_values[], int8_t Lc[], float Lq[], float Lr[], unsigned int n_iter, float L_posteriori_out[]); //decode(384, 6, 8, ...) int decode(size_t n, size_t nodes_count, size_t bits_count, uint32_t bits[], int8_t y[], int8_t out[], unsigned int maxiter) { const size_t m = n * nodes_count / bits_count; float Lq[m*n]; float Lr[m*n]; float L_posteriori[n]; /* Calculate column bit positions from row bit positions */ int32_t bits_transposed[nodes_count * n]; for (size_t i=0; i 1000 && i/w > head_tail && i/w < m*n/w-head_tail) { if (!ellipsis) { ellipsis = true; printf("\n ..."); } continue; } if (i) printf(", "); if (i%w == 0) printf("\n "); float outf = arrs[j][i]; char *s = outf < 0 ? "\033[91m" : (outf > 0 ? "\033[92m" : "\033[94m"); printf("%s% 012.6g\033[38;5;240m", s, outf); } printf("\n]\n"); } for (size_t i=0; i 0 ? "\033[92m" : "\033[94m"); printf("nij=%04u Lc=%s%3d\033[38;5;240m ", bits_values[q], s, lcv); x *= tanhf(0.5f * Lc[bits_values[q]]); } } } else { for (size_t q=bits_counter; q