MCPcopy Create free account
hub / github.com/aff3ct/aff3ct / inner_encode

Method inner_encode

src/Module/Encoder/RSC/Encoder_RSC_generic_json_sys.cpp:69–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68template<typename B>
69int
70Encoder_RSC_generic_json_sys<B>::inner_encode(const int bit_sys, int& state)
71{
72 const auto bit_par = Encoder_RSC_generic_sys<B>::inner_encode(bit_sys, state);
73
74 if (bit_counter == 0)
75 {
76 if (natural_domain)
77 {
78 const auto trellis = this->get_trellis();
79
80 stream << "\t"
81 << "[{" << std::endl;
82
83 stream << "\t\t"
84 << "\"stage\": \"encoder\"," << std::endl
85 << "\t\t"
86 << "\"K\": " << this->K << "," << std::endl
87 << "\t\t"
88 << "\"poly\": \"{0" << std::oct << poly[0] << ",0" << std::oct << poly[1] << "}\"," << std::endl
89 << "\t\t"
90 << "\"R\": \"1/3\", " << std::endl
91 << "\t\t"
92 << "\"ff\": " << std::dec << this->n_ff << "," << std::endl
93 << "\t\t"
94 << "\"states\": " << this->n_states << "," << std::endl;
95
96 stream << "\t\t"
97 << "\"trellis\": [" << std::endl;
98 for (auto i = 0; i < (int)trellis.size(); i++)
99 {
100 stream << "\t\t\t"
101 << "[";
102 for (auto j = 0; j < (int)trellis[i].size() - 1; j++)
103 stream << std::setw(3) << trellis[i][j] << ",";
104 stream << std::setw(3) << trellis[i][(int)trellis[i].size() - 1] << "]";
105 if (i != (int)trellis.size() - 1) stream << "," << std::endl;
106 }
107 stream << "]," << std::endl;
108
109 stream << "\t\t"
110 << "\"transitions\": {" << std::endl
111 << "\t\t\t"
112 << "\"natural\": [" << std::endl;
113 }
114 else
115 stream << "\t\t\t"
116 << "\"interleaved\": [" << std::endl;
117 }
118
119 stream << "\t\t\t\t" << std::setw(2) << state;
120
121 if (bit_counter != (this->K + this->n_ff - 1))
122 {
123 stream << "," << std::endl;
124 bit_counter++;
125 }
126 else

Callers

nothing calls this directly

Calls 1

get_trellisMethod · 0.95

Tested by

no test coverage detected