author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
8,488
08.02.2019 15:05:33
-3,600
a1b89e98164f7c1d90c5e2c93633089a3b243b96
Add systematic SCF decoder.
[ { "change_type": "MODIFY", "old_path": "conf", "new_path": "conf", "diff": "-Subproject commit 79848a60c38a46fa8f3c519dcd8a22130949c4b7\n+Subproject commit 868a3f749d9aa30d6a87de33d8285a6c5302dec3\n" }, { "change_type": "MODIFY", "old_path": "refs", "new_path": "refs", "diff": "-Subproject commit 2edd756917890782029d21f12d79ee8282692ae0\n+Subproject commit b722558196083af5e632ac7dbb0ea586ec55cc2a\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Polar/Decoder_polar.cpp", "new_path": "src/Factory/Module/Decoder/Polar/Decoder_polar.cpp", "diff": "#include \"Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hpp\"\n#include \"Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive_sys.hpp\"\n#include \"Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive.hpp\"\n+#include \"Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive_sys.hpp\"\n#include \"Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive.hpp\"\n#include \"Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive_sys.hpp\"\n#include \"Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hpp\"\n@@ -199,8 +200,11 @@ module::Decoder_SIHO<B,Q>* Decoder_polar::parameters\nif (this->type == \"SCL\" ) return new module::Decoder_polar_SCL_naive_sys <B,Q,tools::f_LLR<Q>,tools::g_LLR<B,Q> >(this->K, this->N_cw, this->L, frozen_bits, this->n_frames);\n}\nelse\n+ {\n+ if (this->type == \"SCF\" ) return new module::Decoder_polar_SCF_naive_sys <B,Q,tools::f_LLR<Q>,tools::g_LLR<B,Q>,tools::h_LLR<B,Q>>(this->K, this->N_cw, frozen_bits, *crc, this->flips, this->n_frames);\nif (this->type == \"SCL\" ) return new module::Decoder_polar_SCL_naive_CA_sys<B,Q,tools::f_LLR<Q>,tools::g_LLR<B,Q> >(this->K, this->N_cw, this->L, frozen_bits, *crc, this->n_frames);\n}\n+ }\nelse if (this->implem == \"FAST\")\n{\nif (crc == nullptr || crc->get_size() == 0)\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive.hpp", "new_path": "src/Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive.hpp", "diff": "@@ -25,13 +25,14 @@ protected:\nconst int n_flips;\nstd::vector<int> index;\nint current_flip_index;\n-\n+ std::vector<tools::Binary_node<Contents_SC<B,R>>*> leaves;\npublic:\nDecoder_polar_SCF_naive(const int& K, const int& N, const std::vector<bool>& frozen_bits,\nCRC<B>& crc, const int n_flips, const int n_frames = 1);\nvirtual ~Decoder_polar_SCF_naive() = default;\nprotected:\n+ virtual bool check_crc ( );\nvoid _decode_siho (const R *Y_N, B *V_K, const int frame_id );\nvoid _decode_siho_cw (const R *Y_N, B *V_N, const int frame_id );\nvoid recursive_decode(const tools::Binary_node<Contents_SC<B,R>>* node_curr);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive.hxx", "new_path": "src/Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive.hxx", "diff": "@@ -24,6 +24,9 @@ Decoder_polar_SCF_naive<B,R,F,G,H>\n<< \", 'K' = \" << K << \").\";\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n+\n+ // get tree leaves\n+ leaves = this->polar_tree.get_leaves();\n}\n@@ -95,40 +98,25 @@ void Decoder_polar_SCF_naive<B,R,F,G,H>\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- // initialize current_flip_index\ncurrent_flip_index = -1;\n- // decode\nthis->recursive_decode(this->polar_tree.get_root());\n// identify the n_flips weakest llrs\nstd::partial_sort(index.begin(), index.begin() + n_flips, index.end(),\n- [leaves](const int& a, const int& b)\n- {return std::abs(leaves[a]->get_c()->lambda[0]) < std::abs(leaves[b]->get_c()->lambda[0]);}\n+ [this](const int& a, const int& b)\n+ {return std::abs(this->leaves[a]->get_c()->lambda[0]) < std::abs(this->leaves[b]->get_c()->lambda[0]);}\n);\n- // test crc\n- std::vector<B> U_test;\n- U_test.clear();\n- for (auto leaf = 0 ; leaf < this->N ; leaf++)\n- if (!this->frozen_bits[leaf])\n- U_test.push_back(leaves[leaf]->get_c()->s[0]);\n- decode_result = this->crc.check(U_test, this->get_simd_inter_frame_level());\n+ decode_result = this->check_crc();\nwhile ((n_ite < n_flips) && (!decode_result))\n{\ncurrent_flip_index = index[n_ite];\n- // decode\nthis->recursive_decode(this->polar_tree.get_root());\n- // test crc\n- std::vector<B> U_test;\n- U_test.clear();\n- for (auto leaf = 0 ; leaf < this->N ; leaf++)\n- if (!this->frozen_bits[leaf])\n- U_test.push_back(leaves[leaf]->get_c()->s[0]);\n- decode_result = this->crc.check(U_test, this->get_simd_inter_frame_level());\n+ decode_result = this->check_crc();\nn_ite ++;\n}\n@@ -158,49 +146,31 @@ void Decoder_polar_SCF_naive<B,R,F,G,H>\nif (!this->frozen_bits[i])\nindex[j++] = i;\n- // get tree leaves\n- auto leaves = this->polar_tree.get_leaves();\n-\n// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\nthis->_load(Y_N);\n// auto d_load = std::chrono::steady_clock::now() - t_load;\n// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- // initialize current_flip_index\ncurrent_flip_index = -1;\n- // decode\nthis->recursive_decode(this->polar_tree.get_root());\n// identify the n_flips weakest llrs\nstd::partial_sort(index.begin(), index.begin() + n_flips, index.end(),\n- [leaves](const int& a, const int& b)\n- {return std::abs(leaves[a]->get_c()->lambda[0]) < std::abs(leaves[b]->get_c()->lambda[0]);}\n+ [this](const int& a, const int& b)\n+ {return std::abs(this->leaves[a]->get_c()->lambda[0]) < std::abs(this->leaves[b]->get_c()->lambda[0]);}\n);\n- // test crc\n- std::vector<B> U_test;\n- U_test.clear();\n- for (auto leaf = 0 ; leaf < this->N ; leaf++)\n- if (!this->frozen_bits[leaf])\n- U_test.push_back(leaves[leaf]->get_c()->s[0]);\n- decode_result = this->crc.check(U_test, this->get_simd_inter_frame_level());\n+ decode_result = check_crc();\nwhile ((n_ite < n_flips) && (!decode_result))\n{\ncurrent_flip_index = index[n_ite];\n- // decode\nthis->recursive_decode(this->polar_tree.get_root());\n- // test crc\n- std::vector<B> U_test;\n- U_test.clear();\n- for (auto leaf = 0 ; leaf < this->N ; leaf++)\n- if (!this->frozen_bits[leaf])\n- U_test.push_back(leaves[leaf]->get_c()->s[0]);\n- decode_result = this->crc.check(U_test, this->get_simd_inter_frame_level());\n+ decode_result = check_crc();\nn_ite ++;\n}\n@@ -215,7 +185,17 @@ void Decoder_polar_SCF_naive<B,R,F,G,H>\n// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::store, d_store);\n}\n-\n+template <typename B, typename R, tools::proto_f<R> F, tools::proto_g<B,R> G, tools::proto_h<B,R> H>\n+bool Decoder_polar_SCF_naive<B,R,F,G,H>\n+::check_crc()\n+{\n+ std::vector<B> U_test;\n+ U_test.clear();\n+ for (auto leaf = 0 ; leaf < this->N ; leaf++)\n+ if (!this->frozen_bits[leaf])\n+ U_test.push_back(leaves[leaf]->get_c()->s[0]);\n+ return this->crc.check(U_test, this->get_simd_inter_frame_level());\n+}\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive_sys.hpp", "diff": "+#ifndef DECODER_POLAR_SCF_NAIVE_SYS_\n+#define DECODER_POLAR_SCF_NAIVE_SYS_\n+\n+#include <vector>\n+\n+#include \"Tools/Algo/Tree/Binary_tree.hpp\"\n+#include \"Tools/Code/Polar/decoder_polar_functions.h\"\n+\n+#include \"Decoder_polar_SCF_naive.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B = int, typename R = float, tools::proto_f< R> F = tools::f_LLR,\n+ tools::proto_g<B,R> G = tools::g_LLR,\n+ tools::proto_h<B,R> H = tools::h_LLR>\n+class Decoder_polar_SCF_naive_sys : public Decoder_polar_SCF_naive<B,R,F,G,H>\n+{\n+public:\n+ Decoder_polar_SCF_naive_sys(const int& K, const int& N, const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc, const int n_flips, const int n_frames = 1);\n+ virtual ~Decoder_polar_SCF_naive_sys() = default;\n+\n+protected:\n+ void _store (B *V, bool coded = false) const;\n+ bool check_crc( );\n+};\n+}\n+}\n+\n+#include \"Decoder_polar_SCF_naive_sys.hxx\"\n+\n+#endif /* DECODER_POLAR_SCF_NAIVE_SYS_ */\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive_sys.hxx", "diff": "+#include \"Decoder_polar_SCF_naive_sys.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B, typename R, tools::proto_f<R> F, tools::proto_g<B,R> G, tools::proto_h<B,R> H>\n+Decoder_polar_SCF_naive_sys<B,R,F,G,H>\n+::Decoder_polar_SCF_naive_sys(const int& K, const int& N, const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc, const int n_flips, const int n_frames)\n+: Decoder(K, N, n_frames, 1),\n+ Decoder_polar_SCF_naive<B,R,F,G,H>(K, N, frozen_bits, crc, n_flips, n_frames)\n+{\n+ const std::string name = \"Decoder_polar_SC_naive_sys\";\n+ this->set_name(name);\n+}\n+\n+template <typename B, typename R, tools::proto_f<R> F, tools::proto_g<B,R> G, tools::proto_h<B,R> H>\n+void Decoder_polar_SCF_naive_sys<B,R,F,G,H>\n+::_store(B *V, bool coded) const\n+{\n+ auto *contents_root = this->polar_tree.get_root()->get_c();\n+\n+ if (!coded)\n+ {\n+ auto k = 0;\n+ for (auto i = 0; i < this->N; i++)\n+ if (!this->frozen_bits[i])\n+ V[k++] = contents_root->s[i];\n+ }\n+ else\n+ std::copy(contents_root->s.begin(), contents_root->s.begin() + this->N, V);\n+}\n+\n+template <typename B, typename R, tools::proto_f<R> F, tools::proto_g<B,R> G, tools::proto_h<B,R> H>\n+bool Decoder_polar_SCF_naive_sys<B,R,F,G,H>\n+::check_crc()\n+{\n+ std::vector<B> U_test;\n+ U_test.clear();\n+\n+ for (auto i = 0 ; i < this->N ; i++)\n+ if (!this->frozen_bits[i])\n+ U_test.push_back(this->polar_tree.get_root()->get_c()->s[i]);\n+\n+ return this->crc.check(U_test, this->get_simd_inter_frame_level());\n+}\n+}\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/aff3ct.hpp", "new_path": "src/aff3ct.hpp", "diff": "#ifndef DECODER_POLAR_SCF_NAIVE_\n#include <Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive.hpp>\n#endif\n+#ifndef DECODER_POLAR_SCF_NAIVE_SYS_\n+#include <Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive_sys.hpp>\n+#endif\n#ifndef DECODER_POLAR_SCL_FAST_SYS_CA\n#include <Module/Decoder/Polar/SCL/CRC/Decoder_polar_SCL_fast_CA_sys.hpp>\n#endif\n" } ]
C++
MIT License
aff3ct/aff3ct
Add systematic SCF decoder.
8,490
11.02.2019 11:49:06
-3,600
c64d78d38e71656e5a3e4a3547a8babe7bccca02
Fix the Tal&Vardy Polar frozen bit generator.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_TV.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_TV.cpp", "diff": "@@ -93,7 +93,7 @@ void Frozenbits_generator_TV\ncmd += \" --no-print\"; // do not display anything\ncmd += \" -q \" + std::to_string(Mu); // quality\ncmd += \" --awgn\"; // type\n- cmd += \" --sigma=\" + std::to_string(this->sigma); // sigma value\n+ cmd += \" --sigma=\" + std::to_string(this->n->get_noise()); // sigma value\ncmd += \" --log-length=\" + str_m; // m\ncmd += \" -f=\" + filename; // filename\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the Tal&Vardy Polar frozen bit generator.
8,490
11.02.2019 16:08:32
-3,600
fbe787f9a30adb7610902c822020b67697743218
Rm barrier dead code.
[ { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.cpp", "new_path": "src/Simulation/BFER/BFER.cpp", "diff": "@@ -25,8 +25,6 @@ BFER<B,R,Q>\n: Simulation(params_BFER),\nparams_BFER(params_BFER),\n- barrier(params_BFER.n_threads),\n-\nbit_rate((float)params_BFER.src->K / (float)params_BFER.cdc->N),\nmonitor_mi(params_BFER.n_threads),\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/BFER.hpp", "new_path": "src/Simulation/BFER/BFER.hpp", "diff": "#include <vector>\n#include <memory>\n-#include \"Tools/Threads/Barrier.hpp\"\n-\n#include \"Tools/Display/Reporter/BFER/Reporter_BFER.hpp\"\n#include \"Tools/Display/Reporter/MI/Reporter_MI.hpp\"\n#include \"Tools/Display/Reporter/Noise/Reporter_noise.hpp\"\n@@ -48,9 +46,6 @@ protected:\nstd::vector<std::string> prev_err_messages;\nstd::vector<std::string> prev_err_messages_to_display;\n- // a barrier to synchronize the threads\n- tools::Barrier barrier;\n-\n// code specifications\nconst float bit_rate;\n" }, { "change_type": "DELETE", "old_path": "src/Tools/Threads/Barrier.cpp", "new_path": null, "diff": "-#include <string>\n-#include <chrono>\n-#include <iostream>\n-#include <sstream>\n-\n-#include \"Tools/Exception/exception.hpp\"\n-\n-#include \"Barrier.hpp\"\n-\n-using namespace aff3ct::tools;\n-\n-Barrier\n-::Barrier(const int n_threads)\n-: n_threads(n_threads), counter_barrier(n_threads), generation(0)\n-{\n- if (n_threads <= 0)\n- {\n- std::stringstream message;\n- message << \"'n_threads' has to be greater than 0 ('n_threads' = \" << n_threads << \").\";\n- throw invalid_argument(__FILE__, __LINE__, __func__, message.str());\n- }\n-}\n-\n-void Barrier\n-::operator()(const int tid)\n-{\n-\n- std::unique_lock<std::mutex> lock(mutex_barrier); // take the lock\n- int cur_gen = generation;\n-\n- if (--counter_barrier == 0)\n- {\n- counter_barrier = n_threads;\n- generation++;\n- cond_barrier.notify_all();\n- }\n- else\n- {\n- while (cur_gen == generation)\n- {\n- // release the lock\n- if (cond_barrier.wait_for(lock, std::chrono::milliseconds(6000)) == std::cv_status::timeout)\n- {\n- std::stringstream message;\n- message << \"aff3ct::tools::Barrier: some threads did not reach the barrier (counter_barrier = \"\n- << counter_barrier << \", tid = \" << tid << \", generation = \" << generation\n- << \"). \" << \"This message should never happen: there is a bug in the multithreaded code.\";\n- throw runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- }\n- }\n-\n- // release the lock\n-}\n" }, { "change_type": "DELETE", "old_path": "src/Tools/Threads/Barrier.hpp", "new_path": null, "diff": "-/*!\n- * \\file\n- * \\brief Waits until all threads reach the barrier.\n- *\n- * \\section LICENSE\n- * This file is under MIT license (https://opensource.org/licenses/MIT).\n- */\n-#ifndef BARRIER_HPP\n-#define BARRIER_HPP\n-\n-#include <mutex>\n-#include <atomic>\n-#include <condition_variable>\n-\n-namespace aff3ct\n-{\n-namespace tools\n-{\n-/*!\n- * \\class Barrier\n- *\n- * \\brief Waits until all threads reach the barrier.\n- */\n-class Barrier\n-{\n-private:\n- std::mutex mutex_barrier;\n- std::condition_variable cond_barrier;\n- const int n_threads;\n- int counter_barrier;\n- int generation;\n-\n-public:\n- /*!\n- * \\brief Constructor.\n- *\n- * \\param n_threads: number of threads to wait in the barrier.\n- */\n- explicit Barrier(const int n_threads);\n-\n- /*!\n- * \\brief Blocking method, wait until \"n_threads\" threads call this method.\n- *\n- * \\param tid: the number id of the thread which call this method.\n- */\n- void operator()(const int tid = -1);\n-};\n-}\n-}\n-\n-#endif /* BARRIER_HPP */\n" } ]
C++
MIT License
aff3ct/aff3ct
Rm barrier dead code.
8,490
11.02.2019 17:43:34
-3,600
dddbc3a0d9b488dadb3081de5d31304decdbb312
Fix a bug in the RSC_DB BCJR decoder when loading the LLRs in non-buffered mode.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/RSC_DB/BCJR/Decoder_RSC_DB_BCJR.cpp", "new_path": "src/Module/Decoder/RSC_DB/BCJR/Decoder_RSC_DB_BCJR.cpp", "diff": "@@ -75,8 +75,8 @@ void Decoder_RSC_DB_BCJR<B,R>\nsys[4*i + 2] = -a + b;\nsys[4*i + 3] = -a - b;\n- par[2*i ] = Y_N[4*i + 2];\n- par[2*i+2] = Y_N[4*i + 3];\n+ par[2*i ] = tools::div2(Y_N[4*i + 2]);\n+ par[2*i+1] = tools::div2(Y_N[4*i + 3]);\n}\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix a bug in the RSC_DB BCJR decoder when loading the LLRs in non-buffered mode.
8,490
11.02.2019 18:29:55
-3,600
6d032c65a42d0b7ee631b8d7861c076d9c604d5e
Add missing interleaver headers for RA codes.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Codec/RA/Codec_RA.cpp", "new_path": "src/Factory/Module/Codec/RA/Codec_RA.cpp", "diff": "@@ -91,6 +91,8 @@ void Codec_RA::parameters\nenc->get_headers(headers, full);\ndec->get_headers(headers, full);\n+ if (itl != nullptr)\n+ itl->get_headers(headers, full);\n}\ntemplate <typename B, typename Q>\n" } ]
C++
MIT License
aff3ct/aff3ct
Add missing interleaver headers for RA codes.
8,490
11.02.2019 19:53:49
-3,600
4d592a5f04dc8dbf03b6c0620ee5ec2e2f99be93
Add the possibility to select the interleaver seed from the cmd line.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/interleaver/interleaver.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/interleaver/interleaver.rst", "diff": "@@ -217,6 +217,23 @@ Description of the allowed values (see also the figures just bellow):\nInterleaver ``ROW_COL`` read orders.\n+.. _itl-itl-seed:\n+\n+``--itl-seed``\n+\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n+\n+ :Type: integer\n+ :Default: 0\n+ :Examples: ``--itl-seed 48``\n+\n+|factory::Interleaver_core::parameters::p+seed|\n+\n+All the threads/nodes have the same seed (except if a uniform interleaver is\n+used, see the :ref:`itl-itl-uni` parameter).\n+\n+.. note:: This parameter has no effect if the selected interleaver is not\n+ randomly generated.\n+\n.. _itl-itl-uni:\n``--itl-uni``\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/strings.rst", "new_path": "doc/sphinx/strings.rst", "diff": "Enable to generate a new |LUT| *for each new frame* (i.e. uniform\ninterleaver).\n-.. |factory::Interleaver_core::parameters::p+seed,S| replace::\n+.. |factory::Interleaver_core::parameters::p+seed| replace::\nSelect the seed used to initialize the |PRNG|.\n.. |factory::Interleaver_core::parameters::p+read-order| replace::\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Interleaver/Interleaver_core.cpp", "new_path": "src/Factory/Tools/Interleaver/Interleaver_core.cpp", "diff": "@@ -59,7 +59,7 @@ void Interleaver_core::parameters\ntools::add_arg(args, p, class_name+\"p+uni\",\ntools::None());\n- tools::add_arg(args, p, class_name+\"p+seed,S\",\n+ tools::add_arg(args, p, class_name+\"p+seed\",\ntools::Integer(tools::Positive()));\ntools::add_arg(args, p, class_name+\"p+read-order\",\n@@ -77,7 +77,7 @@ void Interleaver_core::parameters\nif(vals.exist({p+\"-type\" })) this->type = vals.at ({p+\"-type\" });\nif(vals.exist({p+\"-path\" })) this->path = vals.to_file({p+\"-path\" });\nif(vals.exist({p+\"-cols\" })) this->n_cols = vals.to_int ({p+\"-cols\" });\n- if(vals.exist({p+\"-seed\", \"S\"})) this->seed = vals.to_int ({p+\"-seed\", \"S\"});\n+ if(vals.exist({p+\"-seed\" })) this->seed = vals.to_int ({p+\"-seed\" });\nif(vals.exist({p+\"-uni\" })) this->uniform = true;\nif(vals.exist({p+\"-read-order\"})) this->read_order = vals.at ({p+\"-read-order\"});\n}\n@@ -96,7 +96,7 @@ void Interleaver_core::parameters\nheaders[p].push_back(std::make_pair(\"Number of columns\", std::to_string(this->n_cols)));\nif (this->type == \"RANDOM\" || this->type == \"GOLDEN\" || this->type == \"RAND_COL\")\n{\n- if (full) headers[p].push_back(std::make_pair(\"Seed\", std::to_string(this->seed)));\n+ headers[p].push_back(std::make_pair(\"Seed\", std::to_string(this->seed)));\nheaders[p].push_back(std::make_pair(\"Uniform\", (this->uniform ? \"yes\" : \"no\")));\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Code/RA/RA.cpp", "new_path": "src/Launcher/Code/RA/RA.cpp", "diff": "@@ -27,7 +27,6 @@ void RA<L,B,R,Q>\nthis->args.erase({penc+\"-fra\", \"F\"});\nthis->args.erase({penc+\"-seed\", \"S\"});\n- this->args.erase({pitl+\"-seed\", \"S\"});\nL::get_description_args();\n}\n@@ -42,8 +41,6 @@ void RA<L,B,R,Q>\nparams_cdc->enc ->n_frames = this->params.src->n_frames;\nparams_cdc->dec ->n_frames = this->params.src->n_frames;\n-\n- params_cdc->itl->core->seed = this->params.global_seed;\nparams_cdc->itl->core->n_frames = this->params.src->n_frames;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Code/Turbo/Turbo.cpp", "new_path": "src/Launcher/Code/Turbo/Turbo.cpp", "diff": "@@ -33,7 +33,6 @@ void Turbo<L,B,R,Q>\nthis->args.erase({penc+\"-fra\", \"F\"});\nthis->args.erase({penc+\"-seed\", \"S\"});\n- this->args.erase({pitl+\"-seed\", \"S\"});\nL::get_description_args();\n}\n@@ -74,8 +73,6 @@ void Turbo<L,B,R,Q>\nenc_tur ->sub2->n_frames = this->params.src->n_frames;\ndec_tur ->sub1->n_frames = this->params.src->n_frames;\ndec_tur ->sub2->n_frames = this->params.src->n_frames;\n-\n- params_cdc->itl->core->seed = this->params.global_seed;\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Code/Turbo_DB/Turbo_DB.cpp", "new_path": "src/Launcher/Code/Turbo_DB/Turbo_DB.cpp", "diff": "@@ -31,7 +31,6 @@ void Turbo_DB<L,B,R,Q>\nthis->args.erase({penc+\"-fra\", \"F\"});\nthis->args.erase({penc+\"-seed\", \"S\"});\n- this->args.erase({pitl+\"-seed\", \"S\"});\nL::get_description_args();\n}\n@@ -65,8 +64,6 @@ void Turbo_DB<L,B,R,Q>\nparams_cdc->itl->core->n_frames = this->params.src->n_frames;\nenc_tur->sub ->n_frames = this->params.src->n_frames;\ndec_tur->sub ->n_frames = this->params.src->n_frames;\n-\n- params_cdc->itl->core->seed = this->params.global_seed;\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Code/Turbo_product/Turbo_product.cpp", "new_path": "src/Launcher/Code/Turbo_product/Turbo_product.cpp", "diff": "@@ -28,7 +28,6 @@ void Turbo_product<L,B,R,Q>\nthis->args.erase({penc+\"-fra\", \"F\"});\nthis->args.erase({penc+\"-seed\", \"S\"});\n- this->args.erase({pitl+\"-seed\", \"S\"});\nL::get_description_args();\n@@ -69,8 +68,6 @@ void Turbo_product<L,B,R,Q>\nparams_cdc->itl->core->n_frames = this->params.src->n_frames;\nenc_tur ->sub ->n_frames = this->params.src->n_frames;\ndec_tur ->sub ->n_frames = this->params.src->n_frames;\n-\n- params_cdc->itl->core->seed = this->params.global_seed;\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Simulation/BFER_ite.cpp", "new_path": "src/Launcher/Simulation/BFER_ite.cpp", "diff": "@@ -63,7 +63,6 @@ void BFER_ite<B,R,Q>\nthis->args.erase({pcrc+\"-fra\", \"F\"});\nthis->args.erase({pitl+\"-size\" });\nthis->args.erase({pitl+\"-fra\", \"F\"});\n- this->args.erase({pitl+\"-seed\", \"S\"});\nthis->args.erase({pmdm+\"-fra-size\", \"N\"});\nthis->args.erase({pmdm+\"-fra\", \"F\"});\nthis->args.erase({pmdm+\"-noise\" });\n@@ -107,7 +106,6 @@ void BFER_ite<B,R,Q>\nparams.src->K = params.src->K == 0 ? params.crc->K : params.src->K;\nparams.itl->core->size = N;\n- params.itl->core->seed = params.local_seed;\nparams.itl->store(this->arg_vals);\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Iterative/BFER_ite.cpp", "new_path": "src/Simulation/BFER/Iterative/BFER_ite.cpp", "diff": "@@ -192,7 +192,8 @@ std::unique_ptr<tools ::Interleaver_core<>> BFER_ite<B,R,Q>\nconst auto seed_itl = rd_engine_seed[tid]();\nstd::unique_ptr<factory::Interleaver::parameters> params_itl(params_BFER_ite.itl->clone());\n- params_itl->core->seed = params_BFER_ite.itl->core->uniform ? seed_itl : params_BFER_ite.itl->core->seed;\n+ params_itl->core->seed = params_BFER_ite.itl->core->uniform ? params_BFER_ite.itl->core->seed + seed_itl :\n+ params_BFER_ite.itl->core->seed;\nif (params_BFER_ite.err_track_revert && params_BFER_ite.itl->core->uniform)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Simulation/BFER/Standard/BFER_std.cpp", "new_path": "src/Simulation/BFER/Standard/BFER_std.cpp", "diff": "@@ -179,7 +179,7 @@ std::unique_ptr<module::Codec_SIHO<B,Q>> BFER_std<B,R,Q>\n}\nelse if (params_cdc->itl->core->uniform)\n{\n- const auto seed_itl = rd_engine_seed[tid]();\n+ const auto seed_itl = rd_engine_seed[tid]() + params_cdc->itl->core->seed;\nparams_cdc->itl->core->seed = seed_itl;\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Add the possibility to select the interleaver seed from the cmd line.
8,490
11.02.2019 21:21:56
-3,600
7d806f226e4a1e1cd77f15570a7994553c60eb00
CI: add RSC & RSC DB regression tests.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -683,6 +683,112 @@ test-regression-rs:\n# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_RS\n# - ./ci/test-regression.py --refs-path refs/RS --results-path test-regression-results-rs --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+test-regression-rsc:\n+ stage: test\n+ variables:\n+ GIT_SUBMODULE_STRATEGY: recursive\n+ retry: 1\n+ except:\n+ - schedules\n+ dependencies:\n+ - build-linux-gcc-x64-sse4.2\n+ tags:\n+ - linux\n+ - x86\n+ - 64-bit\n+ - sse4.2\n+ - python3.4\n+ artifacts:\n+ name: test-regression-results-rsc\n+ when: always\n+ paths:\n+ - test-regression-results-rsc/\n+ script:\n+ - source ./ci/tools/threads.sh\n+ - source ./ci/tools/git-version.sh\n+ - export TIME_SEC=\"5\"\n+ - ./ci/test-regression.py --refs-path refs/RSC --results-path test-regression-results-rsc --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\n+# test-regression-rsc-long:\n+# stage: test\n+# variables:\n+# GIT_SUBMODULE_STRATEGY: recursive\n+# only:\n+# - schedules\n+# dependencies:\n+# - build-linux-gcc-x64-avx2\n+# tags:\n+# - linux\n+# - x86\n+# - 64-bit\n+# - avx2\n+# - powerful\n+# - schedules\n+# - python3.4\n+# artifacts:\n+# name: test-regression-results-rsc\n+# when: always\n+# paths:\n+# - test-regression-results-rsc/\n+# script:\n+# - source ./ci/tools/threads.sh\n+# - source ./ci/tools/git-version.sh\n+# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_RSC\n+# - ./ci/test-regression.py --refs-path refs/RSC --results-path test-regression-results-rsc --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\n+test-regression-rsc-db:\n+ stage: test\n+ variables:\n+ GIT_SUBMODULE_STRATEGY: recursive\n+ retry: 1\n+ except:\n+ - schedules\n+ dependencies:\n+ - build-linux-gcc-x64-sse4.2\n+ tags:\n+ - linux\n+ - x86\n+ - 64-bit\n+ - sse4.2\n+ - python3.4\n+ artifacts:\n+ name: test-regression-results-rsc-db\n+ when: always\n+ paths:\n+ - test-regression-results-rsc-db/\n+ script:\n+ - source ./ci/tools/threads.sh\n+ - source ./ci/tools/git-version.sh\n+ - export TIME_SEC=\"5\"\n+ - ./ci/test-regression.py --refs-path refs/RSC_DB --results-path test-regression-results-rsc-db --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\n+# test-regression-rsc-db-long:\n+# stage: test\n+# variables:\n+# GIT_SUBMODULE_STRATEGY: recursive\n+# only:\n+# - schedules\n+# dependencies:\n+# - build-linux-gcc-x64-avx2\n+# tags:\n+# - linux\n+# - x86\n+# - 64-bit\n+# - avx2\n+# - powerful\n+# - schedules\n+# - python3.4\n+# artifacts:\n+# name: test-regression-results-rsc-db\n+# when: always\n+# paths:\n+# - test-regression-results-rsc-db/\n+# script:\n+# - source ./ci/tools/threads.sh\n+# - source ./ci/tools/git-version.sh\n+# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_RSC_DB\n+# - ./ci/test-regression.py --refs-path refs/RSC_DB --results-path test-regression-results-rsc-db --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\ntest-regression-turbo:\nstage: test\nvariables:\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: add RSC & RSC DB regression tests.
8,490
12.02.2019 11:25:55
-3,600
1fb5be4caa6fe895d3d487d6b111f2a6000e89e4
CI: add RA and Repetition codes to the regression tests.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -630,6 +630,112 @@ test-regression-polar:\n# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_POLAR\n# - ./ci/test-regression.py --refs-path refs/POLAR --results-path test-regression-results-polar --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+test-regression-ra:\n+ stage: test\n+ variables:\n+ GIT_SUBMODULE_STRATEGY: recursive\n+ retry: 1\n+ except:\n+ - schedules\n+ dependencies:\n+ - build-linux-gcc-x64-sse4.2\n+ tags:\n+ - linux\n+ - x86\n+ - 64-bit\n+ - sse4.2\n+ - python3.4\n+ artifacts:\n+ name: test-regression-results-ra\n+ when: always\n+ paths:\n+ - test-regression-results-ra/\n+ script:\n+ - source ./ci/tools/threads.sh\n+ - source ./ci/tools/git-version.sh\n+ - export TIME_SEC=\"5\"\n+ - ./ci/test-regression.py --refs-path refs/RA --results-path test-regression-results-ra --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\n+# test-regression-ra-long:\n+# stage: test\n+# variables:\n+# GIT_SUBMODULE_STRATEGY: recursive\n+# only:\n+# - schedules\n+# dependencies:\n+# - build-linux-gcc-x64-avx2\n+# tags:\n+# - linux\n+# - x86\n+# - 64-bit\n+# - avx2\n+# - powerful\n+# - schedules\n+# - python3.4\n+# artifacts:\n+# name: test-regression-results-ra\n+# when: always\n+# paths:\n+# - test-regression-results-ra/\n+# script:\n+# - source ./ci/tools/threads.sh\n+# - source ./ci/tools/git-version.sh\n+# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_RA\n+# - ./ci/test-regression.py --refs-path refs/RA --results-path test-regression-results-ra --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\n+test-regression-rep:\n+ stage: test\n+ variables:\n+ GIT_SUBMODULE_STRATEGY: recursive\n+ retry: 1\n+ except:\n+ - schedules\n+ dependencies:\n+ - build-linux-gcc-x64-sse4.2\n+ tags:\n+ - linux\n+ - x86\n+ - 64-bit\n+ - sse4.2\n+ - python3.4\n+ artifacts:\n+ name: test-regression-results-rep\n+ when: always\n+ paths:\n+ - test-regression-results-rep/\n+ script:\n+ - source ./ci/tools/threads.sh\n+ - source ./ci/tools/git-version.sh\n+ - export TIME_SEC=\"5\"\n+ - ./ci/test-regression.py --refs-path refs/REP --results-path test-regression-results-rep --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\n+# test-regression-rep-long:\n+# stage: test\n+# variables:\n+# GIT_SUBMODULE_STRATEGY: recursive\n+# only:\n+# - schedules\n+# dependencies:\n+# - build-linux-gcc-x64-avx2\n+# tags:\n+# - linux\n+# - x86\n+# - 64-bit\n+# - avx2\n+# - powerful\n+# - schedules\n+# - python3.4\n+# artifacts:\n+# name: test-regression-results-rep\n+# when: always\n+# paths:\n+# - test-regression-results-rep/\n+# script:\n+# - source ./ci/tools/threads.sh\n+# - source ./ci/tools/git-version.sh\n+# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_REP\n+# - ./ci/test-regression.py --refs-path refs/REP --results-path test-regression-results-rep --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\ntest-regression-rs:\nstage: test\nvariables:\n" }, { "change_type": "MODIFY", "old_path": "refs", "new_path": "refs", "diff": "-Subproject commit 0b8236e54449e8e4847091278b048e11a26e6f1c\n+Subproject commit d68cce0bb314aa6fa4848dcc799995fb9390b34e\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: add RA and Repetition codes to the regression tests.
8,490
13.02.2019 15:02:10
-3,600
ac91c8ba2100b6565bd22fceeb93e7710a9612ab
Fix compilation errors and warnings.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp", "new_path": "src/Factory/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp", "diff": "@@ -90,7 +90,7 @@ void Encoder_polar_MK::parameters\nif (kernel_matrices.size() > 0)\n{\nstd::string kernels_str = \"{\" + tools::display_kernel(kernel_matrices[0]);\n- for (auto k = 1; k < kernel_matrices.size(); k++)\n+ for (size_t k = 1; k < kernel_matrices.size(); k++)\nkernels_str += \",\" + tools::display_kernel(kernel_matrices[k]);\nkernels_str += \"}\";\nheaders[p].push_back(std::make_pair(std::string(\"Kernels\"), kernels_str));\n@@ -98,7 +98,7 @@ void Encoder_polar_MK::parameters\nif (stages.size() > 0)\n{\nstd::string stages_str = \"{\" + std::to_string(stages[0]);\n- for (auto s = 1; s < stages.size(); s++)\n+ for (size_t s = 1; s < stages.size(); s++)\nstages_str += \",\" + std::to_string(stages[s]);\nstages_str += \"}\";\nheaders[p].push_back(std::make_pair(std::string(\"Stages\"), stages_str));\n" }, { "change_type": "MODIFY", "old_path": "src/Launcher/Code/Polar_MK/Polar_MK.cpp", "new_path": "src/Launcher/Code/Polar_MK/Polar_MK.cpp", "diff": "@@ -36,7 +36,7 @@ template <class L, typename B, typename R, typename Q>\nvoid Polar_MK<L,B,R,Q>\n::store_args()\n{\n- auto dec_polar = dynamic_cast<factory::Decoder_polar_MK::parameters*>(params_cdc->dec.get());\n+ // auto dec_polar = dynamic_cast<factory::Decoder_polar_MK::parameters*>(params_cdc->dec.get());\nparams_cdc->store(this->arg_vals);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.cpp", "new_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.cpp", "diff": "@@ -106,7 +106,7 @@ void Codec_polar_MK<B,Q>\n{\nthis->n->is_of_type_throw(tools::Noise_type::SIGMA);\n- fb_generator->set_sigma(this->n->get_noise());\n+ fb_generator->set_noise(noise);\nfb_generator->generate(frozen_bits);\nthis->notify_frozenbits_update();\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp", "new_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp", "diff": "@@ -83,7 +83,7 @@ void aff3ct::tools::read_polar_MK_code(const std::string\ntools::getline(file, line);\nauto values = tools::split(line);\n- if (values.size() == kernel_size)\n+ if (values.size() == (size_t)kernel_size)\n{\nfor (auto j = 0; j < kernel_size; j++)\nkernel[i][j] = (bool)std::stoi(values[j]);\n@@ -144,7 +144,7 @@ void aff3ct::tools::read_polar_MK_code(const std::string\ntools::getline(file, line);\nauto values = tools::split(line);\n- if (values.size() == n_stages)\n+ if (values.size() == (size_t)n_stages)\n{\nfor (auto s = 0; s < n_stages; s++)\nstages[s] = (uint32_t)std::stoi(values[s]);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK_sys.cpp", "new_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK_sys.cpp", "diff": "using namespace aff3ct;\nusing namespace aff3ct::module;\n+template <typename T = int32_t>\n+inline T kronecker_product_mul(T a, T b)\n+{\n+ return a * b;\n+}\n+\n+template <>\n+inline bool kronecker_product_mul<bool>(bool a, bool b)\n+{\n+ return a && b;\n+}\n+\ntemplate <typename T = int32_t>\nvoid kronecker_product(const std::vector<std::vector<T>>& A,\nconst std::vector<std::vector<T>>& B,\n@@ -22,7 +34,8 @@ void kronecker_product(const std::vector<std::vector<T>>& A,\nfor (auto col_A = 0; col_A < (int)A[0].size(); col_A++)\nfor (auto row_B = 0; row_B < (int)B.size(); row_B++)\nfor (auto col_B = 0; col_B < (int)B[0].size(); col_B++)\n- C[row_A * B.size() + row_B][col_A * B[0].size() + col_B] = A[row_A][col_A] * B[row_B][col_B];\n+ C[row_A * B.size() + row_B][col_A * B[0].size() + col_B] = kronecker_product_mul(A[row_A][col_A],\n+ B[row_B][col_B]);\n}\ntemplate <typename T = int32_t>\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix compilation errors and warnings.
8,490
14.02.2019 10:33:48
-3,600
26dd41a08807e22f64b9deb5c15f96d96bd1432b
Doc: use Markdown format instead of RST for various README files.
[ { "change_type": "ADD", "old_path": null, "new_path": "CONTRIBUTING.md", "diff": "+# Contributing Guidelines\n+\n+We're really glad you're reading this, because we need volunteer developers to\n+expand this project. Here are some important resources to communicate with us:\n+\n+- [The official website](http://aff3ct.github.io),\n+- Bugs? [Report issues on GitHub](https://github.com/aff3ct/aff3ct/issues).\n+\n+## Submitting changes\n+\n+Please send a\n+[GitHub Pull Request to AFF3CT](https://github.com/aff3ct/aff3ct/pull/new/)\n+with a clear list of what you've done (read more about\n+[pull requests](https://help.github.com/articles/about-pull-requests/)). Please\n+make your modifications on the ``development`` branch, any pull to the\n+``master`` branch will be refused (the ``master`` is dedecated to the releases).\n+\n+Always write a clear log message for your commits. One-line messages are fine\n+for small changes, but bigger changes should look like this:\n+\n+```bash\n+git commit -m \"A brief summary of the commit\n+>\n+> A paragraph describing what changed and its impact.\"\n+```\n+\n+## Regression Testing\n+\n+We maintain a database of BER/FER reference simulations. Please give us some new\n+references which solicit the code you added. We use those references in\n+[an automated regression test script](https://github.com/aff3ct/aff3ct/blob/master/ci/test-regression.py).\n+To propose new references please use our\n+[dedicated repository](https://github.com/aff3ct/error_rate_references) and send\n+us a pull request on it.\n+\n+## Coding conventions\n+\n+Start reading our code and you'll get the hang of it. For the readability, we\n+apply some coding conventions:\n+\n+- we indent using tabulation (hard tabs),\n+- we ALWAYS put spaces after list items and method parameters (``[1, 2, 3]``,\n+ not ``[1,2,3]``), around operators (``x += 1``, not ``x+=1``), and around\n+ hash arrows,\n+- we use the [snake case](https://en.wikipedia.org/wiki/Snake_case)\n+ (``my_variable``, not ``myVariable``), classes start with an upper case\n+ (`My_class`, not `my_class`) and variables/methods/functions start with a\n+ lower case,\n+- the number of characters is limited to 120 per line of code.\n+\n+This is open source software. Consider the people who will read your code, and\n+make it look nice for them. It's sort of like driving a car: Perhaps you love\n+doing donuts when you're alone, but with passengers the goal is to make the ride\n+as smooth as possible.\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "CONTRIBUTING.rst", "new_path": null, "diff": "-Contributing Guidelines\n-=======================\n-\n-We're really glad you're reading this, because we need volunteer developers to\n-expand this project.\n-\n-Here are some important resources to communicate with us:\n-\n- * The official website: http://aff3ct.github.io,\n- * Bugs? Report issues on GitHub: https://github.com/aff3ct/aff3ct/issues.\n-\n-Submitting changes\n-------------------\n-\n-.. _GitHub Pull Request to AFF3CT: https://github.com/aff3ct/aff3ct/pull/new/\n-.. _pull requests: https://help.github.com/articles/about-pull-requests/\n-\n-Please send a `GitHub Pull Request to AFF3CT`_ with a clear list of what you've\n-done (read more about `pull requests`_). Please make your modifications on the\n-``development`` branch, any pull to the ``master`` branch will be refused (the\n-``master`` is dedecated to the releases).\n-\n-Always write a clear log message for your commits. One-line messages are fine\n-for small changes, but bigger changes should look like this:\n-\n-.. code-block:: bash\n-\n- git commit -m \"A brief summary of the commit\n- >\n- > A paragraph describing what changed and its impact.\"\n-\n-Regression Testing\n-------------------\n-\n-.. _an automated regression test script: https://github.com/aff3ct/aff3ct/blob/master/ci/test-regression.py\n-.. _dedicated repository: https://github.com/aff3ct/error_rate_references\n-\n-We maintain a database of BER/FER reference simulations. Please give us some new\n-references which solicit the code you added. We use those references in\n-`an automated regression test script`_. To propose new references please use our\n-`dedicated repository`_ and send us a pull request on it.\n-\n-Coding conventions\n-------------------\n-\n-.. _snake case: https://en.wikipedia.org/wiki/Snake_case\n-\n-Start reading our code and you'll get the hang of it. For the readability, we\n-apply some coding conventions:\n-\n- * we indent using tabulation (hard tabs),\n- * we ALWAYS put spaces after list items and method parameters (``[1, 2, 3]``,\n- not ``[1,2,3]``), around operators (``x += 1``, not ``x+=1``), and around\n- hash arrows,\n- * we use the `snake case`_ (``my_variable``, not ``myVariable``), classes\n- start with an upper case (`My_class`, not `my_class`) and\n- variables/methods/functions start with a lower case,\n- * the number of characters is limited to 120 per line of code.\n-\n-This is open source software. Consider the people who will read your code, and\n-make it look nice for them. It's sort of like driving a car: Perhaps you love\n-doing donuts when you're alone, but with passengers the goal is to make the ride\n-as smooth as possible.\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "README.md", "diff": "+# AFF3CT: A Fast Forward Error Correction Toolbox!\n+\n+[![GitLab Pipeline Status](https://img.shields.io/gitlab/pipeline/aff3ct/aff3ct.svg)](https://gitlab.com/aff3ct/aff3ct/pipelines)\n+[![SonarQube Code Coverage](https://gitlab.com/aff3ct/aff3ct/badges/master/coverage.svg)](https://sonarqube.bordeaux.inria.fr/sonarqube/dashboard?id=storm%3Aaff3ct%3Agitlab%3Amaster)\n+[![Documentation Build Status](https://img.shields.io/readthedocs/aff3ct.svg)](https://readthedocs.org/projects/aff3ct/)\n+[![Latest Release](https://img.shields.io/github/release/aff3ct/aff3ct.svg)](https://github.com/aff3ct/aff3ct/releases)\n+[![DOI](https://zenodo.org/badge/60615913.svg)](https://zenodo.org/badge/latestdoi/60615913)\n+[![License: MIT](https://img.shields.io/github/license/aff3ct/aff3ct.svg)](./LICENSE)\n+\n+**AFF3CT** is a simulator dedicated to the Forward Error Correction (FEC or\n+**channel coding**). It is written in **C++** and it supports a large range of\n+codes: from the well-spread **Turbo codes** to the very new **Polar codes**\n+including the **Low-Density Parity-Check (LDPC) codes**. **AFF3CT** is a command\n+line program and it simulates communication chains based on a Monte Carlo\n+method.\n+\n+It is very easy to use, for instance, to estimate the BER/FER decoding\n+performances of the (2048,1723) Polar code from 1.0 to 4.0 dB:\n+\n+```bash\n+aff3ct -C \"POLAR\" -K 1723 -N 2048 -m 1.0 -M 4.0 -s 1.0\n+```\n+\n+And the output will be:\n+\n+```bash\n+# ----------------------------------------------------\n+# ---- A FAST FORWARD ERROR CORRECTION TOOLBOX >> ----\n+# ----------------------------------------------------\n+# Parameters :\n+# [...]\n+#\n+# The simulation is running...\n+# ---------------------||------------------------------------------------------||---------------------\n+# Signal Noise Ratio || Bit Error Rate (BER) and Frame Error Rate (FER) || Global throughput\n+# (SNR) || || and elapsed time\n+# ---------------------||------------------------------------------------------||---------------------\n+# ----------|----------||----------|----------|----------|----------|----------||----------|----------\n+# Es/N0 | Eb/N0 || FRA | BE | FE | BER | FER || SIM_THR | ET/RT\n+# (dB) | (dB) || | | | | || (Mb/s) | (hhmmss)\n+# ----------|----------||----------|----------|----------|----------|----------||----------|----------\n+ 0.25 | 1.00 || 104 | 16425 | 104 | 9.17e-02 | 1.00e+00 || 4.995 | 00h00'00\n+ 1.25 | 2.00 || 104 | 12285 | 104 | 6.86e-02 | 1.00e+00 || 13.678 | 00h00'00\n+ 2.25 | 3.00 || 147 | 5600 | 102 | 2.21e-02 | 6.94e-01 || 14.301 | 00h00'00\n+ 3.25 | 4.00 || 5055 | 2769 | 100 | 3.18e-04 | 1.98e-02 || 30.382 | 00h00'00\n+# End of the simulation.\n+```\n+\n+## Features\n+\n+**The simulator targets high speed simulations** and extensively uses parallel\n+techniques like SIMD, multi-threading and multi-nodes programming models.\n+Below, a list of the features that motivated the creation of the simulator:\n+\n+1. **reproduce state-of-the-art decoding performances**,\n+2. **explore various channel code configurations**, find new trade-offs,\n+3. **prototype hardware implementation** (fixed-point receivers, hardware in\n+ the loop tools),\n+4. **reuse tried and tested modules** and add yours,\n+5. **alternative to MATLAB**, if you seek to reduce simulations time.\n+\n+## Installation\n+\n+First make sure to have installed a C++11 compiler, CMake and Git. Then install\n+AFF3CT by running:\n+\n+```bash\n+git clone --recursive https://github.com/aff3ct/aff3ct.git\n+mkdir aff3ct/build\n+cd aff3ct/build\n+cmake .. -DCMAKE_BUILD_TYPE=\"Release\"\n+make -j4\n+```\n+\n+## Contribute\n+\n+- [Source Code](https://github.com/aff3ct/aff3ct)\n+- [Contributing guidelines](./CONTRIBUTING.md)\n+\n+## Support\n+\n+If you are having issues, please let us know on our\n+[issue tracker](https://github.com/aff3ct/aff3ct/issues).\n+\n+## License\n+\n+The project is licensed under the MIT license.\n+\n+External Links\n+--------------\n+\n+- [Official website](https://aff3ct.github.io)\n+- [Documentation](https://aff3ct.readthedocs.io)\n" }, { "change_type": "DELETE", "old_path": "README.rst", "new_path": null, "diff": "-AFF3CT: A Fast Forward Error Correction Toolbox!\n-================================================\n-\n-|PipelineBadge|_ |CoverageBadge|_ |DocBadge|_ |ReleaseBadge|_ |DOIBadge|_ |LicenseBadge|_\n-\n-**AFF3CT** is a simulator dedicated to the Forward Error Correction (FEC or\n-**channel coding**). It is written in **C++** and it supports a large range of\n-codes: from the well-spread **Turbo codes** to the very new **Polar codes**\n-including the **Low-Density Parity-Check (LDPC) codes**. **AFF3CT** is a command\n-line program and it simulates communication chains based on a Monte Carlo\n-method.\n-\n-It is very easy to use, for instance, to estimate the BER/FER decoding\n-performances of the (2048,1723) Polar code from 1.0 to 4.0 dB:\n-\n-.. code-block:: bash\n-\n- aff3ct -C \"POLAR\" -K 1723 -N 2048 -m 1.0 -M 4.0 -s 1.0\n-\n-And the output will be:\n-\n-.. code-block:: bash\n-\n- # ----------------------------------------------------\n- # ---- A FAST FORWARD ERROR CORRECTION TOOLBOX >> ----\n- # ----------------------------------------------------\n- # Parameters :\n- # [...]\n- #\n- # The simulation is running...\n- # ---------------------||------------------------------------------------------||---------------------\n- # Signal Noise Ratio || Bit Error Rate (BER) and Frame Error Rate (FER) || Global throughput\n- # (SNR) || || and elapsed time\n- # ---------------------||------------------------------------------------------||---------------------\n- # ----------|----------||----------|----------|----------|----------|----------||----------|----------\n- # Es/N0 | Eb/N0 || FRA | BE | FE | BER | FER || SIM_THR | ET/RT\n- # (dB) | (dB) || | | | | || (Mb/s) | (hhmmss)\n- # ----------|----------||----------|----------|----------|----------|----------||----------|----------\n- 0.25 | 1.00 || 104 | 16425 | 104 | 9.17e-02 | 1.00e+00 || 4.995 | 00h00'00\n- 1.25 | 2.00 || 104 | 12285 | 104 | 6.86e-02 | 1.00e+00 || 13.678 | 00h00'00\n- 2.25 | 3.00 || 147 | 5600 | 102 | 2.21e-02 | 6.94e-01 || 14.301 | 00h00'00\n- 3.25 | 4.00 || 5055 | 2769 | 100 | 3.18e-04 | 1.98e-02 || 30.382 | 00h00'00\n- # End of the simulation.\n-\n-Features\n---------\n-\n-**The simulator targets high speed simulations** and extensively uses parallel\n-techniques like SIMD, multi-threading and multi-nodes programming models.\n-Below, a list of the features that motivated the creation of the simulator:\n-\n- #. **reproduce state-of-the-art decoding performances**,\n- #. **explore various channel code configurations**, find new trade-offs,\n- #. **prototype hardware implementation** (fixed-point receivers, hardware in\n- the loop tools),\n- #. **reuse tried and tested modules** and add yours,\n- #. **alternative to MATLAB**, if you seek to reduce simulations\n- time.\n-\n-Installation\n-------------\n-\n-First make sure to have installed a C++11 compiler, CMake and Git. Then install\n-AFF3CT by running:\n-\n-.. code-block:: bash\n-\n- git clone --recursive https://github.com/aff3ct/aff3ct.git\n- mkdir aff3ct/build\n- cd aff3ct/build\n- cmake .. -DCMAKE_BUILD_TYPE=\"Release\"\n- make -j4\n-\n-Contribute\n-----------\n-\n-- Source Code: https://github.com/aff3ct/aff3ct\n-- Contributing guidelines: https://github.com/aff3ct/aff3ct/blob/master/CONTRIBUTING.rst\n-\n-Support\n--------\n-\n-If you are having issues, please let us know.\n-We have an issue tracker at: https://github.com/aff3ct/aff3ct/issues\n-\n-License\n--------\n-\n-The project is licensed under the MIT license.\n-\n-External Links\n---------------\n-\n-- Official website: https://aff3ct.github.io\n-- Documentation: https://aff3ct.readthedocs.io\n-\n-.. --------------------------------------------------------------------- badges\n-\n-.. |PipelineBadge| image:: https://img.shields.io/gitlab/pipeline/aff3ct/aff3ct.svg\n-.. _PipelineBadge: https://gitlab.com/aff3ct/aff3ct/pipelines\n-\n-.. |CoverageBadge| image:: https://gitlab.com/aff3ct/aff3ct/badges/master/coverage.svg\n-.. _CoverageBadge: https://sonarqube.bordeaux.inria.fr/sonarqube/dashboard?id=storm%3Aaff3ct%3Agitlab%3Amaster\n-\n-.. |DocBadge| image:: https://img.shields.io/readthedocs/aff3ct.svg\n-.. _DocBadge: https://readthedocs.org/projects/aff3ct/\n-\n-.. |ReleaseBadge| image:: https://img.shields.io/github/release/aff3ct/aff3ct.svg\n-.. _ReleaseBadge: https://github.com/aff3ct/aff3ct/releases\n-\n-.. |DOIBadge| image:: https://zenodo.org/badge/60615913.svg\n-.. _DOIBadge: https://zenodo.org/badge/latestdoi/60615913\n-\n-.. |LicenseBadge| image:: https://img.shields.io/github/license/aff3ct/aff3ct.svg\n-.. _LicenseBadge: ./LICENSE\n" }, { "change_type": "ADD", "old_path": null, "new_path": "doc/sphinx/README.md", "diff": "+# AFF3CT Documentation Generation\n+\n+**AFF3CT** uses [Sphinx](http://www.sphinx-doc.org) to generate the documentation.\n+\n+Install Sphinx using Python and pip:\n+\n+```bash\n+sudo apt install python3 python3-pip\n+sudo pip3 install -r requirements.txt\n+```\n+\n+To generate the documentation, you simply have to do:\n+\n+```bash\n+make html\n+```\n+\n+The last command will create a new folder: `build/html`.\n+In the `html` folder you just have to open the `index.html` file to read the generated documentation.\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/requirements.txt", "new_path": "doc/sphinx/requirements.txt", "diff": "@@ -3,3 +3,4 @@ sphinx-rtd-theme==0.4.2\nsphinxcontrib-bibtex==0.4.0\nsphinxcontrib-websupport==1.1.0\nbreathe==4.11.0\n+m2r==0.2.1\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/source/conf.py", "new_path": "doc/sphinx/source/conf.py", "diff": "@@ -46,7 +46,8 @@ extensions = [\n'sphinx.ext.autodoc',\n'sphinx.ext.mathjax',\n'sphinxcontrib.bibtex',\n- 'breathe'\n+ 'breathe',\n+ 'm2r'\n]\n# Add any paths that contain templates here, relative to this directory.\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/source/developer/contributing/contributing.rst", "new_path": "doc/sphinx/source/developer/contributing/contributing.rst", "diff": ".. _developer_contributing:\n-.. include:: ../../../../../CONTRIBUTING.rst\n\\ No newline at end of file\n+.. mdinclude:: ../../../../../CONTRIBUTING.md\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/source/others/readme/readme.rst", "new_path": "doc/sphinx/source/others/readme/readme.rst", "diff": "Readme\n^^^^^^\n-.. include:: ../../../../../README.rst\n\\ No newline at end of file\n+.. mdinclude:: ../../../../../README.md\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "scripts/debug_parser/README.md", "new_path": "scripts/debug_parser/README.md", "diff": "@@ -42,10 +42,10 @@ In the project root directory, run :\n## Output files format\n### Text (file.txt)\n-```\n- 8 // Number of Frames\n- int8 // Format in {int8, int16, int32, int64, float32, float64}\n- 32 // Frame Length\n+```bash\n+8 # Number of Frames\n+int8 # Format in {int8, int16, int32, int64, float32, float64}\n+32 # Frame Length\n-128 0 -128 0 0 -128 0 -128 -128 -128 -128 0 -128 0 0 0 -128 -128 0 -128 -128 0 0 0 -128 -128 0 0 0 -128 0 -128\n0 -128 0 -128 0 0 -128 0 0 0 0 0 -128 0 -128 -128 0 -128 -128 0 -128 0 -128 0 0 0 0 -128 0 0 0 -128\n0 0 -128 -128 -128 0 0 -128 0 -128 0 0 -128 0 -128 0 -128 -128 -128 0 -128 -128 -128 0 -128 0 0 0 0 -128 0 0\n" } ]
C++
MIT License
aff3ct/aff3ct
Doc: use Markdown format instead of RST for various README files.
8,490
16.02.2019 10:55:02
-3,600
f79c4ced6a286a7c62341af8720a0a5151a34dd7
Fix SonarQube bug.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive.hxx", "new_path": "src/Module/Decoder/Polar/SCF/Decoder_polar_SCF_naive.hxx", "diff": "@@ -12,7 +12,8 @@ Decoder_polar_SCF_naive<B,R,F,G,H>\nDecoder_polar_SC_naive<B,R,F,G,H>(K, N, frozen_bits, n_frames),\ncrc(crc),\nn_flips(n_flips),\n- index(K)\n+ index(K),\n+ current_flip_index(-1)\n{\nconst std::string name = \"Decoder_polar_SCF_naive\";\nthis->set_name(name);\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix SonarQube bug.
8,490
19.02.2019 12:06:18
-3,600
c07f40607b76e64442b12767f085a5bf37bea2a1
Improve the CMakeLists file. Update from version 3.0 to 3.1 (to have the support of the 'set (CMAKE_CXX_STANDARD 11)' command). Simplify the C++11 requirement. Use the CMake native way to add the '-fpic' option.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "# ------------------------------------------------------------------------------------------------------- CMAKE PROJECT\n# ---------------------------------------------------------------------------------------------------------------------\n-cmake_minimum_required (VERSION 3.0.2)\n+cmake_minimum_required (VERSION 3.1)\ncmake_policy(SET CMP0054 NEW)\nproject (aff3ct)\n@@ -54,11 +54,8 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} \"${CMAKE_CURRENT_SOURCE_DIR}/cmake/M\nset (CMAKE_MACOSX_RPATH 1)\n# Enable C++11\n-if (\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\" OR \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"AppleClang\")\n- set (CMAKE_CXX_STANDARD 14)\n-else ()\nset (CMAKE_CXX_STANDARD 11)\n-endif()\n+set (CMAKE_CXX_STANDARD_REQUIRED ON)\n# Specify bin and lib paths\nset (EXECUTABLE_OUTPUT_PATH bin/)\n@@ -180,6 +177,9 @@ macro (aff3ct_add_compile_options opt)\nlist(APPEND AFF3CT_COMPILE_OPTIONS ${opt})\nendmacro()\n+# set -fpic ON\n+set(CMAKE_POSITION_INDEPENDENT_CODE ON)\n+\n# by compiler\nif (\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\" OR \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"AppleClang\")\naff3ct_add_compile_options(-Wno-overloaded-virtual)\n@@ -198,7 +198,6 @@ if (WIN32) # for Windows operating system in general\nelseif (APPLE) # for macOS\nmessage(STATUS \"AFF3CT - System: macOS\")\nelseif (UNIX AND NOT APPLE) # for Linux, BSD, Solaris, Minix\n- aff3ct_add_compile_options(-fPIC)\nmessage(STATUS \"AFF3CT - System: Unix/Linux\")\nendif()\n" } ]
C++
MIT License
aff3ct/aff3ct
Improve the CMakeLists file. - Update from version 3.0 to 3.1 (to have the support of the 'set (CMAKE_CXX_STANDARD 11)' command). - Simplify the C++11 requirement. - Use the CMake native way to add the '-fpic' option.
8,490
19.02.2019 15:10:46
-3,600
b09b704afad8e3ac4881b73d0a607de50bef425c
Improve the threads lib link + use GNUInstallDirs.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -426,13 +426,11 @@ if (AFF3CT_MPI)\nendif(MPI_CXX_FOUND)\nendif(AFF3CT_MPI)\n-# pthread\n-if (\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\" OR\n- \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"AppleClang\" OR\n- \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR\n- \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Intel\")\n- aff3ct_link_libraries (-lpthread)\n-endif()\n+# Threads\n+set(CMAKE_THREAD_PREFER_PTHREAD ON)\n+set(THREADS_PREFER_PTHREAD_FLAG ON)\n+find_package(Threads REQUIRED)\n+aff3ct_link_libraries(Threads::Threads)\n# ---------------------------------------------------------------------------------------------------------------------\n# ----------------------------------------------------------------------------------------- GENERATE CMAKE CONFIG FILES\n@@ -450,63 +448,66 @@ endif()\n# ------------------------------------------------------------------------------------------------------------- INSTALL\n# ---------------------------------------------------------------------------------------------------------------------\n+# set CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_DATAROOTDIR variables\n+include(GNUInstallDirs)\n+\nif(AFF3CT_COMPILE_EXE)\n- install(TARGETS aff3ct-bin RUNTIME DESTINATION bin/)\n+ install(TARGETS aff3ct-bin RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/)\nif(UNIX)\n- install(FILES \"${CMAKE_CURRENT_SOURCE_DIR}/scripts/aff3ct\" DESTINATION bin/\n+ install(FILES \"${CMAKE_CURRENT_SOURCE_DIR}/scripts/aff3ct\" DESTINATION ${CMAKE_INSTALL_BINDIR}/\nPERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)\nendif()\nendif()\nif(AFF3CT_COMPILE_SHARED_LIB)\n- install(TARGETS aff3ct-shared-lib LIBRARY DESTINATION lib/)\n+ install(TARGETS aff3ct-shared-lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/)\nendif()\nif(AFF3CT_COMPILE_STATIC_LIB)\n- install(TARGETS aff3ct-static-lib ARCHIVE DESTINATION lib/)\n+ install(TARGETS aff3ct-static-lib ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/)\nendif()\nif(AFF3CT_COMPILE_SHARED_LIB OR AFF3CT_COMPILE_STATIC_LIB)\nset(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)\ninstall(DIRECTORY \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/aff3ct-${GIT_VERSION_RMV}\"\n- DESTINATION lib/cmake/)\n+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/)\nendif()\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/latex/AFF3CT.pdf\")\ninstall(FILES \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/latex/AFF3CT.pdf\"\n- DESTINATION share/aff3ct-${GIT_VERSION_RMV}/doc/pdf)\n+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${GIT_VERSION_RMV}/doc/pdf)\nendif()\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/html/\")\ninstall(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/html/\"\n- DESTINATION share/aff3ct-${GIT_VERSION_RMV}/doc/html)\n+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${GIT_VERSION_RMV}/doc/html)\nendif()\nif(AFF3CT_EXT_STRINGS)\ninstall(FILES \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/strings.rst\"\n- DESTINATION share/aff3ct-${GIT_VERSION_RMV}/doc/strings)\n+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${GIT_VERSION_RMV}/doc/strings)\nendif()\n-install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/src/\" DESTINATION include/aff3ct-${GIT_VERSION_RMV}/aff3ct\n+install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/src/\" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${GIT_VERSION_RMV}/aff3ct\nFILES_MATCHING PATTERN \"*.h\")\n-install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/src/\" DESTINATION include/aff3ct-${GIT_VERSION_RMV}/aff3ct\n+install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/src/\" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${GIT_VERSION_RMV}/aff3ct\nFILES_MATCHING PATTERN \"*.hpp\")\n-install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/src/\" DESTINATION include/aff3ct-${GIT_VERSION_RMV}/aff3ct\n+install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/src/\" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${GIT_VERSION_RMV}/aff3ct\nFILES_MATCHING PATTERN \"*.hxx\")\n-install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/date/include/date/\" DESTINATION include/aff3ct-${GIT_VERSION_RMV}/date\n+install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/date/include/date/\" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${GIT_VERSION_RMV}/date\nFILES_MATCHING PATTERN \"*.h\")\n-install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/MIPP/src/\" DESTINATION include/aff3ct-${GIT_VERSION_RMV}/MIPP\n+install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/MIPP/src/\" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${GIT_VERSION_RMV}/MIPP\nFILES_MATCHING PATTERN \"*.h\")\n-install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/MIPP/src/\" DESTINATION include/aff3ct-${GIT_VERSION_RMV}/MIPP\n+install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/MIPP/src/\" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${GIT_VERSION_RMV}/MIPP\nFILES_MATCHING PATTERN \"*.hxx\")\n-install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/MSVC/include/\" DESTINATION include/aff3ct-${GIT_VERSION_RMV}/dirent\n+install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/MSVC/include/\" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${GIT_VERSION_RMV}/dirent\nFILES_MATCHING PATTERN \"*.h\")\n-install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/rang/include/\" DESTINATION include/aff3ct-${GIT_VERSION_RMV}/rang\n+install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/rang/include/\" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${GIT_VERSION_RMV}/rang\nFILES_MATCHING PATTERN \"*.hpp\")\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/conf/cde/\")\n- install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/conf/\" DESTINATION share/aff3ct-${GIT_VERSION_RMV}/conf\n+ install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/conf/\" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${GIT_VERSION_RMV}/conf\nFILES_MATCHING PATTERN \"*\")\nendif()\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/refs/BCH/\")\n- install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/refs/\" DESTINATION share/aff3ct-${GIT_VERSION_RMV}/refs\n+ install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/refs/\" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${GIT_VERSION_RMV}/refs\nFILES_MATCHING PATTERN \"*.txt\"\nPATTERN \"readers\" EXCLUDE\nPATTERN \"untracked\" EXCLUDE)\n" } ]
C++
MIT License
aff3ct/aff3ct
Improve the threads lib link + use GNUInstallDirs.
8,490
25.02.2019 16:04:50
-3,600
36d4b7eeb58be13329ae3da9f9121edf667a84ce
Change CMake version from 3.2.2 to 3.2.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "# ------------------------------------------------------------------------------------------------------- CMAKE PROJECT\n# ---------------------------------------------------------------------------------------------------------------------\n-cmake_minimum_required(VERSION 3.2.3)\n+cmake_minimum_required(VERSION 3.2)\ncmake_policy(SET CMP0054 NEW)\nif(${CMAKE_VERSION} VERSION_GREATER \"3.13\")\n" } ]
C++
MIT License
aff3ct/aff3ct
Change CMake version from 3.2.2 to 3.2.
8,490
25.02.2019 16:47:42
-3,600
298893d31b6e468fcc01835632747598cfce218f
CI: update the builds to compile with the new CMakeLists.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -71,7 +71,6 @@ build-linux-gcc-nointr:\n- linux\n- gcc\n- cmake\n- - gsl\n- x86\nartifacts:\nname: build-linux-gcc-nointr\n@@ -82,7 +81,7 @@ build-linux-gcc-nointr:\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -DMIPP_NO_INTRINSICS\"\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_LINK_GSL=ON\"\n+ - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build_linux_gcc_nointr\"\n- source ./ci/tools/threads.sh\n- ./ci/build-linux-macos.sh\n@@ -99,7 +98,6 @@ build-linux-gcc-x64-sse4.2:\n- linux\n- gcc\n- cmake\n- - gsl\n- x86\n- 64-bit\nartifacts:\n@@ -111,7 +109,7 @@ build-linux-gcc-x64-sse4.2:\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -m64 -msse4.2\"\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_LINK_GSL=ON\"\n+ - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build_linux_gcc_x64_sse4.2\"\n- source ./ci/tools/threads.sh\n- ./ci/build-linux-macos.sh\n@@ -126,7 +124,6 @@ build-linux-gcc-x64-avx2:\n- linux\n- gcc\n- cmake\n- - gsl\n- x86\n- 64-bit\nartifacts:\n@@ -138,7 +135,7 @@ build-linux-gcc-x64-avx2:\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -m64 -mavx2 -mfma\"\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_LINK_GSL=ON\"\n+ - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build_linux_gcc_x64_avx2\"\n- source ./ci/tools/threads.sh\n- ./ci/build-linux-macos.sh\n@@ -192,7 +189,7 @@ build-linux-gcc-mpi:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -march=native\"\n- - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_LINK_GSL=ON -DAFF3CT_MPI=ON\"\n+ - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=OFF -DAFF3CT_COMPILE_SHARED_LIB=OFF -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_LINK_GSL=ON -DAFF3CT_MPI=ON\"\n- export NAME=\"build_linux_gcc_mpi\"\n- source ./ci/tools/threads.sh\n- ./ci/build-linux-macos.sh\n@@ -402,7 +399,7 @@ build-macos-clang-x64-sse4.2:\nscript:\n- export CC=\"clang\"\n- export CXX=\"clang++\"\n- - export CFLAGS=\"-Wall -funroll-loops -m64 -msse4.2\"\n+ - export CFLAGS=\"-Wall -Wno-overloaded-virtual -funroll-loops -m64 -msse4.2\"\n- export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build_macos_clang_x64_sse4.2\"\n- source ./ci/tools/threads.sh\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: update the builds to compile with the new CMakeLists.
8,490
25.02.2019 17:18:50
-3,600
ab3fe771ce86889b1d964f414501af5dcc6f6fd4
CI: disable clang warnings.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -242,7 +242,7 @@ build-linux-clang:\nscript:\n- export CC=\"clang\"\n- export CXX=\"clang++\"\n- - export CFLAGS=\"-Wall -funroll-loops\"\n+ - export CFLAGS=\"-Wall -Wno-overloaded-virtual -funroll-loops\"\n- export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_LINK_GSL=ON\"\n- export NAME=\"build_linux_clang\"\n- source ./ci/tools/threads.sh\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: disable clang warnings.
8,490
25.02.2019 17:19:30
-3,600
63db6502e1694e49589398e900aef6b435d83bb9
CI: show CMake version.
[ { "change_type": "MODIFY", "old_path": "ci/build-linux-macos.sh", "new_path": "ci/build-linux-macos.sh", "diff": "#!/bin/bash\nset -x\n+cmake --version\nmkdir build\ncd build\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "@echo on\n+cmake --version\nmkdir build\ncd build\ncmake .. -G\"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_BUILD_TYPE=Release %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"%CFLAGS%\" -DCMAKE_EXE_LINKER_FLAGS=\"%LFLAGS%\"\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "set \"VSCMD_START_DIR=%CD%\"\ncall \"%VS_PATH%\\VC\\Auxiliary\\Build\\vcvars64.bat\"\n+cmake --version\nmkdir build\ncd build\ncmake .. -G\"Visual Studio 15 2017 Win64\" %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"%CFLAGS% /MP%THREADS%\"\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: show CMake version.
8,490
25.02.2019 18:59:58
-3,600
ee0c8a58c11dfafd33df3f598e8d8362349e3c0f
Separate exports from install.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -461,6 +461,32 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)\nfind_package(Threads REQUIRED)\naff3ct_target_link_libraries(Threads::Threads)\n+# ---------------------------------------------------------------------------------------------------------------------\n+# -------------------------------------------------------------------------------------------------------------- EXPORT\n+# ---------------------------------------------------------------------------------------------------------------------\n+\n+if (AFF3CT_COMPILE_SHARED_LIB AND NOT AFF3CT_COMPILE_STATIC_LIB)\n+ export(TARGETS\n+ aff3ct-shared-lib\n+ NAMESPACE aff3ct::\n+ FILE \"lib/cmake/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct-config.cmake\")\n+endif()\n+\n+if (AFF3CT_COMPILE_STATIC_LIB AND NOT AFF3CT_COMPILE_SHARED_LIB)\n+ export(TARGETS\n+ aff3ct-static-lib\n+ NAMESPACE aff3ct::\n+ FILE \"lib/cmake/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct-config.cmake\")\n+endif()\n+\n+if(AFF3CT_COMPILE_SHARED_LIB AND AFF3CT_COMPILE_STATIC_LIB)\n+ export(TARGETS\n+ aff3ct-shared-lib\n+ aff3ct-static-lib\n+ NAMESPACE aff3ct::\n+ FILE \"lib/cmake/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct-config.cmake\")\n+endif()\n+\n# ---------------------------------------------------------------------------------------------------------------------\n# ------------------------------------------------------------------------------------------------------------- INSTALL\n# ---------------------------------------------------------------------------------------------------------------------\n@@ -480,32 +506,12 @@ if(AFF3CT_COMPILE_SHARED_LIB)\nEXPORT aff3ct-config\nLIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/\nCOMPONENT library)\n- if (NOT AFF3CT_COMPILE_STATIC_LIB)\n- export(TARGETS\n- aff3ct-shared-lib\n- NAMESPACE aff3ct::\n- FILE \"lib/cmake/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct-config.cmake\")\n- endif()\nendif()\nif(AFF3CT_COMPILE_STATIC_LIB)\ninstall(TARGETS aff3ct-static-lib\nEXPORT aff3ct-config\nARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/\nCOMPONENT library)\n- if (NOT AFF3CT_COMPILE_SHARED_LIB)\n- export(TARGETS\n- aff3ct-static-lib\n- NAMESPACE aff3ct::\n- FILE \"lib/cmake/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct-config.cmake\")\n- endif()\n-endif()\n-\n-if(AFF3CT_COMPILE_SHARED_LIB AND AFF3CT_COMPILE_STATIC_LIB)\n- export(TARGETS\n- aff3ct-shared-lib\n- aff3ct-static-lib\n- NAMESPACE aff3ct::\n- FILE \"lib/cmake/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct-config.cmake\")\nendif()\nif (AFF3CT_COMPILE_SHARED_LIB OR AFF3CT_COMPILE_STATIC_LIB)\n" } ]
C++
MIT License
aff3ct/aff3ct
Separate exports from install.
8,494
26.02.2019 13:29:39
-3,600
d9ee520bce296202669b7043c6d84f1ca5c101f8
Separate WBF and MWBF algorithms + rename '--dec-mwbf' in '--dec-mwbf-factor'.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "new_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.cpp", "diff": "@@ -91,7 +91,7 @@ void Decoder_LDPC::parameters\n#ifdef __cpp_aligned_new\ntools::add_options(args.at({p+\"-type\", \"D\"}), 0, \"BP_HORIZONTAL_LAYERED_LEGACY\");\n#endif\n- tools::add_options(args.at({p+\"-implem\" }), 0, \"SPA\", \"LSPA\", \"MS\", \"OMS\", \"NMS\", \"AMS\", \"GALA\", \"GALB\", \"GALE\", \"WBF\", \"PPBF\");\n+ tools::add_options(args.at({p+\"-implem\" }), 0, \"SPA\", \"LSPA\", \"MS\", \"OMS\", \"NMS\", \"AMS\", \"GALA\", \"GALB\", \"GALE\", \"WBF\", \"MWBF\", \"PPBF\");\ntools::add_arg(args, p, class_name+\"p+ite,i\",\ntools::Integer(tools::Positive()));\n@@ -99,7 +99,7 @@ void Decoder_LDPC::parameters\ntools::add_arg(args, p, class_name+\"p+off\",\ntools::Real());\n- tools::add_arg(args, p, class_name+\"p+mwbf\",\n+ tools::add_arg(args, p, class_name+\"p+mwbf-factor\",\ntools::Real());\ntools::add_arg(args, p, class_name+\"p+norm\",\n@@ -136,7 +136,7 @@ void Decoder_LDPC::parameters\nif(vals.exist({p+\"-ite\", \"i\"})) this->n_ite = vals.to_int ({p+\"-ite\", \"i\"});\nif(vals.exist({p+\"-synd-depth\" })) this->syndrome_depth = vals.to_int ({p+\"-synd-depth\" });\nif(vals.exist({p+\"-off\" })) this->offset = vals.to_float({p+\"-off\" });\n- if(vals.exist({p+\"-mwbf\" })) this->mwbf_factor = vals.to_float({p+\"-mwbf\" });\n+ if(vals.exist({p+\"-mwbf-factor\"})) this->mwbf_factor = vals.to_float({p+\"-mwbf-factor\"});\nif(vals.exist({p+\"-norm\" })) this->norm_factor = vals.to_float({p+\"-norm\" });\nif(vals.exist({p+\"-ppbf-proba\" })) this->ppbf_proba = vals.to_list<float>({p+\"-ppbf-proba\"});\nif(vals.exist({p+\"-no-synd\" })) this->enable_syndrome = false;\n@@ -200,6 +200,9 @@ void Decoder_LDPC::parameters\nheaders[p].push_back(std::make_pair(\"Bernouilli probas\", bern_str.str()));\n}\n+\n+ if (this->implem == \"MWBF\")\n+ headers[p].push_back(std::make_pair(\"Weighting factor\", std::to_string(this->mwbf_factor)));\n}\n}\n@@ -258,7 +261,8 @@ module::Decoder_SISO_SIHO<B,Q>* Decoder_LDPC::parameters\n}\nelse if (this->type == \"BIT_FLIPPING\")\n{\n- if (this->implem == \"WBF\" ) return new module::Decoder_LDPC_bit_flipping_OMWBF<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->mwbf_factor, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ if (this->implem == \"WBF\" ) return new module::Decoder_LDPC_bit_flipping_OMWBF<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, 0.f , this->enable_syndrome, this->syndrome_depth, this->n_frames);\n+ if (this->implem == \"MWBF\") return new module::Decoder_LDPC_bit_flipping_OMWBF<B,Q>(this->K, this->N_cw, this->n_ite, H, info_bits_pos, this->mwbf_factor, this->enable_syndrome, this->syndrome_depth, this->n_frames);\n}\n#ifdef __cpp_aligned_new\nelse if (this->type == \"BP_HORIZONTAL_LAYERED\" && this->simd_strategy == \"INTER\")\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.hpp", "new_path": "src/Factory/Module/Decoder/LDPC/Decoder_LDPC.hpp", "diff": "@@ -33,7 +33,7 @@ struct Decoder_LDPC : public Decoder\nstd::string simd_strategy = \"\";\nfloat norm_factor = 1.f;\nfloat offset = 0.f;\n- float mwbf_factor = 0.f;\n+ float mwbf_factor = 1.f;\nbool enable_syndrome = true;\nint syndrome_depth = 1;\nint n_ite = 10;\n" } ]
C++
MIT License
aff3ct/aff3ct
Separate WBF and MWBF algorithms + rename '--dec-mwbf' in '--dec-mwbf-factor'.
8,494
26.02.2019 13:31:03
-3,600
6fb719e65a291f1290b1ed7dc2d4333f41386a21
Doc: adapt the WBF after spliting into WBF and MWBF.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/conf.py", "new_path": "doc/sphinx/source/conf.py", "diff": "@@ -326,6 +326,7 @@ rst_epilog = \"\"\"\n.. |MS| replace:: :abbr:`MS (Min-Sum)`\n.. |MSVC| replace:: :abbr:`MSVC (Microsoft Visual C++)`\n.. |MT 19937| replace:: :abbr:`MT 19937 (Mersenne Twister 19937)`\n+.. |MWBF| replace:: :abbr:`MWBF (Modified Weighted Bit Flipping)`\n.. |NEON| replace:: :abbr:`NEON (ARM SIMD instructions)`\n.. |NMS| replace:: :abbr:`NMS (Normalized Min-Sum)`\n.. |OMS| replace:: :abbr:`OMS (Offset Min-Sum)`\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/ldpc/decoder.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/ldpc/decoder.rst", "diff": "@@ -134,8 +134,8 @@ Description of the allowed values:\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n:Type: text\n- :Allowed values: ``STD`` ``GALA`` ``GALB`` ``GALE`` ``WBF`` ``PPBF`` ``SPA``\n- ``LSPA`` ``AMS`` ``MS`` ``NMS`` ``OMS``\n+ :Allowed values: ``STD`` ``GALA`` ``GALB`` ``GALE`` ``WBF`` ``MWBF`` ``PPBF``\n+ ``SPA`` ``LSPA`` ``AMS`` ``MS`` ``NMS`` ``OMS``\n:Default: ``SPA``\n:Examples: ``--dec-implem AMS``\n@@ -158,6 +158,8 @@ Description of the allowed values:\n+-----------+------------------------------------------------------------------------+\n| ``WBF`` | Select the |WBF| algorithm :cite:`Wadayama2010`. |\n+-----------+------------------------------------------------------------------------+\n+| ``MWBF`` | Select the |MWBF| algorithm :cite:`Wadayama2010`. |\n++-----------+------------------------------------------------------------------------+\n| ``SPA`` | Select the |SPA| update rules :cite:`MacKay1995`. |\n+-----------+------------------------------------------------------------------------+\n| ``LSPA`` | Select the |LSPA| update rules :cite:`MacKay1995`. |\n@@ -179,19 +181,19 @@ corresponding available implementations.\n.. table:: |LDPC| decoder types and available implementations.\n:align: center\n- +---------+-----+------+------+------+------+-----+-----+------+-----+----+-----+-----+\n- | Decoder ||STD|||GALA|||GALB|||GALE|||PPBF|||WBF|||SPA|||LSPA|||AMS|||MS|||NMS|||OMS||\n- +=========+=====+======+======+======+======+=====+=====+======+=====+====+=====+=====+\n- | |BF| | | | | ||K| ||K| | | | | | | |\n- +---------+-----+------+------+------+------+-----+-----+------+-----+----+-----+-----+\n- | |BP-P| ||K| | | | | | | | | | | | |\n- +---------+-----+------+------+------+------+-----+-----+------+-----+----+-----+-----+\n- | |BP-F| | ||K| ||K| ||K| | | ||K3| ||K2| ||K2| ||K2|||K2| ||K2| |\n- +---------+-----+------+------+------+------+-----+-----+------+-----+----+-----+-----+\n- | |BP-HL| | | | | | | ||K2| ||K2| ||K2| ||K1|||K1| ||K1| |\n- +---------+-----+------+------+------+------+-----+-----+------+-----+----+-----+-----+\n- | |BP-VL| | | | | | | ||K2| ||K2| ||K2| ||K2|||K2| ||K2| |\n- +---------+-----+------+------+------+------+-----+-----+------+-----+----+-----+-----+\n+ +---------+-----+------+------+------+------+-----+------+-----+------+-----+----+-----+-----+\n+ | Decoder ||STD|||GALA|||GALB|||GALE|||PPBF|||WBF|||MWBF|||SPA|||LSPA|||AMS|||MS|||NMS|||OMS||\n+ +=========+=====+======+======+======+======+=====+======+=====+======+=====+====+=====+=====+\n+ | |BF| | | | | ||K| ||K| ||K| | | | | | | |\n+ +---------+-----+------+------+------+------+-----+------+-----+------+-----+----+-----+-----+\n+ | |BP-P| ||K| | | | | | | | | | | | | |\n+ +---------+-----+------+------+------+------+-----+------+-----+------+-----+----+-----+-----+\n+ | |BP-F| | ||K| ||K| ||K| | | | ||K3| ||K2| ||K2| ||K2|||K2| ||K2| |\n+ +---------+-----+------+------+------+------+-----+------+-----+------+-----+----+-----+-----+\n+ | |BP-HL| | | | | | | | ||K2| ||K2| ||K2| ||K1|||K1| ||K1| |\n+ +---------+-----+------+------+------+------+-----+------+-----+------+-----+----+-----+-----+\n+ | |BP-VL| | | | | | | | ||K2| ||K2| ||K2| ||K2|||K2| ||K2| |\n+ +---------+-----+------+------+------+------+-----+------+-----+------+-----+----+-----+-----+\n.. |K| replace:: :math:`\\checkmark`\n.. |K1| replace:: :math:`\\checkmark^{*}`\n@@ -361,16 +363,16 @@ only a :math:`\\min` function.\n|factory::Decoder_LDPC::parameters::p+off|\n-.. _dec-ldpc-dec-mwbf:\n+.. _dec-ldpc-dec-mwbf-factor:\n-``--dec-mwbf``\n-\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n+``--dec-mwbf-factor``\n+\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n:Type: real number\n:Default: 0.0\n- :Examples: ``--dec-mwbf 1.0``\n+ :Examples: ``--dec-mwbf-factor 1.0``\n-|factory::Decoder_LDPC::parameters::p+mwbf|\n+|factory::Decoder_LDPC::parameters::p+mwbf-factor|\n.. _dec-ldpc-dec-synd-depth:\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/strings.rst", "new_path": "doc/sphinx/strings.rst", "diff": ".. |factory::Decoder_LDPC::parameters::p+off| replace::\nSet the offset used in the |OMS| update rule.\n-.. |factory::Decoder_LDPC::parameters::p+mwbf| replace::\n- Give the factor used in the modified |WBF| algorithm. Set to 0 for basic\n- |WBF| algorithm.\n+.. |factory::Decoder_LDPC::parameters::p+mwbf-factor| replace::\n+ Give the weighting factor used in the |MWBF| algorithm.\n.. |factory::Decoder_LDPC::parameters::p+norm| replace::\nSet the normalization factor used in the |NMS| update rule.\n" } ]
C++
MIT License
aff3ct/aff3ct
Doc: adapt the WBF after spliting into WBF and MWBF.
8,490
26.02.2019 16:12:16
-3,600
165c77e21a240b436782f57702ce188046c17248
CI: use CMake install target to prepare the builds.
[ { "change_type": "MODIFY", "old_path": "ci/build-linux-macos.sh", "new_path": "ci/build-linux-macos.sh", "diff": "@@ -27,25 +27,19 @@ if [ -z \"$LFLAGS\" ]\nthen\ncmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CXX \\\n-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"$CFLAGS\" \\\n- $CMAKE_OPT\n+ $CMAKE_OPT -DCMAKE_INSTALL_PREFIX=\"$NAME\"\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nelse\ncmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CXX \\\n-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"$CFLAGS\" \\\n-DCMAKE_EXE_LINKER_FLAGS=\"$LFLAGS\" \\\n- $CMAKE_OPT\n+ $CMAKE_OPT -DCMAKE_INSTALL_PREFIX=\"$NAME\"\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nfi\nmake -j $THREADS -k\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-\nrm -rf $NAME\n-mkdir $NAME $NAME/bin $NAME/lib $NAME/include $NAME/include/aff3ct\n-cp bin/aff3ct* $NAME/bin/\n-cp lib/libaff3ct*.a $NAME/lib/\n-cp -r ../src/* $NAME/include/aff3ct/\n-find $NAME/include/aff3ct/ -type f -follow -print | grep \"[.]cpp$\" | xargs rm -f\n-find $NAME/include/aff3ct/ -type f -follow -print | grep \"[.]cpp.in$\" | xargs rm -f\n-\n+make install > /dev/null\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nmv $NAME ../\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-gcc.bat", "new_path": "ci/build-windows-gcc.bat", "diff": "cmake --version\nmkdir build\ncd build\n-cmake .. -G\"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_BUILD_TYPE=Release %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"%CFLAGS%\" -DCMAKE_EXE_LINKER_FLAGS=\"%LFLAGS%\"\n+cmake .. -G\"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_BUILD_TYPE=Release %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"%CFLAGS%\" -DCMAKE_EXE_LINKER_FLAGS=\"%LFLAGS%\" -DCMAKE_INSTALL_PREFIX=\"%NAME%\"\nif %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\nmingw32-make -j %THREADS%\nif %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\n-\nrd /s /q %NAME%\n-mkdir %NAME%\n-mkdir %NAME%\\bin\\\n-mkdir %NAME%\\lib\\\n-mkdir %NAME%\\include\\\n-mkdir %NAME%\\include\\aff3ct\\\n-\n- copy bin\\aff3ct*.exe %NAME%\\bin\\\n- copy lib\\libaff3ct*.a %NAME%\\lib\\\n-xcopy ..\\src\\* %NAME%\\include\\aff3ct\\ /s /e > nul\n-\n+mingw32-make install > nul\n+if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\nmove %NAME% ..\\\n" }, { "change_type": "MODIFY", "old_path": "ci/build-windows-msvc.bat", "new_path": "ci/build-windows-msvc.bat", "diff": "@@ -6,21 +6,12 @@ call \"%VS_PATH%\\VC\\Auxiliary\\Build\\vcvars64.bat\"\ncmake --version\nmkdir build\ncd build\n-cmake .. -G\"Visual Studio 15 2017 Win64\" %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"%CFLAGS% /MP%THREADS%\"\n+cmake .. -G\"Visual Studio 15 2017 Win64\" %CMAKE_OPT% -DCMAKE_CXX_FLAGS=\"%CFLAGS% /MP%THREADS%\" -DCMAKE_INSTALL_PREFIX=\"%NAME%\"\nif %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\ndevenv /build Release aff3ct.sln\nrem msbuild aff3ct.sln /t:Build /p:Configuration=Release\nif %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%\n-\nrd /s /q %NAME%\n-mkdir %NAME%\n-mkdir %NAME%\\bin\\\n-mkdir %NAME%\\lib\\\n-mkdir %NAME%\\include\\\n-mkdir %NAME%\\include\\aff3ct\\\n-\n- copy bin\\Release\\aff3ct*.exe %NAME%\\bin\\\n- copy lib\\Release\\aff3ct*.lib %NAME%\\lib\\\n-xcopy ..\\src\\* %NAME%\\include\\aff3ct\\ /s /e > nul\n-\n+devenv /build Release aff3ct.sln /project INSTALL > nul\n+if %ERRORLEVEL% neq 0 exit %ERRORLEVEL%\nmove %NAME% ..\\\n" }, { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -89,34 +89,7 @@ do\nZIP_NAME=$(echo \"${BUILD/build/$PREFIX}\")\nZIP_NAME=$(echo \"${ZIP_NAME/\\./\\_}_$GIT_HASH.zip\")\n- # prepare headers\n- find $BUILD/include/aff3ct/ -type f -follow -print | grep \"[.]cpp$\" | xargs rm -f\n- find $BUILD/include/aff3ct/ -type f -follow -print | grep \"[.]cpp.in$\" | xargs rm -f\n- cp -r lib/date/include/date $BUILD/include/\n- mkdir $BUILD/include/MIPP\n- cp -r lib/MIPP/src/* $BUILD/include/MIPP/\n- mkdir $BUILD/include/dirent\n- cp lib/MSVC/include/dirent.h $BUILD/include/dirent/\n- mkdir $BUILD/include/rang\n- cp lib/rang/include/rang.hpp $BUILD/include/rang/\n-\n- mv $BUILD/include $BUILD/aff3ct-$GIT_VERSION\n- mkdir $BUILD/include\n- mv $BUILD/aff3ct-$GIT_VERSION $BUILD/include/\n-\n- # prepare conf and refs files\n- mkdir $BUILD/share\n- mkdir $BUILD/share/aff3ct-$GIT_VERSION\n- cp -r conf $BUILD/share/aff3ct-$GIT_VERSION/\n- cp -r refs $BUILD/share/aff3ct-$GIT_VERSION/\n- rm -rf $BUILD/share/aff3ct-$GIT_VERSION/conf/.git\n- rm -rf $BUILD/share/aff3ct-$GIT_VERSION/refs/.git\n- rm -rf $BUILD/share/aff3ct-$GIT_VERSION/refs/readers\n- mkdir $BUILD/share/aff3ct-$GIT_VERSION/doc\n- mkdir $BUILD/share/aff3ct-$GIT_VERSION/doc/strings\n- cp doc/sphinx/strings.rst $BUILD/share/aff3ct-$GIT_VERSION/doc/strings\n-\n- # prepare doc\n+ # add the documentation\nmkdir $BUILD/share/aff3ct-$GIT_VERSION/doc\ncp -r doc/sphinx/build/html $BUILD/share/aff3ct-$GIT_VERSION/doc/\nmkdir $BUILD/share/aff3ct-$GIT_VERSION/doc/pdf\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: use CMake install target to prepare the builds.
8,490
26.02.2019 17:20:19
-3,600
e21174a3d199caa54241f3adb5b2c6e1e7d33b29
Improve the CPack configuration.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -518,7 +518,8 @@ if (AFF3CT_COMPILE_SHARED_LIB OR AFF3CT_COMPILE_STATIC_LIB)\ninstall(EXPORT\naff3ct-config\nDESTINATION \"${CMAKE_INSTALL_LIBDIR}/cmake/aff3ct-${AFF3CT_VERSION_FULL}/\"\n- NAMESPACE aff3ct::)\n+ NAMESPACE aff3ct::\n+ COMPONENT library)\ninstall(FILES \"${CMAKE_BINARY_DIR}/lib/cmake/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct-config-version.cmake\"\nDESTINATION \"${CMAKE_INSTALL_LIBDIR}/cmake/aff3ct-${AFF3CT_VERSION_FULL}/\"\n@@ -578,7 +579,7 @@ install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/rang/include/\"\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/conf/cde/\")\ninstall(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/conf/\"\nDESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${AFF3CT_VERSION_FULL}/conf\n- COMPONENT configuration_files\n+ COMPONENT configuration\nFILES_MATCHING PATTERN \"*\"\nPATTERN \".git*\" EXCLUDE)\nendif()\n@@ -598,12 +599,45 @@ endif()\n# build a CPack driven installer package\ninclude(InstallRequiredSystemLibraries)\n-set(CPACK_PACKAGE_NAME \"AFF3CT\")\n+set(CPACK_RPM_COMPONENT_INSTALL ON)\n+set(CPACK_DEB_COMPONENT_INSTALL ON)\n+set(CPACK_PACKAGE_CONTACT \"Inria/IMS Bordeaux\")\n+set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)\n+set(CPACK_COMPONENTS_GROUPING \"ALL_COMPONENTS_IN_ONE\")\n+set(CPACK_PACKAGE_NAME \"aff3ct\")\nset(CPACK_PACKAGE_DESCRIPTION_SUMMARY \"AFF3CT - A Fast Forward Error Correction Toolbox!\")\nset(CPACK_RESOURCE_FILE_LICENSE \"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE\")\nset(CPACK_PACKAGE_VERSION \"${AFF3CT_VERSION}\")\nset(CPACK_PACKAGE_VERSION_MAJOR \"${AFF3CT_VERSION_MAJOR}\")\nset(CPACK_PACKAGE_VERSION_MINOR \"${AFF3CT_VERSION_MINOR}\")\nset(CPACK_PACKAGE_VERSION_PATCH \"${AFF3CT_VERSION_PATCH}\")\n-set(CPACK_COMPONENTS_ALL simulator library headers documentation configuration_files references)\n+set(CPACK_PACKAGE_INSTALL_DIRECTORY \"AFF3CT Component\")\n+set(CPACK_COMPONENTS_ALL simulator library headers documentation configuration references)\n+\n+set(CPACK_COMPONENT_SIMULATOR_DISPLAY_NAME \"Simulator\")\n+set(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME \"Library\")\n+set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME \"C++ Headers\")\n+set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME \"Documentation\")\n+set(CPACK_COMPONENT_CONFIGURATION_DISPLAY_NAME \"Configuration Files\")\n+set(CPACK_COMPONENT_REFERENCES_DISPLAY_NAME \"BER/FER References\")\n+\n+set(CPACK_COMPONENT_SIMULATOR_DESCRIPTION \"The AFF3CT standalone simulator application.\")\n+set(CPACK_COMPONENT_LIBRARY_DESCRIPTION \"The library containing all the AFF3CT toolbox features.\")\n+set(CPACK_COMPONENT_HEADERS_DESCRIPTION \"The C++ header files to use with the AFF3CT library.\")\n+set(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION \"The detailed documentation of the simulator and the library (html and PDF).\")\n+set(CPACK_COMPONENT_CONFIGURATION_DESCRIPTION \"Input files that can be used to configure the simulator or some library blocks.\")\n+set(CPACK_COMPONENT_REFERENCES_DESCRIPTION \"Many pre-simulated BER/FER reference curves.\")\n+\n+set(CPACK_COMPONENT_HEADERS_DEPENDS library)\n+set(CPACK_COMPONENT_SIMULATOR_DEPENDS configuration)\n+\n+set(CPACK_COMPONENT_SIMULATOR_GROUP \"Runtime\")\n+set(CPACK_COMPONENT_CONFIGURATION_GROUP \"Runtime\")\n+set(CPACK_COMPONENT_REFERENCES_GROUP \"Runtime\")\n+set(CPACK_COMPONENT_LIBRARY_GROUP \"Development\")\n+set(CPACK_COMPONENT_HEADERS_GROUP \"Development\")\n+\n+set(CPACK_COMPONENT_GROUP_RUNTIME_DESCRIPTION \"The AFF3CT simulator and related components.\")\n+set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION \"All of the tools you need to develop with the AFF3CT toolbox.\")\n+\ninclude(CPack)\n" } ]
C++
MIT License
aff3ct/aff3ct
Improve the CPack configuration.
8,490
27.02.2019 11:04:29
-3,600
92290930d0cf8600ad079298ab129e8bd2c16f6e
Add a description in CPack + add headers in install only if there is a library.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -524,23 +524,6 @@ if (AFF3CT_COMPILE_SHARED_LIB OR AFF3CT_COMPILE_STATIC_LIB)\ninstall(FILES \"${CMAKE_BINARY_DIR}/lib/cmake/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct-config-version.cmake\"\nDESTINATION \"${CMAKE_INSTALL_LIBDIR}/cmake/aff3ct-${AFF3CT_VERSION_FULL}/\"\nCOMPONENT library)\n-endif()\n-\n-if(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/latex/AFF3CT.pdf\")\n- install(FILES \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/latex/AFF3CT.pdf\"\n- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${AFF3CT_VERSION_FULL}/doc/pdf\n- COMPONENT documentation)\n-endif()\n-if(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/html/\")\n- install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/html/\"\n- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${AFF3CT_VERSION_FULL}/doc/html\n- COMPONENT documentation)\n-endif()\n-if(AFF3CT_EXT_STRINGS)\n- install(FILES \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/strings.rst\"\n- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${AFF3CT_VERSION_FULL}/doc/strings\n- COMPONENT documentation)\n-endif()\ninstall(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/src/\"\nDESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${AFF3CT_VERSION_FULL}/aff3ct\n@@ -575,6 +558,23 @@ install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/lib/rang/include/\"\nDESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${AFF3CT_VERSION_FULL}/rang\nCOMPONENT headers\nFILES_MATCHING PATTERN \"*.hpp\")\n+endif()\n+\n+if(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/latex/AFF3CT.pdf\")\n+ install(FILES \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/latex/AFF3CT.pdf\"\n+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${AFF3CT_VERSION_FULL}/doc/pdf\n+ COMPONENT documentation)\n+endif()\n+if(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/html/\")\n+ install(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/html/\"\n+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${AFF3CT_VERSION_FULL}/doc/html\n+ COMPONENT documentation)\n+endif()\n+if(AFF3CT_EXT_STRINGS)\n+ install(FILES \"${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/strings.rst\"\n+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/aff3ct-${AFF3CT_VERSION_FULL}/doc/strings\n+ COMPONENT documentation)\n+endif()\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/conf/cde/\")\ninstall(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/conf/\"\n@@ -599,21 +599,38 @@ endif()\n# build a CPack driven installer package\ninclude(InstallRequiredSystemLibraries)\n+\n+# general configuration and package description\nset(CPACK_RPM_COMPONENT_INSTALL ON)\nset(CPACK_DEB_COMPONENT_INSTALL ON)\n+SET(CPACK_DEBIAN_PACKAGE_MAINTAINER \"Adrien Cassagne <adrien.cassagne@inria.fr>\")\n+SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE \"http://aff3ct.github.io/\")\n+SET(CPACK_PACKAGE_VENDOR \"Inria/IMS Bordeaux\")\nset(CPACK_PACKAGE_CONTACT \"Inria/IMS Bordeaux\")\nset(CPACK_ARCHIVE_COMPONENT_INSTALL ON)\nset(CPACK_COMPONENTS_GROUPING \"ALL_COMPONENTS_IN_ONE\")\nset(CPACK_PACKAGE_NAME \"aff3ct\")\n-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY \"AFF3CT - A Fast Forward Error Correction Toolbox!\")\n+set(CPACK_PACKAGE_DESCRIPTION \"AFF3CT - A Fast Forward Error Correction Toolbox!\")\n+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY \"AFF3CT - A Fast Forward Error Correction Toolbox!\n+ AFF3CT is an open source software dedicated to Forward Error Correction\n+ (FEC or channel coding) simulations. It is written in C++ and it supports\n+ a broad range of codes: from the well-spread turbo codes and Low-Density\n+ Parity-Check (LDPC) codes to the more recent polar codes. A particular\n+ emphasis is given to simulation throughput performance (multiple Mb/s on\n+ modern CPUs). AFF3CT can also been used as a FEC library and all the blocks\n+ can be reused separately in various contexts.\")\n+set(CPACK_RESOURCE_FILE_README \"${CMAKE_CURRENT_SOURCE_DIR}/README.md\")\nset(CPACK_RESOURCE_FILE_LICENSE \"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE\")\nset(CPACK_PACKAGE_VERSION \"${AFF3CT_VERSION}\")\nset(CPACK_PACKAGE_VERSION_MAJOR \"${AFF3CT_VERSION_MAJOR}\")\nset(CPACK_PACKAGE_VERSION_MINOR \"${AFF3CT_VERSION_MINOR}\")\nset(CPACK_PACKAGE_VERSION_PATCH \"${AFF3CT_VERSION_PATCH}\")\nset(CPACK_PACKAGE_INSTALL_DIRECTORY \"AFF3CT Component\")\n+\n+# set the component to be included in the package\nset(CPACK_COMPONENTS_ALL simulator library headers documentation configuration references)\n+# rename the components to be displayed in the installer\nset(CPACK_COMPONENT_SIMULATOR_DISPLAY_NAME \"Simulator\")\nset(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME \"Library\")\nset(CPACK_COMPONENT_HEADERS_DISPLAY_NAME \"C++ Headers\")\n@@ -621,6 +638,7 @@ set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME \"Documentation\")\nset(CPACK_COMPONENT_CONFIGURATION_DISPLAY_NAME \"Configuration Files\")\nset(CPACK_COMPONENT_REFERENCES_DISPLAY_NAME \"BER/FER References\")\n+# add a description of the components\nset(CPACK_COMPONENT_SIMULATOR_DESCRIPTION \"The AFF3CT standalone simulator application.\")\nset(CPACK_COMPONENT_LIBRARY_DESCRIPTION \"The library containing all the AFF3CT toolbox features.\")\nset(CPACK_COMPONENT_HEADERS_DESCRIPTION \"The C++ header files to use with the AFF3CT library.\")\n@@ -628,15 +646,18 @@ set(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION \"The detailed documentation of the\nset(CPACK_COMPONENT_CONFIGURATION_DESCRIPTION \"Input files that can be used to configure the simulator or some library blocks.\")\nset(CPACK_COMPONENT_REFERENCES_DESCRIPTION \"Many pre-simulated BER/FER reference curves.\")\n+# add dependencies between the components\nset(CPACK_COMPONENT_HEADERS_DEPENDS library)\nset(CPACK_COMPONENT_SIMULATOR_DEPENDS configuration)\n+# group the components\nset(CPACK_COMPONENT_SIMULATOR_GROUP \"Runtime\")\nset(CPACK_COMPONENT_CONFIGURATION_GROUP \"Runtime\")\nset(CPACK_COMPONENT_REFERENCES_GROUP \"Runtime\")\nset(CPACK_COMPONENT_LIBRARY_GROUP \"Development\")\nset(CPACK_COMPONENT_HEADERS_GROUP \"Development\")\n+# add a description of the groups\nset(CPACK_COMPONENT_GROUP_RUNTIME_DESCRIPTION \"The AFF3CT simulator and related components.\")\nset(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION \"All of the tools you need to develop with the AFF3CT toolbox.\")\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a description in CPack + add headers in install only if there is a library.
8,490
27.02.2019 12:56:05
-3,600
cc63684f6f38b62e7809e10a01757c4f16d137e1
CI: enable shared library compilation on Windows.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -324,7 +324,7 @@ build-windows-gcc-x86-sse4.2:\nscript:\n- set \"CFLAGS=-Wall -funroll-loops -Wno-misleading-indentation -m32 -msse4.2\"\n- set \"LFLAGS=-static -static-libgcc -static-libstdc++\"\n- - set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n+ - set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- set \"NAME=build_windows_gcc_x86_sse4.2\"\n- call ./ci/tools/threads.bat\n- ./ci/build-windows-gcc.bat\n@@ -350,7 +350,7 @@ build-windows-gcc-x64-avx2:\nscript:\n- set \"CFLAGS=-Wall -funroll-loops -Wno-misleading-indentation -m64 -mavx2\"\n- set \"LFLAGS=-static -static-libgcc -static-libstdc++\"\n- - set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n+ - set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- set \"NAME=build_windows_gcc_x64_avx2\"\n- call ./ci/tools/threads.bat\n- ./ci/build-windows-gcc.bat\n@@ -374,7 +374,7 @@ build-windows-msvc-avx:\n- build_windows_msvc_avx\nscript:\n- set \"CFLAGS=-D_CRT_SECURE_NO_DEPRECATE /MT /EHsc /arch:AVX\"\n- - set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_PREC=MULTI\"\n+ - set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI\"\n- set \"NAME=build_windows_msvc_avx\"\n- call ./ci/tools/threads.bat\n- ./ci/build-windows-msvc.bat\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: enable shared library compilation on Windows.
8,490
27.02.2019 13:38:43
-3,600
bb663b4aa9f10d8304b2d1db3ee883905bc3408c
Fix CMake destination error on Windows shared library.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -502,11 +502,18 @@ if(AFF3CT_COMPILE_EXE)\nendif()\nendif()\nif(AFF3CT_COMPILE_SHARED_LIB)\n+ if(WIN32)\n+ install(TARGETS aff3ct-shared-lib\n+ EXPORT aff3ct-config\n+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/\n+ COMPONENT library)\n+ else()\ninstall(TARGETS aff3ct-shared-lib\nEXPORT aff3ct-config\nLIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/\nCOMPONENT library)\nendif()\n+endif()\nif(AFF3CT_COMPILE_STATIC_LIB)\ninstall(TARGETS aff3ct-static-lib\nEXPORT aff3ct-config\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix CMake destination error on Windows shared library.
8,490
27.02.2019 13:54:55
-3,600
3b63f65daf580d0246d9942023110909e486c2b9
Add a library destination to the Windows shared library.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -506,6 +506,7 @@ if(AFF3CT_COMPILE_SHARED_LIB)\ninstall(TARGETS aff3ct-shared-lib\nEXPORT aff3ct-config\nRUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/\n+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/\nCOMPONENT library)\nelse()\ninstall(TARGETS aff3ct-shared-lib\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a library destination to the Windows shared library.
8,490
28.02.2019 15:03:13
-3,600
9cf70db1230de2d4fcc9ff15e2b710b25faeabba
Add .deb dependencies.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -608,11 +608,26 @@ endif()\n# build a CPack driven installer package\ninclude(InstallRequiredSystemLibraries)\n+find_program(DPKG_CMD dpkg)\n+if(NOT \"${DPKG_CMD}\" STREQUAL \"DPKG_CMD-NOTFOUND\")\n+ execute_process(COMMAND \"${DPKG_CMD}\" --print-architecture\n+ OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE\n+ OUTPUT_STRIP_TRAILING_WHITESPACE)\n+ set(CPACK_PACKAGE_FILE_NAME \"aff3ct-${AFF3CT_VERSION_FULL}-${CMAKE_SYSTEM_NAME}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}\")\n+endif()\n+\n# general configuration and package description\nset(CPACK_RPM_COMPONENT_INSTALL ON)\nset(CPACK_DEB_COMPONENT_INSTALL ON)\nset(CPACK_DEBIAN_PACKAGE_MAINTAINER \"Adrien Cassagne <adrien.cassagne@inria.fr>\")\nset(CPACK_DEBIAN_PACKAGE_HOMEPAGE \"http://aff3ct.github.io/\")\n+set(CPACK_DEBIAN_PACKAGE_DEPENDS \"libc6, libgcc1, libstdc++6\")\n+if (AFF3CT_LINK_GSL)\n+ string(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS \", libgsl2\")\n+endif()\n+if (AFF3CT_MPI)\n+ string(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS \", libopenmpi1.10\")\n+endif()\nset(CPACK_PACKAGE_VENDOR \"Inria/IMS Bordeaux\")\nset(CPACK_PACKAGE_CONTACT \"Inria/IMS Bordeaux\")\nset(CPACK_ARCHIVE_COMPONENT_INSTALL ON)\n@@ -620,13 +635,13 @@ set(CPACK_COMPONENTS_GROUPING \"ALL_COMPONENTS_IN_ONE\")\nset(CPACK_PACKAGE_NAME \"aff3ct\")\nset(CPACK_PACKAGE_DESCRIPTION \"AFF3CT - A Fast Forward Error Correction Toolbox!\")\nset(CPACK_PACKAGE_DESCRIPTION_SUMMARY \"AFF3CT - A Fast Forward Error Correction Toolbox!\n- AFF3CT is an open source software dedicated to Forward Error Correction\n- (FEC or channel coding) simulations. It is written in C++ and it supports\n- a broad range of codes: from the well-spread turbo codes and Low-Density\n- Parity-Check (LDPC) codes to the more recent polar codes. A particular\n- emphasis is given to simulation throughput performance (multiple Mb/s on\n- modern CPUs). AFF3CT can also been used as a FEC library and all the blocks\n- can be reused separately in various contexts.\")\n+ AFF3CT is an open source software dedicated to Forward Error Correction (FEC or\n+ channel coding) simulations. It is written in C++ and it supports a broad range\n+ of codes: from the well-spread turbo codes and Low-Density Parity-Check (LDPC)\n+ codes to the more recent polar codes. A particular emphasis is given to\n+ simulation throughput performance (multiple Mb/s on modern CPUs). AFF3CT can\n+ also been used as a FEC library and all the blocks can be reused separately in\n+ various contexts.\")\nset(CPACK_RESOURCE_FILE_README \"${CMAKE_CURRENT_SOURCE_DIR}/README.md\")\nset(CPACK_RESOURCE_FILE_LICENSE \"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE\")\nset(CPACK_PACKAGE_VERSION \"${AFF3CT_VERSION}\")\n" } ]
C++
MIT License
aff3ct/aff3ct
Add .deb dependencies.
8,490
28.02.2019 15:10:22
-3,600
0906345c0db80f8f68d4e12faf53fe4095a755de
Add custom package names.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -614,7 +614,10 @@ if(NOT \"${DPKG_CMD}\" STREQUAL \"DPKG_CMD-NOTFOUND\")\nOUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE\nOUTPUT_STRIP_TRAILING_WHITESPACE)\nset(CPACK_PACKAGE_FILE_NAME \"aff3ct-${AFF3CT_VERSION_FULL}-${CMAKE_SYSTEM_NAME}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}\")\n+else()\n+ set(CPACK_PACKAGE_FILE_NAME \"aff3ct-${AFF3CT_VERSION_FULL}-${CMAKE_SYSTEM_NAME}\")\nendif()\n+set(CPACK_SOURCE_PACKAGE_FILE_NAME \"aff3ct-${AFF3CT_VERSION_FULL}\")\n# general configuration and package description\nset(CPACK_RPM_COMPONENT_INSTALL ON)\n" } ]
C++
MIT License
aff3ct/aff3ct
Add custom package names.
8,490
28.02.2019 21:32:21
-3,600
a1c52880abe703871280fcbe55423f226a76c622
Break link dependencies with GSL and MKL libraries.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/Event_generator/GSL/Event_generator_GSL.cpp", "new_path": "src/Tools/Algo/Draw_generator/Event_generator/GSL/Event_generator_GSL.cpp", "diff": "#ifdef AFF3CT_CHANNEL_GSL\n+#include <gsl/gsl_rng.h>\n+#include <gsl/gsl_randist.h>\n+\n#include \"Tools/Exception/exception.hpp\"\n#include \"Event_generator_GSL.hpp\"\n@@ -10,16 +13,23 @@ using namespace aff3ct::tools;\ntemplate <typename R, typename E>\nEvent_generator_GSL<R,E>\n::Event_generator_GSL(const int seed)\n-: Event_generator<R,E>(), rng(gsl_rng_alloc(gsl_rng_mt19937), gsl_rng_free)\n+: Event_generator<R,E>(), rng((void*)gsl_rng_alloc(gsl_rng_mt19937))\n{\nthis->set_seed(seed);\n}\n+template <typename R, typename E>\n+Event_generator_GSL<R,E>\n+::~Event_generator_GSL()\n+{\n+ gsl_rng_free((gsl_rng*)rng);\n+}\n+\ntemplate <typename R, typename E>\nvoid Event_generator_GSL<R,E>\n::set_seed(const int seed)\n{\n- gsl_rng_set(rng.get(), seed);\n+ gsl_rng_set((gsl_rng*)rng, seed);\n}\ntemplate <typename R, typename E>\n@@ -27,7 +37,7 @@ void Event_generator_GSL<R,E>\n::generate(E *draw, const unsigned length, const R event_probability)\n{\nfor (unsigned i = 0; i < length; i++)\n- draw[i] = (E)gsl_ran_bernoulli(rng.get(), (double)event_probability);\n+ draw[i] = (E)gsl_ran_bernoulli((gsl_rng*)rng, (double)event_probability);\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/Event_generator/GSL/Event_generator_GSL.hpp", "new_path": "src/Tools/Algo/Draw_generator/Event_generator/GSL/Event_generator_GSL.hpp", "diff": "#ifndef EVENT_GENERATOR_GSL_HPP\n#define EVENT_GENERATOR_GSL_HPP\n-#include <gsl/gsl_randist.h>\n-#include <gsl/gsl_rng.h>\n-#include <memory>\n-\n#include \"../Event_generator.hpp\"\nnamespace aff3ct\n@@ -18,12 +14,12 @@ template <typename R = float, typename E = typename tools::matching_types<R>::B>\nclass Event_generator_GSL : public Event_generator<R,E>\n{\nprivate:\n- std::unique_ptr<gsl_rng,decltype(&gsl_rng_free)> rng;\n+ void* rng; // gsl_rng* type\npublic:\nexplicit Event_generator_GSL(const int seed = 0);\n- virtual ~Event_generator_GSL() = default;\n+ virtual ~Event_generator_GSL();\nvirtual void set_seed(const int seed);\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/Event_generator/MKL/Event_generator_MKL.cpp", "new_path": "src/Tools/Algo/Draw_generator/Event_generator/MKL/Event_generator_MKL.cpp", "diff": "#ifdef AFF3CT_CHANNEL_MKL\n+#include <mkl_vsl.h>\n+\n#include \"Tools/Exception/exception.hpp\"\n#include \"Event_generator_MKL.hpp\"\n@@ -10,7 +12,7 @@ using namespace aff3ct::tools;\ntemplate <typename R, typename E>\nEvent_generator_MKL<R,E>\n::Event_generator_MKL(const int seed)\n-: Event_generator<R,E>(), stream_state(nullptr), is_stream_alloc(false)\n+: Event_generator<R,E>(), stream_state((void*)new VSLStreamStatePtr), is_stream_alloc(false)\n{\nthis->set_seed(seed);\n}\n@@ -20,17 +22,18 @@ Event_generator_MKL<R,E>\n::~Event_generator_MKL()\n{\nif (is_stream_alloc)\n- vslDeleteStream(&stream_state);\n+ vslDeleteStream((VSLStreamStatePtr*)stream_state);\n+ delete (VSLStreamStatePtr*)stream_state;\n}\ntemplate <typename R, typename E>\nvoid Event_generator_MKL<R,E>\n::set_seed(const int seed)\n{\n- if (is_stream_alloc) vslDeleteStream(&stream_state);\n+ if (is_stream_alloc) vslDeleteStream((VSLStreamStatePtr*)stream_state);\n- //vslNewStream(&stream_state, VSL_BRNG_MT2203, seed);\n- vslNewStream(&stream_state, VSL_BRNG_SFMT19937, seed);\n+ //vslNewStream((VSLStreamStatePtr*)stream_state, VSL_BRNG_MT2203, seed);\n+ vslNewStream((VSLStreamStatePtr*)stream_state, VSL_BRNG_SFMT19937, seed);\nis_stream_alloc = true;\n}\n@@ -50,7 +53,7 @@ template <>\nvoid Event_generator_MKL<R_32,B_32>\n::generate(B_32 *draw, const unsigned length, const R_32 event_probability)\n{\n- viRngBernoulli(VSL_RNG_METHOD_BERNOULLI_ICDF, stream_state, length, draw, event_probability);\n+ viRngBernoulli(VSL_RNG_METHOD_BERNOULLI_ICDF, *(VSLStreamStatePtr*)stream_state, length, draw, event_probability);\n}\ntemplate <>\n@@ -58,7 +61,8 @@ void Event_generator_MKL<R_64,B_64>\n::generate(B_64 *draw, const unsigned length, const R_64 event_probability)\n{\nstd::vector<int> draw_i(length);\n- viRngBernoulli(VSL_RNG_METHOD_BERNOULLI_ICDF, stream_state, length, draw_i.data(), event_probability);\n+ viRngBernoulli(VSL_RNG_METHOD_BERNOULLI_ICDF, *(VSLStreamStatePtr*)stream_state, length, draw_i.data(),\n+ event_probability);\nstd::copy(draw_i.begin(), draw_i.end(), draw);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/Event_generator/MKL/Event_generator_MKL.hpp", "new_path": "src/Tools/Algo/Draw_generator/Event_generator/MKL/Event_generator_MKL.hpp", "diff": "#ifndef EVENT_GENERATOR_MKL_HPP\n#define EVENT_GENERATOR_MKL_HPP\n-#include <mkl_vsl.h>\n-\n#include \"../Event_generator.hpp\"\nnamespace aff3ct\n{\nnamespace tools\n{\n-\ntemplate <typename R = float, typename E = typename tools::matching_types<R>::B>\nclass Event_generator_MKL : public Event_generator<R,E>\n{\nprivate:\n- VSLStreamStatePtr stream_state;\n+ void* stream_state; // VSLStreamStatePtr* type\nbool is_stream_alloc;\npublic:\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/Gaussian_noise_generator/GSL/Gaussian_noise_generator_GSL.cpp", "new_path": "src/Tools/Algo/Draw_generator/Gaussian_noise_generator/GSL/Gaussian_noise_generator_GSL.cpp", "diff": "#ifdef AFF3CT_CHANNEL_GSL\n+#include <gsl/gsl_rng.h>\n+#include <gsl/gsl_randist.h>\n+\n#include \"Tools/Exception/exception.hpp\"\n#include \"Gaussian_noise_generator_GSL.hpp\"\n@@ -9,8 +12,7 @@ using namespace aff3ct::tools;\ntemplate <typename R>\nGaussian_noise_generator_GSL<R>\n::Gaussian_noise_generator_GSL(const int seed)\n-: Gaussian_noise_generator<R>(),\n- rng(gsl_rng_alloc(gsl_rng_mt19937), gsl_rng_free)\n+: Gaussian_noise_generator<R>(), rng((void*)gsl_rng_alloc(gsl_rng_mt19937))\n{\nif (rng == nullptr)\nthrow runtime_error(__FILE__, __LINE__, __func__, \"'rng' can't be null.\");\n@@ -18,11 +20,18 @@ Gaussian_noise_generator_GSL<R>\nthis->set_seed(seed);\n}\n+template <typename R>\n+Gaussian_noise_generator_GSL<R>\n+::~Gaussian_noise_generator_GSL()\n+{\n+ gsl_rng_free((gsl_rng*)rng);\n+}\n+\ntemplate <typename R>\nvoid Gaussian_noise_generator_GSL<R>\n::set_seed(const int seed)\n{\n- gsl_rng_set(rng.get(), seed);\n+ gsl_rng_set((gsl_rng*)rng, seed);\n}\ntemplate <typename R>\n@@ -30,7 +39,7 @@ void Gaussian_noise_generator_GSL<R>\n::generate(R *noise, const unsigned length, const R sigma, const R mu)\n{\nfor (unsigned i = 0; i < length; i++)\n- noise[i] = (R)gsl_ran_gaussian_ziggurat(rng.get(), sigma) + mu;\n+ noise[i] = (R)gsl_ran_gaussian_ziggurat((gsl_rng*)rng, sigma) + mu;\n}\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/Gaussian_noise_generator/GSL/Gaussian_noise_generator_GSL.hpp", "new_path": "src/Tools/Algo/Draw_generator/Gaussian_noise_generator/GSL/Gaussian_noise_generator_GSL.hpp", "diff": "#ifndef GAUSSIAN_NOISE_GENERATOR_GSL_HPP_\n#define GAUSSIAN_NOISE_GENERATOR_GSL_HPP_\n-#include <gsl/gsl_randist.h>\n-#include <gsl/gsl_rng.h>\n-#include <memory>\n-\n#include \"../Gaussian_noise_generator.hpp\"\nnamespace aff3ct\n@@ -17,11 +13,11 @@ template <typename R = float>\nclass Gaussian_noise_generator_GSL : public Gaussian_noise_generator<R>\n{\nprivate:\n- std::unique_ptr<gsl_rng,decltype(&gsl_rng_free)> rng;\n+ void* rng; // gsl_rng* type\npublic:\nexplicit Gaussian_noise_generator_GSL(const int seed = 0);\n- virtual ~Gaussian_noise_generator_GSL() = default;\n+ virtual ~Gaussian_noise_generator_GSL();\nvirtual void set_seed(const int seed);\nvirtual void generate(R *noise, const unsigned length, const R sigma, const R mu = 0.0);\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/Gaussian_noise_generator/MKL/Gaussian_noise_generator_MKL.cpp", "new_path": "src/Tools/Algo/Draw_generator/Gaussian_noise_generator/MKL/Gaussian_noise_generator_MKL.cpp", "diff": "#ifdef AFF3CT_CHANNEL_MKL\n+#include <mkl_vsl.h>\n+\n#include \"Tools/Exception/exception.hpp\"\n#include \"Gaussian_noise_generator_MKL.hpp\"\n@@ -9,7 +11,7 @@ using namespace aff3ct::tools;\ntemplate <typename R>\nGaussian_noise_generator_MKL<R>\n::Gaussian_noise_generator_MKL(const int seed)\n-: Gaussian_noise_generator<R>(), stream_state(nullptr), is_stream_alloc(false)\n+: Gaussian_noise_generator<R>(), stream_state((void*)new VSLStreamStatePtr), is_stream_alloc(false)\n{\nthis->set_seed(seed);\n}\n@@ -19,17 +21,18 @@ Gaussian_noise_generator_MKL<R>\n::~Gaussian_noise_generator_MKL()\n{\nif (is_stream_alloc)\n- vslDeleteStream(&stream_state);\n+ vslDeleteStream((VSLStreamStatePtr*)stream_state);\n+ delete (VSLStreamStatePtr*)stream_state;\n}\ntemplate <typename R>\nvoid Gaussian_noise_generator_MKL<R>\n::set_seed(const int seed)\n{\n- if (is_stream_alloc) vslDeleteStream(&stream_state);\n+ if (is_stream_alloc) vslDeleteStream((VSLStreamStatePtr*)stream_state);\n- //vslNewStream(&stream_state, VSL_BRNG_MT2203, seed);\n- vslNewStream(&stream_state, VSL_BRNG_SFMT19937, seed);\n+ //vslNewStream((VSLStreamStatePtr*)stream_state, VSL_BRNG_MT2203, seed);\n+ vslNewStream((VSLStreamStatePtr*)stream_state, VSL_BRNG_SFMT19937, seed);\nis_stream_alloc = true;\n}\n@@ -50,14 +53,14 @@ void Gaussian_noise_generator_MKL<float>\n::generate(float *noise, const unsigned length, const float sigma, const float mu)\n{\nvsRngGaussian(VSL_RNG_METHOD_GAUSSIAN_BOXMULLER2,\n- stream_state,\n+ *(VSLStreamStatePtr*)stream_state,\nlength,\nnoise,\nmu,\nsigma);\n/*\nvsRngGaussian(VSL_RNG_METHOD_GAUSSIAN_ICDF,\n- stream_state,\n+ *(VSLStreamStatePtr*)stream_state,\nlength,\nnoise,\nmu,\n@@ -76,14 +79,14 @@ void Gaussian_noise_generator_MKL<double>\n::generate(double *noise, const unsigned length, const double sigma, const double mu)\n{\nvdRngGaussian(VSL_RNG_METHOD_GAUSSIAN_BOXMULLER2,\n- stream_state,\n+ *(VSLStreamStatePtr*)stream_state,\nlength,\nnoise,\nmu,\nsigma);\n/*\nvdRngGaussian(VSL_RNG_METHOD_GAUSSIAN_ICDF,\n- stream_state,\n+ *(VSLStreamStatePtr*)stream_state,\nlength,\nnoise,\nmu,\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/Gaussian_noise_generator/MKL/Gaussian_noise_generator_MKL.hpp", "new_path": "src/Tools/Algo/Draw_generator/Gaussian_noise_generator/MKL/Gaussian_noise_generator_MKL.hpp", "diff": "#ifndef GAUSSIAN_NOISE_GENERATOR_MKL_HPP_\n#define GAUSSIAN_NOISE_GENERATOR_MKL_HPP_\n-#include <mkl_vsl.h>\n-\n#include \"../Gaussian_noise_generator.hpp\"\nnamespace aff3ct\n@@ -15,7 +13,7 @@ template <typename R = float>\nclass Gaussian_noise_generator_MKL : public Gaussian_noise_generator<R>\n{\nprivate:\n- VSLStreamStatePtr stream_state;\n+ void* stream_state; // VSLStreamStatePtr* type\nbool is_stream_alloc;\npublic:\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/GSL/User_pdf_noise_generator_GSL.cpp", "new_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/GSL/User_pdf_noise_generator_GSL.cpp", "diff": "#ifdef AFF3CT_CHANNEL_GSL\n#include <sstream>\n+#include <gsl/gsl_rng.h>\n+#include <gsl/gsl_randist.h>\n#include \"Tools/Exception/exception.hpp\"\n#include \"User_pdf_noise_generator_GSL.hpp\"\n@@ -11,7 +13,7 @@ using namespace aff3ct::tools;\ntemplate <typename R>\nUser_pdf_noise_generator_GSL<R>\n::User_pdf_noise_generator_GSL(const tools::Distributions<R>& dists, const int seed, Interpolation_type inter_type)\n-: User_pdf_noise_generator<R>(dists), rng(gsl_rng_alloc(gsl_rng_mt19937), gsl_rng_free), interp_function(nullptr)\n+: User_pdf_noise_generator<R>(dists), rng((void*)gsl_rng_alloc(gsl_rng_mt19937)), interp_function(nullptr)\n{\nthis->set_seed(seed);\n@@ -27,11 +29,18 @@ User_pdf_noise_generator_GSL<R>\n}\n}\n+template <typename R>\n+User_pdf_noise_generator_GSL<R>\n+::~User_pdf_noise_generator_GSL()\n+{\n+ gsl_rng_free((gsl_rng*)rng);\n+}\n+\ntemplate <typename R>\nvoid User_pdf_noise_generator_GSL<R>\n::set_seed(const int seed)\n{\n- gsl_rng_set(rng.get(), seed);\n+ gsl_rng_set((gsl_rng*)rng, seed);\n}\ntemplate <typename R>\n@@ -44,7 +53,7 @@ void User_pdf_noise_generator_GSL<R>\n{\nconst auto& cdf_y = signal[i] ? dis.get_cdf_y()[1] : dis.get_cdf_y()[0];\nconst auto& cdf_x = signal[i] ? dis.get_cdf_x()[1] : dis.get_cdf_x()[0];\n- const auto uni_draw = gsl_ran_flat(rng.get(), (R)0, (R)1);\n+ const auto uni_draw = gsl_ran_flat((gsl_rng*)rng, (R)0, (R)1);\ndraw[i] = interp_function(cdf_y.data(), cdf_x.data(), cdf_x.size(), uni_draw);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/GSL/User_pdf_noise_generator_GSL.hpp", "new_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/GSL/User_pdf_noise_generator_GSL.hpp", "diff": "#ifndef User_pdf_noise_generator_GSL_HPP_\n#define User_pdf_noise_generator_GSL_HPP_\n-#include <gsl/gsl_randist.h>\n-#include <gsl/gsl_rng.h>\n-#include <memory>\n-\n#include \"Tools/Math/interpolation.h\"\n#include \"../User_pdf_noise_generator.hpp\"\n@@ -20,13 +16,13 @@ template <typename R = float>\nclass User_pdf_noise_generator_GSL : public User_pdf_noise_generator<R>\n{\nprivate:\n- std::unique_ptr<gsl_rng,decltype(&gsl_rng_free)> rng;\n+ void* rng; // gsl_rng* type\nR (*interp_function)(const R*, const R*, const unsigned, const R);\npublic:\nexplicit User_pdf_noise_generator_GSL(const tools::Distributions<R>& dists, const int seed = 0, Interpolation_type inter_type = Interpolation_type::NEAREST);\n- virtual ~User_pdf_noise_generator_GSL() = default;\n+ virtual ~User_pdf_noise_generator_GSL();\nvirtual void set_seed(const int seed);\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/MKL/User_pdf_noise_generator_MKL.cpp", "new_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/MKL/User_pdf_noise_generator_MKL.cpp", "diff": "#ifdef AFF3CT_CHANNEL_MKL\n+#include <mkl_vsl.h>\n#include <sstream>\n#include \"Tools/Exception/exception.hpp\"\n@@ -11,7 +12,10 @@ using namespace aff3ct::tools;\ntemplate <typename R>\nUser_pdf_noise_generator_MKL<R>\n::User_pdf_noise_generator_MKL(const tools::Distributions<R>& dists, const int seed, Interpolation_type inter_type)\n-: User_pdf_noise_generator<R>(dists), stream_state(nullptr), is_stream_alloc(false), interp_function(nullptr)\n+: User_pdf_noise_generator<R>(dists),\n+ stream_state((void*)new VSLStreamStatePtr),\n+ is_stream_alloc(false),\n+ interp_function(nullptr)\n{\nthis->set_seed(seed);\n@@ -27,14 +31,23 @@ User_pdf_noise_generator_MKL<R>\n}\n}\n+template <typename R>\n+User_pdf_noise_generator_MKL<R>\n+::~User_pdf_noise_generator_MKL()\n+{\n+ if (is_stream_alloc)\n+ vslDeleteStream((VSLStreamStatePtr*)stream_state);\n+ delete (VSLStreamStatePtr*)stream_state;\n+}\n+\ntemplate <typename R>\nvoid User_pdf_noise_generator_MKL<R>\n::set_seed(const int seed)\n{\n- if (is_stream_alloc) vslDeleteStream(&stream_state);\n+ if (is_stream_alloc) vslDeleteStream((VSLStreamStatePtr*)stream_state);\n- //vslNewStream(&stream_state, VSL_BRNG_MT2203, seed);\n- vslNewStream(&stream_state, VSL_BRNG_SFMT19937, seed);\n+ //vslNewStream((VSLStreamStatePtr*)stream_state, VSL_BRNG_MT2203, seed);\n+ vslNewStream((VSLStreamStatePtr*)stream_state, VSL_BRNG_SFMT19937, seed);\nis_stream_alloc = true;\n}\n@@ -45,7 +58,7 @@ void User_pdf_noise_generator_MKL<R>\n{\nauto dis = this->distributions.get_distribution(noise_power);\n- vsRngUniform(VSL_RNG_METHOD_UNIFORM_STD, stream_state, length, draw, (R)0, (R)1);\n+ vsRngUniform(VSL_RNG_METHOD_UNIFORM_STD, *(VSLStreamStatePtr*)stream_state, length, draw, (R)0, (R)1);\nfor (unsigned i = 0; i < length; i++)\n@@ -69,7 +82,7 @@ void User_pdf_noise_generator_MKL<double>\n{\nauto dis = this->distributions.get_distribution(noise_power);\n- vdRngUniform(VSL_RNG_METHOD_UNIFORM_STD, stream_state, length, draw, (double)0, (double)1);\n+ vdRngUniform(VSL_RNG_METHOD_UNIFORM_STD, *(VSLStreamStatePtr*)stream_state, length, draw, (double)0, (double)1);\nfor (unsigned i = 0; i < length; i++)\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/MKL/User_pdf_noise_generator_MKL.hpp", "new_path": "src/Tools/Algo/Draw_generator/User_pdf_noise_generator/MKL/User_pdf_noise_generator_MKL.hpp", "diff": "#ifndef User_pdf_noise_generator_MKL_HPP_\n#define User_pdf_noise_generator_MKL_HPP_\n-#include <mkl_vsl.h>\n-\n#include \"Tools/Math/interpolation.h\"\n#include \"../User_pdf_noise_generator.hpp\"\n@@ -18,14 +16,14 @@ template <typename R = float>\nclass User_pdf_noise_generator_MKL : public User_pdf_noise_generator<R>\n{\nprivate:\n- VSLStreamStatePtr stream_state;\n+ void* stream_state;\nbool is_stream_alloc;\nR (*interp_function)(const R*, const R*, const unsigned, const R);\npublic:\nexplicit User_pdf_noise_generator_MKL(const tools::Distributions<R>& dists, const int seed = 0, Interpolation_type inter_type = Interpolation_type::NEAREST);\n- virtual ~User_pdf_noise_generator_MKL() = default;\n+ virtual ~User_pdf_noise_generator_MKL();\nvirtual void set_seed(const int seed);\n" } ]
C++
MIT License
aff3ct/aff3ct
Break link dependencies with GSL and MKL libraries.
8,490
28.02.2019 21:33:30
-3,600
c92848c928d63704df78ce63355078bcdec73dd5
Improve macros genericity.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -212,24 +212,24 @@ endif(AFF3CT_COMPILE_STATIC_LIB)\n# ------------------------------------------------------------------------------------------------ COMPILER DEFINITIONS\n# ---------------------------------------------------------------------------------------------------------------------\n-macro(aff3ct_target_compile_definitions def)\n- target_compile_definitions(aff3ct-obj PUBLIC $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\n+macro(aff3ct_target_compile_definitions privacy def)\n+ target_compile_definitions(aff3ct-obj ${privacy} $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\nif(AFF3CT_COMPILE_EXE)\n- target_compile_definitions(aff3ct-bin PUBLIC $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\n+ target_compile_definitions(aff3ct-bin ${privacy} $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\nendif()\nif(AFF3CT_COMPILE_SHARED_LIB)\n- target_compile_definitions(aff3ct-shared-lib PUBLIC $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\n+ target_compile_definitions(aff3ct-shared-lib ${privacy} $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\nendif()\nif(AFF3CT_COMPILE_STATIC_LIB)\n- target_compile_definitions(aff3ct-static-lib PUBLIC $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\n+ target_compile_definitions(aff3ct-static-lib ${privacy} $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\nendif()\nendmacro()\n# by system\nif(WIN32) # for Windows operating system in general\nset(WINDOWS_VISTA 0x0600)\n- aff3ct_target_compile_definitions(_WIN32_WINNT=${WINDOWS_VISTA})\n- aff3ct_target_compile_definitions(NOMINMAX)\n+ aff3ct_target_compile_definitions(PUBLIC _WIN32_WINNT=${WINDOWS_VISTA})\n+ aff3ct_target_compile_definitions(PUBLIC NOMINMAX)\nmessage(STATUS \"AFF3CT - System: Windows\")\nelseif(APPLE) # for macOS\nmessage(STATUS \"AFF3CT - System: macOS\")\n@@ -239,50 +239,50 @@ endif()\n# common\nif(AFF3CT_POLAR_BIT_PACKING)\n- aff3ct_target_compile_definitions(AFF3CT_POLAR_BIT_PACKING)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_POLAR_BIT_PACKING)\nmessage(STATUS \"AFF3CT - Polar bit packing: on\")\nelse()\nmessage(STATUS \"AFF3CT - Polar bit packing: off\")\nendif()\nif(AFF3CT_POLAR_BOUNDS)\n- aff3ct_target_compile_definitions(AFF3CT_POLAR_BOUNDS)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_POLAR_BOUNDS)\nmessage(STATUS \"AFF3CT - Polar bounds: on\")\nelse()\nmessage(STATUS \"AFF3CT - Polar bounds: off\")\nendif()\nif(AFF3CT_COLORS)\n- aff3ct_target_compile_definitions(AFF3CT_COLORS)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_COLORS)\nmessage(STATUS \"AFF3CT - Terminal colors: on\")\nelse()\nmessage(STATUS \"AFF3CT - Terminal colors: off\")\nendif()\nif(AFF3CT_BACKTRACE)\n- aff3ct_target_compile_definitions(AFF3CT_BACKTRACE)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_BACKTRACE)\nmessage(STATUS \"AFF3CT - Backtrace: on\")\nelse()\nmessage(STATUS \"AFF3CT - Backtrace: off\")\nendif()\nif(AFF3CT_EXT_STRINGS)\n- aff3ct_target_compile_definitions(AFF3CT_EXT_STRINGS)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_EXT_STRINGS)\nmessage(STATUS \"AFF3CT - External strings: on\")\nelse()\nmessage(STATUS \"AFF3CT - External strings: off\")\nendif()\nif(AFF3CT_PREC STREQUAL \"8\")\n- aff3ct_target_compile_definitions(AFF3CT_8BIT_PREC)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_8BIT_PREC)\nmessage(STATUS \"AFF3CT - Precision: 8-bit\")\nelseif(AFF3CT_PREC STREQUAL \"16\")\n- aff3ct_target_compile_definitions(AFF3CT_16BIT_PREC)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_16BIT_PREC)\nmessage(STATUS \"AFF3CT - Precision: 16-bit\")\nelseif(AFF3CT_PREC STREQUAL \"32\")\n- aff3ct_target_compile_definitions(AFF3CT_32BIT_PREC)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_32BIT_PREC)\nmessage(STATUS \"AFF3CT - Precision: 32-bit\")\nelseif(AFF3CT_PREC STREQUAL \"64\")\n- aff3ct_target_compile_definitions(AFF3CT_64BIT_PREC)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_64BIT_PREC)\nmessage(STATUS \"AFF3CT - Precision: 64-bit\")\nelseif(AFF3CT_PREC STREQUAL \"MULTI\")\n- aff3ct_target_compile_definitions(AFF3CT_MULTI_PREC)\n+ aff3ct_target_compile_definitions(PUBLIC AFF3CT_MULTI_PREC)\nmessage(STATUS \"AFF3CT - Precision: 8/16/32/64-bit\")\nelse()\nmessage(FATAL_ERROR \"AFF3CT_PREC='${AFF3CT_PREC}' and should be '8', '16', '32', '64' or 'MULTI'.\")\n@@ -292,39 +292,39 @@ endif()\n# ----------------------------------------------------------------------------------------------- HEADER ONLY LIBRARIES\n# ---------------------------------------------------------------------------------------------------------------------\n-macro(aff3ct_target_include_directories dir_build dir_install)\n- target_include_directories(aff3ct-obj PUBLIC\n+macro(aff3ct_target_include_directories privacy dir_build dir_install)\n+ target_include_directories(aff3ct-obj ${privacy}\n$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${dir_build}/>\n$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${AFF3CT_VERSION_FULL}/${dir_install}>)\nif(AFF3CT_COMPILE_EXE)\n- target_include_directories(aff3ct-bin PUBLIC\n+ target_include_directories(aff3ct-bin ${privacy}\n$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${dir_build}/>\n$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${AFF3CT_VERSION_FULL}/${dir_install}>)\nendif()\nif(AFF3CT_COMPILE_SHARED_LIB)\n- target_include_directories(aff3ct-shared-lib PUBLIC\n+ target_include_directories(aff3ct-shared-lib ${privacy}\n$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${dir_build}/>\n$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${AFF3CT_VERSION_FULL}/${dir_install}>)\nendif()\nif(AFF3CT_COMPILE_STATIC_LIB)\n- target_include_directories(aff3ct-static-lib PUBLIC\n+ target_include_directories(aff3ct-static-lib ${privacy}\n$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${dir_build}/>\n$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${AFF3CT_VERSION_FULL}/${dir_install}>)\nendif()\nendmacro()\n# AFF3CT headers\n-aff3ct_target_include_directories(\"src\" \"aff3ct\")\n+aff3ct_target_include_directories(PUBLIC \"src\" \"aff3ct\")\n# MSVC dirent.h\nif(MSVC)\n- aff3ct_target_include_directories(\"lib/MSVC/include\" \"dirent\")\n+ aff3ct_target_include_directories(PUBLIC \"lib/MSVC/include\" \"dirent\")\nendif()\n# MIPP\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/lib/MIPP/src/mipp.h\")\n- aff3ct_target_compile_definitions(MIPP_ENABLE_BACKTRACE)\n- aff3ct_target_include_directories(\"lib/MIPP/src\" \"MIPP\")\n+ aff3ct_target_compile_definitions(PUBLIC MIPP_ENABLE_BACKTRACE)\n+ aff3ct_target_include_directories(PUBLIC \"lib/MIPP/src\" \"MIPP\")\nmessage(STATUS \"AFF3CT - Header found: MIPP\")\nelse()\nmessage(FATAL_ERROR \"AFF3CT - MIPP can't be found, try to init the submodule with the following cmd:\\n\"\n@@ -333,7 +333,7 @@ endif()\n# rang\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/lib/rang/include/rang.hpp\")\n- aff3ct_target_include_directories(\"lib/rang/include\" \"rang\")\n+ aff3ct_target_include_directories(PUBLIC \"lib/rang/include\" \"rang\")\nmessage(STATUS \"AFF3CT - Header found: rang\")\nelse()\nmessage(FATAL_ERROR \"AFF3CT - rang can't be found, try to init the submodule with the following cmd:\\n\"\n@@ -342,7 +342,7 @@ endif()\n# date\nif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/lib/date/include/date/date.h\")\n- aff3ct_target_include_directories(\"lib/date/include/date\" \"date\")\n+ aff3ct_target_include_directories(PUBLIC \"lib/date/include/date\" \"date\")\nmessage(STATUS \"AFF3CT - Header found: date\")\nelse()\nmessage(FATAL_ERROR \"AFF3CT - date can't be found, try to init the submodule with the following cmd:\\n\"\n@@ -353,89 +353,89 @@ endif()\n# -------------------------------------------------------------------------------------------------- COMPILED LIBRARIES\n# ---------------------------------------------------------------------------------------------------------------------\n-macro(aff3ct_target_link_libraries lib)\n+macro(aff3ct_target_link_libraries privacy lib)\nif(AFF3CT_COMPILE_EXE)\n- target_link_libraries(aff3ct-bin PUBLIC ${lib})\n+ target_link_libraries(aff3ct-bin ${privacy} ${lib})\nendif(AFF3CT_COMPILE_EXE)\nif(AFF3CT_COMPILE_SHARED_LIB)\n- target_link_libraries(aff3ct-shared-lib INTERFACE ${lib})\n+ target_link_libraries(aff3ct-shared-lib ${privacy} ${lib})\nendif(AFF3CT_COMPILE_SHARED_LIB)\nif(AFF3CT_COMPILE_STATIC_LIB)\n- target_link_libraries(aff3ct-static-lib INTERFACE ${lib})\n+ target_link_libraries(aff3ct-static-lib ${privacy} ${lib})\nendif(AFF3CT_COMPILE_STATIC_LIB)\nendmacro()\n-macro(aff3ct_target_include_directories dir)\n- target_include_directories(aff3ct-obj PUBLIC $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\n+macro(aff3ct_target_include_directories privacy dir)\n+ target_include_directories(aff3ct-obj ${privacy} $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\nif(AFF3CT_COMPILE_EXE)\n- target_include_directories(aff3ct-bin PUBLIC $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\n+ target_include_directories(aff3ct-bin ${privacy} $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\nendif()\nif(AFF3CT_COMPILE_SHARED_LIB)\n- target_include_directories(aff3ct-shared-lib PUBLIC $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\n+ target_include_directories(aff3ct-shared-lib ${privacy} $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\nendif()\nif(AFF3CT_COMPILE_STATIC_LIB)\n- target_include_directories(aff3ct-static-lib PUBLIC $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\n+ target_include_directories(aff3ct-static-lib ${privacy} $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\nendif()\nendmacro()\n# SystemC (it is very important to have SystemC linked before the other libraries !!!)\nif(AFF3CT_SYSTEMC_SIMU OR AFF3CT_SYSTEMC_MODULE)\nif(AFF3CT_SYSTEMC_SIMU)\n- aff3ct_target_compile_definitions(\"AFF3CT_SYSTEMC_SIMU\")\n- aff3ct_target_compile_definitions(\"AFF3CT_SYSTEMC_MODULE\")\n+ aff3ct_target_compile_definitions(PUBLIC \"AFF3CT_SYSTEMC_SIMU\")\n+ aff3ct_target_compile_definitions(PUBLIC \"AFF3CT_SYSTEMC_MODULE\")\nelse()\n- aff3ct_target_compile_definitions(\"AFF3CT_SYSTEMC_MODULE\")\n+ aff3ct_target_compile_definitions(PUBLIC \"AFF3CT_SYSTEMC_MODULE\")\nendif()\nfind_package(SystemC REQUIRED QUIET)\nif(SystemC_FOUND)\nmessage(STATUS \"AFF3CT - Library found: SystemC\")\n- aff3ct_target_include_directories(\"${SystemC_INCLUDE_DIRS}\")\n- aff3ct_target_link_libraries(\"${SystemC_LIBRARIES}\")\n+ aff3ct_target_include_directories(PUBLIC \"${SystemC_INCLUDE_DIRS}\")\n+ aff3ct_target_link_libraries(PUBLIC \"${SystemC_LIBRARIES}\")\nendif(SystemC_FOUND)\nfind_package(TLM REQUIRED QUIET)\nif(TLM_FOUND)\nmessage(STATUS \"AFF3CT - Library found: TLM\")\n- aff3ct_target_include_directories(\"${TLM_INCLUDE_DIRS}\")\n+ aff3ct_target_include_directories(PUBLIC \"${TLM_INCLUDE_DIRS}\")\nendif(TLM_FOUND)\nendif()\n# GSL\nif(AFF3CT_LINK_GSL)\n- aff3ct_target_compile_definitions(\"AFF3CT_CHANNEL_GSL\")\n+ aff3ct_target_compile_definitions(PUBLIC \"AFF3CT_CHANNEL_GSL\")\nfind_package(GSL REQUIRED QUIET)\nif(GSL_FOUND)\nmessage(STATUS \"AFF3CT - Library found: GSL\")\n- aff3ct_target_link_libraries(GSL::gsl)\n+ aff3ct_target_link_libraries(PUBLIC GSL::gsl)\nendif(GSL_FOUND)\nendif(AFF3CT_LINK_GSL)\n# MKL\nif(AFF3CT_LINK_MKL)\n- aff3ct_target_compile_definitions(\"AFF3CT_CHANNEL_MKL\")\n+ aff3ct_target_compile_definitions(PUBLIC \"AFF3CT_CHANNEL_MKL\")\n# set (MKL_STATIC ON)\nfind_package(MKL REQUIRED QUIET)\nif(MKL_FOUND)\nmessage(STATUS \"AFF3CT - Library found: MKL\")\n- aff3ct_target_include_directories(\"${MKL_INCLUDE_DIRS}\")\n- aff3ct_target_link_libraries(\"${MKL_MINIMAL_LIBRARIES}\")\n+ aff3ct_target_include_directories(PUBLIC \"${MKL_INCLUDE_DIRS}\")\n+ aff3ct_target_link_libraries(PUBLIC \"${MKL_MINIMAL_LIBRARIES}\")\nendif(MKL_FOUND)\nendif(AFF3CT_LINK_MKL)\n# MPI\nif(AFF3CT_MPI)\n- aff3ct_target_compile_definitions(\"AFF3CT_MPI\")\n+ aff3ct_target_compile_definitions(PUBLIC \"AFF3CT_MPI\")\nfind_package(MPI REQUIRED QUIET)\nif(MPI_CXX_FOUND)\nmessage(STATUS \"AFF3CT - Library found: MPI\")\nif(${CMAKE_VERSION} VERSION_LESS \"3.9.6\")\n- aff3ct_target_include_directories(\"${MPI_CXX_INCLUDE_PATH}\")\n- aff3ct_target_link_libraries(\"${MPI_CXX_LIBRARIES}\")\n+ aff3ct_target_include_directories(PUBLIC \"${MPI_CXX_INCLUDE_PATH}\")\n+ aff3ct_target_link_libraries(PUBLIC \"${MPI_CXX_LIBRARIES}\")\nif(MPI_CXX_COMPILE_FLAGS)\nif(AFF3CT_COMPILE_EXE)\n@@ -449,7 +449,7 @@ if(AFF3CT_MPI)\nendif()\nendif(MPI_CXX_LINK_FLAGS)\nelse()\n- aff3ct_target_link_libraries(MPI::MPI_CXX)\n+ aff3ct_target_link_libraries(PUBLIC MPI::MPI_CXX)\nendif()\nendif(MPI_CXX_FOUND)\n@@ -459,7 +459,7 @@ endif(AFF3CT_MPI)\nset(CMAKE_THREAD_PREFER_PTHREAD ON)\nset(THREADS_PREFER_PTHREAD_FLAG ON)\nfind_package(Threads REQUIRED)\n-aff3ct_target_link_libraries(Threads::Threads)\n+aff3ct_target_link_libraries(PUBLIC Threads::Threads)\n# ---------------------------------------------------------------------------------------------------------------------\n# -------------------------------------------------------------------------------------------------------------- EXPORT\n" } ]
C++
MIT License
aff3ct/aff3ct
Improve macros genericity.
8,490
01.03.2019 11:08:41
-3,600
85af9e331a781339566f17a5fddc50b55477136a
CI: add new environment variables to specify the number of builds.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -49,6 +49,20 @@ then\nexit 1\nfi\n+if [ \"${GIT_BRANCH}\" == \"master\" ]; then\n+ if [ -z \"$CI_AFF3CT_DEPLOY_BUILDS_MASTER\" ]\n+ then\n+ echo \"Please define the 'CI_AFF3CT_DEPLOY_BUILDS_MASTER' environment variable.\"\n+ exit 1\n+ fi\n+else\n+ if [ -z \"$CI_AFF3CT_DEPLOY_BUILDS_DEV\" ]\n+ then\n+ echo \"Please define the 'CI_AFF3CT_DEPLOY_BUILDS_DEV' environment variable.\"\n+ exit 1\n+ fi\n+fi\n+\nREPO_WEB=aff3ct.github.io\nREPO_RESSOURCES=ressources\ngit clone git@github.com:aff3ct/${REPO_WEB}.git\n@@ -56,7 +70,6 @@ rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\ncd ${REPO_WEB}\ngit clone git@github.com:aff3ct/${REPO_RESSOURCES}.git\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-git submodule update --init --recursive\nmkdir ressources/aff3ct_builds\ncd ..\n@@ -124,9 +137,9 @@ git commit -m \"Automatic: add new AFF3CT builds ($GIT_BRANCH: $GIT_HASH).\"\nBUILD_CSV=../download/download_${GIT_BRANCH}.csv\nN_BUILDS_TO_KEEP=0\nif [ \"${GIT_BRANCH}\" == \"master\" ]; then\n- N_BUILDS_TO_KEEP=5\n+ N_BUILDS_TO_KEEP=$CI_AFF3CT_DEPLOY_BUILDS_MASTER\nelse\n- N_BUILDS_TO_KEEP=5\n+ N_BUILDS_TO_KEEP=$CI_AFF3CT_DEPLOY_BUILDS_DEV\nfi\nN_BUILDS=$(wc -l $BUILD_CSV | cut -d \" \" -f1)\nN_BUILDS=$(($N_BUILDS-1))\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: add new environment variables to specify the number of builds.
8,488
01.03.2019 14:44:53
-3,600
f1d2c88a86e7edfaa49a8bdb0cb89d9e83ee85df
First working upload.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -198,7 +198,7 @@ file(WRITE ${debian_rules}\n\"\\n\\n%:\\n\"\n\"\\tdh $@ --buildsystem=cmake\\n\"\n\"\\noverride_dh_auto_configure:\\n\"\n- \"\\tDESTDIR=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" dh_auto_configure -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DPACKAGE_TGZ=OFF\"\n+ \"\\tDESTDIR=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DPACKAGE_TGZ=OFF\"\n\"\\n\\noverride_dh_auto_install:\\n\"\n\"\\tdh_auto_install --destdir=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" --buildsystem=cmake\"\n\"\\n\\noverride_dh_strip:\\n\"\n" }, { "change_type": "ADD", "old_path": null, "new_path": "upload_ppa.sh", "diff": "+#!/bin/bash\n+rm -rf ~/Projects/aff3ct/build/Debian/\n+cd ~/Projects/aff3ct/build/\n+cmake .. -G\"Unix Makefiles\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-funroll-loops -march=native\"\n+cd Debian/xenial/\n+cpack -G TGZ --config ../../CPackSourceConfig.cmake\n+cd aff3ct_*~xenial1\n+tar zxf ../aff3ct_2.3.*.orig.tar.gz\n+debuild --no-tgz-check -ICVS -nc -S\n+cd ..\n+dput ppa:mathieu-leonardon/aff3ct aff3ct_2.3.*~xenial1_source.changes\n" } ]
C++
MIT License
aff3ct/aff3ct
First working upload.
8,490
01.03.2019 15:34:31
-3,600
bfecd250b2b3278746022e21f52210d6bc88b0e7
CI: upload the builds as artifacts in the deploy script.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -1213,6 +1213,11 @@ deploy-builds-linux:\nonly:\n- master\n- development\n+ artifacts:\n+ name: builds\n+ when: always\n+ paths:\n+ - builds/\nallow_failure: true\nscript:\n- source ./ci/tools/git-branch.sh\n" }, { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -49,53 +49,20 @@ then\nexit 1\nfi\n-if [ \"${GIT_BRANCH}\" == \"master\" ]; then\n- if [ -z \"$CI_AFF3CT_DEPLOY_BUILDS_MASTER\" ]\n+if [ -z \"$CI_JOB_ID\" ]\nthen\n- echo \"Please define the 'CI_AFF3CT_DEPLOY_BUILDS_MASTER' environment variable.\"\n+ echo \"Please define the 'CI_JOB_ID' environment variable.\"\nexit 1\nfi\n-else\n- if [ -z \"$CI_AFF3CT_DEPLOY_BUILDS_DEV\" ]\n+\n+if [ -z \"$CI_PROJECT_URL\" ]\nthen\n- echo \"Please define the 'CI_AFF3CT_DEPLOY_BUILDS_DEV' environment variable.\"\n+ echo \"Please define the 'CI_PROJECT_URL' environment variable.\"\nexit 1\nfi\n-fi\n-\n-REPO_WEB=aff3ct.github.io\n-REPO_RESSOURCES=ressources\n-git clone git@github.com:aff3ct/${REPO_WEB}.git\n-rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-cd ${REPO_WEB}\n-git clone git@github.com:aff3ct/${REPO_RESSOURCES}.git\n-rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-mkdir ressources/aff3ct_builds\n-cd ..\n-\n-CSV_ENTRY=$(cat ${REPO_WEB}/download/download_${GIT_BRANCH}.csv | grep \"$GIT_TAG\" | grep \"$GIT_HASH\" | grep \"$GIT_DATE\" | grep \"$GIT_MESSAGE\" | grep \"$GIT_AUTHOR\" | grep \"$BUILDS_LIST\")\n-\n-# delete the build if it exists\n-if [ -n \"$CSV_ENTRY\" ]; then\n- cd ${REPO_WEB}/${REPO_RESSOURCES}\n- FILES=$(echo $CSV_ENTRY | cut -d \";\" -f6)\n- s1=\"\\\"\"\n- s2=\"\"\n- FILES=$(echo \"${FILES//$s1/$s2}\")\n- N_FILES=$(echo $FILES | sed 's/,/\\n/g' | wc -l)\n- for (( F=1; F<=N_FILES; F++ ))\n- do\n- FILE=$(echo $FILES | cut -d \",\" -f$F)\n- FILE_PATH=aff3ct_builds/$FILE;\n- if [ -f $FILE_PATH ]; then\n- git filter-branch --force --index-filter \"git rm --cached --ignore-unmatch ${FILE_PATH}\" --prune-empty --tag-name-filter cat -- --all\n- rm -rf .git/refs/original/\n- git reflog expire --expire=now --all\n- fi\n- done\n- cd ../../\n-fi\n+BUILDS_DIR=builds\n+mkdir ${BUILDS_DIR}\nfor BUILD in \"$@\"\ndo\nPREFIX=aff3ct_${GIT_BRANCH}\n@@ -108,77 +75,34 @@ do\nmkdir $BUILD/share/aff3ct-$GIT_VERSION/doc/pdf\ncp doc/sphinx/build/latex/AFF3CT.pdf $BUILD/share/aff3ct-$GIT_VERSION/doc/pdf\n- zip -r $ZIP_NAME $BUILD\n+ zip -r $ZIP_NAME $BUILD > /dev/null\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n- mv $ZIP_NAME ${REPO_WEB}/${REPO_RESSOURCES}/aff3ct_builds/\n+ mv $ZIP_NAME ${BUILDS_DIR}\nrm -rf $BUILD\nif [ -z \"$BUILDS_LIST\" ]\nthen\n- BUILDS_LIST=${ZIP_NAME}\n+ BUILDS_LIST=\"$ZIP_NAME\"\nelse\n- BUILDS_LIST=${BUILDS_LIST},${ZIP_NAME}\n+ BUILDS_LIST=\"$BUILDS_LIST;$ZIP_NAME\"\nfi\ndone\n-# if the entry does not exist, add the entry to the CSV file\n-if [ -z \"$CSV_ENTRY\" ]; then\n- echo \"\\\"$GIT_TAG\\\";\\\"$GIT_HASH\\\";\\\"$GIT_DATE\\\";\\\"$GIT_MESSAGE\\\";\\\"$GIT_AUTHOR\\\";\\\"$BUILDS_LIST\\\"\" >> ${REPO_WEB}/download/download_${GIT_BRANCH}.csv\n-fi\n-\n-cd ${REPO_WEB}/${REPO_RESSOURCES}\n-# git lfs install --local\n-# git lfs track aff3ct_builds/*\n-git add -f aff3ct_builds/*\n-git commit -m \"Automatic: add new AFF3CT builds ($GIT_BRANCH: $GIT_HASH).\"\n+REPO_WEB=aff3ct.github.io\n+git clone git@github.com:aff3ct/${REPO_WEB}.git\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-# delete old builds\n-BUILD_CSV=../download/download_${GIT_BRANCH}.csv\n-N_BUILDS_TO_KEEP=0\n-if [ \"${GIT_BRANCH}\" == \"master\" ]; then\n- N_BUILDS_TO_KEEP=$CI_AFF3CT_DEPLOY_BUILDS_MASTER\n-else\n- N_BUILDS_TO_KEEP=$CI_AFF3CT_DEPLOY_BUILDS_DEV\n-fi\n-N_BUILDS=$(wc -l $BUILD_CSV | cut -d \" \" -f1)\n-N_BUILDS=$(($N_BUILDS-1))\n-N_BUILDS_TO_RM=$(($N_BUILDS-$N_BUILDS_TO_KEEP))\n-if (( $N_BUILDS_TO_RM >= 1 )); then\n- B=0\n- cat $BUILD_CSV | while read line\n- do\n- if (( $B != 0 )); then\n- FILES=$(echo $line | cut -d \";\" -f6)\n- s1=\"\\\"\"\n- s2=\"\"\n- FILES=$(echo \"${FILES//$s1/$s2}\")\n- N_FILES=$(echo $FILES | sed 's/,/\\n/g' | wc -l)\n- for (( F=1; F<=N_FILES; F++ ))\n- do\n- FILE=$(echo $FILES | cut -d \",\" -f$F)\n- FILE_PATH=aff3ct_builds/$FILE;\n- if [ -f $FILE_PATH ]; then\n- git filter-branch --force --index-filter \"git rm --cached --ignore-unmatch ${FILE_PATH}\" --prune-empty --tag-name-filter cat -- --all\n- rm -rf .git/refs/original/\n- git reflog expire --expire=now --all\n- fi\n- done\n- fi\n- if [ \"${B}\" -eq $N_BUILDS_TO_RM ]; then\n- break\n- fi\n- B=$((B+1))\n- done\n-fi\n+cd ${REPO_WEB}\n-git gc --prune=now\n-# git gc --aggressive --prune=now\n-git push origin master --force\n-rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+ARTIFACTS_PATH=${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/file/${BUILDS_DIR}/\n+CSV_ENTRY=$(cat download/download_${GIT_BRANCH}.csv | grep \"$GIT_TAG\" | grep \"$GIT_HASH\" | grep \"$GIT_DATE\" | grep \"$GIT_MESSAGE\" | grep \"$GIT_AUTHOR\" | grep \"$ARTIFACTS_PATH\" | grep \"$BUILDS_LIST\")\n-cd ..\n+# if the entry does not exist, add the entry to the CSV file\n+if [ -z \"$CSV_ENTRY\" ]; then\n+ echo \"\\\"$GIT_TAG\\\",\\\"$GIT_HASH\\\",\\\"$GIT_DATE\\\",\\\"$GIT_MESSAGE\\\",\\\"$GIT_AUTHOR\\\",\\\"$ARTIFACTS_PATH\\\",\\\"$BUILDS_LIST\\\"\" >> download/download_${GIT_BRANCH}.csv\ngit add -f download/download_${GIT_BRANCH}.csv\ngit commit -m \"Automatic: add new AFF3CT builds ($GIT_BRANCH: $GIT_HASH).\"\ngit push origin master\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+fi\n\\ No newline at end of file\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: upload the builds as artifacts in the deploy script.
8,490
01.03.2019 16:57:02
-3,600
b7be2dec9a174f6a2759e1f86325eac0796e87f5
CI: merge 'documentation' and 'parser' stages in 'check' + compile the doc in the analysis stage.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -4,8 +4,7 @@ variables:\nstages:\n- analysis\n- build\n- - parser\n- - documentation\n+ - check\n- test\n- coverage\n- deploy\n@@ -59,6 +58,24 @@ analysis-git-submodules:\n- source ./ci/tools/git-branch.sh\n- ./ci/analysis-git-submodule.sh\n+documentation-sphinx:\n+ stage: analysis\n+ except:\n+ - schedules\n+ artifacts:\n+ name: documentation-sphinx\n+ when: always\n+ paths:\n+ - doc/sphinx/build/html\n+ - doc/sphinx/build/latex\n+ tags:\n+ - sphinx\n+ - latex\n+ script:\n+ - cd doc/sphinx\n+ - make html\n+ - make latexpdf\n+\nbuild-linux-gcc-nointr:\nstage: build\nvariables:\n@@ -66,7 +83,7 @@ build-linux-gcc-nointr:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- gcc\n@@ -93,7 +110,7 @@ build-linux-gcc-x64-sse4.2:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- gcc\n@@ -119,7 +136,7 @@ build-linux-gcc-x64-avx2:\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- gcc\n@@ -147,7 +164,7 @@ build-linux-gcc-8-bit:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- gcc\n@@ -174,7 +191,7 @@ build-linux-gcc-mpi:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- gcc\n@@ -201,7 +218,7 @@ build-linux-gcc-systemc:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- gcc\n@@ -229,7 +246,7 @@ build-linux-clang:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- clang\n@@ -255,7 +272,7 @@ build-linux-gcc-4.8:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- gcc-4.8\n@@ -281,7 +298,7 @@ build-linux-icpc:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- linux\n- icpc\n@@ -310,7 +327,7 @@ build-windows-gcc-x86-sse4.2:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- windows\n- gcc\n@@ -336,7 +353,7 @@ build-windows-gcc-x64-avx2:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- windows\n- 64-bit\n@@ -362,7 +379,7 @@ build-windows-msvc-avx:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- windows\n- msvc\n@@ -386,7 +403,7 @@ build-macos-clang-x64-sse4.2:\nexcept:\n- schedules\ndependencies:\n- - analysis-headers\n+ - documentation-sphinx\ntags:\n- macos\n- apple-clang\n@@ -405,8 +422,8 @@ build-macos-clang-x64-sse4.2:\n- source ./ci/tools/threads.sh\n- ./ci/build-linux-macos.sh\n-parser-check:\n- stage: parser\n+check-debug-parser:\n+ stage: check\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n@@ -431,28 +448,8 @@ parser-check:\n- export AFF3CT_PATH=\"../../../build_linux_gcc_x64_sse4.2/bin/aff3ct-$GIT_VERSION\"\n- ./test/test.sh\n-documentation-sphinx:\n- stage: documentation\n- except:\n- - schedules\n- dependencies:\n- - analysis-headers\n- artifacts:\n- name: documentation-sphinx\n- when: always\n- paths:\n- - doc/sphinx/build/html\n- - doc/sphinx/build/latex\n- tags:\n- - sphinx\n- - latex\n- script:\n- - cd doc/sphinx\n- - make html\n- - make latexpdf\n-\n-documentation-check:\n- stage: documentation\n+check-documentation:\n+ stage: check\nexcept:\n- schedules\ndependencies:\n@@ -464,7 +461,7 @@ documentation-check:\n- sse4.2\n- python3.5\nscript:\n- - ./ci/documentation-check.py --aff3ct \"build_linux_gcc_x64_sse4.2/bin/aff3ct\"\n+ - ./ci/check-documentation.py --aff3ct \"build_linux_gcc_x64_sse4.2/bin/aff3ct\"\ntest-regression-bch:\nstage: test\n@@ -1205,11 +1202,9 @@ deploy-builds-linux:\n- build-windows-gcc-x86-sse4.2\n- build-windows-gcc-x64-avx2\n- build-macos-clang-x64-sse4.2\n- - documentation-sphinx\ntags:\n- linux\n- github\n-# - git-lfs\nonly:\n- master\n- development\n" }, { "change_type": "RENAME", "old_path": "ci/documentation-check.py", "new_path": "ci/check-documentation.py", "diff": "" }, { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -69,12 +69,6 @@ do\nZIP_NAME=$(echo \"${BUILD/build/$PREFIX}\")\nZIP_NAME=$(echo \"${ZIP_NAME/\\./\\_}_$GIT_HASH.zip\")\n- # add the documentation\n- mkdir $BUILD/share/aff3ct-$GIT_VERSION/doc\n- cp -r doc/sphinx/build/html $BUILD/share/aff3ct-$GIT_VERSION/doc/\n- mkdir $BUILD/share/aff3ct-$GIT_VERSION/doc/pdf\n- cp doc/sphinx/build/latex/AFF3CT.pdf $BUILD/share/aff3ct-$GIT_VERSION/doc/pdf\n-\nzip -r $ZIP_NAME $BUILD > /dev/null\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: merge 'documentation' and 'parser' stages in 'check' + compile the doc in the analysis stage.
8,488
01.03.2019 16:57:47
-3,600
994b85e6bd84622f3315422d2352ec6af4479148
Valid aff3ct build.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -11,11 +11,6 @@ endif()\nproject(aff3ct)\n-if(NOT EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/.git\")\n- message(FATAL_ERROR \"The '.git' folder can't be found, AFF3CT can't be compiled if it is not cloned \"\n- \"from a Git repository. Please do not download archives from GitHub and make a Git \"\n- \"clone instead (git clone https://github.com/aff3ct/aff3ct.git).\")\n-endif()\n# ---------------------------------------------------------------------------------------------------------------------\n# ------------------------------------------------------------------------------------------------------- CMAKE OPTIONS\n@@ -32,6 +27,13 @@ option(AFF3CT_MPI \"Enable the MPI support\"\noption(AFF3CT_POLAR_BIT_PACKING \"Enable the bit packing technique for Polar code SC decoding\" ON )\noption(AFF3CT_POLAR_BOUNDS \"Enable the use of the external Tal & Vardy Polar best channels generator\" OFF)\noption(AFF3CT_COLORS \"Enable the colors in the terminal\" ON )\n+option(AFF3CT_OVERRIDE_VERSION \"Compile without .git directory, provided a version and hash\" OFF)\n+\n+if(NOT EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/.git\" AND NOT AFF3CT_OVERRIDE_VERSION)\n+ message(FATAL_ERROR \"The '.git' folder can't be found, AFF3CT can't be compiled if it is not cloned \"\n+ \"from a Git repository. Please do not download archives from GitHub and make a Git \"\n+ \"clone instead (git clone https://github.com/aff3ct/aff3ct.git).\")\n+endif()\nif(NOT (WIN32 OR APPLE))\noption(AFF3CT_BACKTRACE \"Enable the backtrace display when an exception is raised\" ON)\n@@ -80,9 +82,15 @@ file(GLOB_RECURSE source_files ${CMAKE_CURRENT_SOURCE_DIR}/src/*)\n# ------------------------------------------------------------------------------------------------ GET VERSION FROM GIT\n# ---------------------------------------------------------------------------------------------------------------------\n+if(NOT AFF3CT_OVERRIDE_VERSION)\ninclude(GetGitRevisionDescription)\nget_git_head_revision(GIT_REFSPEC GIT_SHA1)\ngit_describe(GIT_VERSION \"--tags\" \"--abbrev=7\")\n+else()\n+ set(GIT_VERSION ${AFF3CT_OVERRIDE_VERSION})\n+endif()\n+\n+\nstring(REGEX REPLACE \"^v\" \"\" AFF3CT_VERSION_FULL ${GIT_VERSION})\nstring(REGEX REPLACE \"-.*\" \"\" AFF3CT_VERSION ${AFF3CT_VERSION_FULL})\n" }, { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -198,7 +198,7 @@ file(WRITE ${debian_rules}\n\"\\n\\n%:\\n\"\n\"\\tdh $@ --buildsystem=cmake\\n\"\n\"\\noverride_dh_auto_configure:\\n\"\n- \"\\tDESTDIR=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DPACKAGE_TGZ=OFF\"\n+ \"\\tDESTDIR=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DPACKAGE_TGZ=OFF -DAFF3CT_OVERRIDE_VERSION=${GIT_VERSION} -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'\"\n\"\\n\\noverride_dh_auto_install:\\n\"\n\"\\tdh_auto_install --destdir=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" --buildsystem=cmake\"\n\"\\n\\noverride_dh_strip:\\n\"\n@@ -339,7 +339,7 @@ message(STATUS \"DEB_SOURCE_CHANGES is ${DEB_SOURCE_CHANGES}\")\n# else()\n# add_custom_target(dput_${DISTRI} ALL\n# COMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES}\n-# DEPENDS debuild_${DISTRI}\n+# DEPENDS debuild_${DISTRI},\n# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI}\n# )\n# endif()\n" }, { "change_type": "MODIFY", "old_path": "upload_ppa.sh", "new_path": "upload_ppa.sh", "diff": "#!/bin/bash\nrm -rf ~/Projects/aff3ct/build/Debian/\ncd ~/Projects/aff3ct/build/\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-funroll-loops -march=native\"\n+cmake .. -G\"Unix Makefiles\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-funroll-loops -msse4.1\"\n+make -j8\ncd Debian/xenial/\ncpack -G TGZ --config ../../CPackSourceConfig.cmake\ncd aff3ct_*~xenial1\ntar zxf ../aff3ct_2.3.*.orig.tar.gz\n-debuild --no-tgz-check -ICVS -nc -S\n+debuild --no-tgz-check -S\ncd ..\ndput ppa:mathieu-leonardon/aff3ct aff3ct_2.3.*~xenial1_source.changes\n" } ]
C++
MIT License
aff3ct/aff3ct
Valid aff3ct build.
8,490
01.03.2019 20:55:26
-3,600
5177391715751304089b842d1c08be274dc13632
CI: fix wrong GitLab.com artifacts URL.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-builds-linux.sh", "new_path": "ci/deploy-builds-linux.sh", "diff": "@@ -89,7 +89,7 @@ rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\ncd ${REPO_WEB}\n-ARTIFACTS_PATH=${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/file/${BUILDS_DIR}/\n+ARTIFACTS_PATH=${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/${BUILDS_DIR}/\nCSV_ENTRY=$(cat download/download_${GIT_BRANCH}.csv | grep \"$GIT_TAG\" | grep \"$GIT_HASH\" | grep \"$GIT_DATE\" | grep \"$GIT_MESSAGE\" | grep \"$GIT_AUTHOR\" | grep \"$ARTIFACTS_PATH\" | grep \"$BUILDS_LIST\")\n# if the entry does not exist, add the entry to the CSV file\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: fix wrong GitLab.com artifacts URL.
8,488
05.03.2019 16:40:13
-3,600
97b108479793013d7d06b8b9b3768454185ce3ee
Include PPA uploading directly in cmake.
[ { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -690,5 +690,8 @@ set(CPACK_INSTALLED_DIRECTORIES \"${CMAKE_CURRENT_SOURCE_DIR};/\")\nset(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)\n+if (AFF3CT_UPLOAD_PPA)\ninclude(UploadPPA)\n+endif()\n+\ninclude(CPack)\n" }, { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -62,22 +62,20 @@ if(NOT DEBUILD_EXECUTABLE OR NOT DPUT_EXECUTABLE)\nendif(NOT DEBUILD_EXECUTABLE OR NOT DPUT_EXECUTABLE)\n-if(NOT PROJECT_PPA_DISTRIB_TARGET)\n+if(NOT AFF3CT_PPA_DISTRIB)\nexecute_process(\nCOMMAND lsb_release -cs\nOUTPUT_VARIABLE DISTRI\nOUTPUT_STRIP_TRAILING_WHITESPACE)\n- set(PROJECT_PPA_DISTRIB_TARGET ${DISTRI})\n- message(STATUS \"PROJECT_PPA_DISTRIB_TARGET NOT provided, so using system settings : ${DISTRI}\")\n+ set(AFF3CT_PPA_DISTRIB ${DISTRI})\n+ message(STATUS \"AFF3CT - PPA distrib found: ${DISTRI}\")\nendif()\n-foreach(DISTRI ${PROJECT_PPA_DISTRIB_TARGET})\n-message(STATUS \"Building for ${DISTRI}\")\n+foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n# Strip \"-dirty\" flag from package version.\n# It can be added by, e.g., git describe but it causes trouble with debuild etc.\nstring(REPLACE \"-dirty\" \"\" CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})\n-message(STATUS \"version: ${CPACK_PACKAGE_VERSION}\")\n# DEBIAN/control\n# debian policy enforce lower case for package name\n@@ -112,7 +110,7 @@ endif()\nif(PPA_DEBIAN_VERSION)\nset(DEBIAN_PACKAGE_VERSION \"${CPACK_PACKAGE_VERSION}-${PPA_DEBIAN_VERSION}~${DISTRI}1\")\n-elseif(NOT PPA_DEBIAN_VERSION AND NOT PROJECT_PPA_DISTRIB_TARGET)\n+elseif(NOT PPA_DEBIAN_VERSION AND NOT AFF3CT_PPA_DISTRIB)\nmessage(WARNING \"Variable PPA_DEBIAN_VERSION not set! Building 'native' package!\")\nset(DEBIAN_PACKAGE_VERSION \"${CPACK_PACKAGE_VERSION}\")\nelse()\n@@ -229,7 +227,7 @@ if(CHANGELOG_MESSAGE)\nelse()\nset(output_changelog_msg \"* Package created with CMake\")\nendif(CHANGELOG_MESSAGE)\n-message(STATUS \"Changelog message : \\\"${output_changelog_msg}\\\"\")\n+\nif(EXISTS ${CPACK_DEBIAN_RESOURCE_FILE_CHANGELOG})\nconfigure_file(${CPACK_DEBIAN_RESOURCE_FILE_CHANGELOG} ${debian_changelog} COPYONLY)\n@@ -285,15 +283,11 @@ set(package_file_name \"${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}\")\nset(orig_file \"${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${package_file_name}.orig.tar.gz\")\n-message(STATUS \"orig_file is ${orig_file}\")\n-\n-\nadd_custom_command(OUTPUT ${orig_file}\n- COMMAND cpack -G TGZ --config ${CMAKE_BINARY_DIR}/CPackConfig.cmake\n+ COMMAND cpack -G TGZ --config ${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake\nWORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI}\n)\n-message(STATUS \"DEBIAN_SOURCE_DIR is ${DEBIAN_SOURCE_DIR}\")\nadd_custom_command(OUTPUT ${DEBIAN_SOURCE_DIR}/CMakeLists.txt\nCOMMAND tar zxf ${orig_file}\n@@ -307,22 +301,31 @@ set(DEB_SOURCE_CHANGES\n${CPACK_DEBIAN_PACKAGE_NAME}_${DEBIAN_PACKAGE_VERSION}_source.changes\n)\n-message(STATUS \"DEB_SOURCE_CHANGES is ${DEB_SOURCE_CHANGES}\")\n+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEB_SOURCE_CHANGES}\n+ COMMAND ${DEBUILD_EXECUTABLE} --no-tgz-check -S\n+ WORKING_DIRECTORY ${DEBIAN_SOURCE_DIR}\n+ )\n-# add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEB_SOURCE_CHANGES}\n-# COMMAND ${DEBUILD_EXECUTABLE} --no-tgz-check -S\n-# WORKING_DIRECTORY ${DEBIAN_SOURCE_DIR}\n-# )\n-# add_custom_target(debuild_${DISTRI} ALL\n-# DEPENDS ${DEBIAN_SOURCE_DIR}/CMakeLists.txt\n-# ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEB_SOURCE_CHANGES}\n-# )\n+add_custom_target(debuild_${DISTRI} ALL\n+ DEPENDS ${DEBIAN_SOURCE_DIR}/CMakeLists.txt\n+ aff3ct-bin\n+ ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEB_SOURCE_CHANGES}\n+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI}\n+ )\n# ##############################################################################\n# # dput ppa:your-lp-id/ppa <source.changes>\n-# set(UPLOAD_PPA \"ppa:mathieu-leonardon/aff3ct\")\n+set(UPLOAD_PPA \"ppa:mathieu-leonardon/aff3ct\")\n+\n+add_custom_target(dput_${DISTRI} ALL\n+ COMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES}\n+ DEPENDS debuild_${DISTRI}\n+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI}\n+ )\n+endforeach(DISTRI)\n+\n+\n-# message(STATUS \"Upload PPA is ${UPLOAD_PPA}\")\n# if(UPLOAD_PPA)\n# if (EXISTS ${DPUT_CONFIG_IN})\n# set(DPUT_DIST ${DISTRI})\n@@ -333,15 +336,14 @@ message(STATUS \"DEB_SOURCE_CHANGES is ${DEB_SOURCE_CHANGES}\")\n# )\n# add_custom_target(dput_${DISTRI} ALL\n# COMMAND ${DPUT_EXECUTABLE} -c ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/dput.cf ${DPUT_HOST} ${DEB_SOURCE_CHANGES}\n-# DEPENDS debuild_${DISTRI}\n+# DEPENDS debuild_${DISTRI}, aff3ct-bin\n# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI}\n# )\n# else()\n# add_custom_target(dput_${DISTRI} ALL\n# COMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES}\n-# DEPENDS debuild_${DISTRI},\n+ # DEPENDS debuild_${DISTRI}, aff3ct-bin\n# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI}\n# )\n# endif()\n# endif()\n\\ No newline at end of file\n-endforeach(DISTRI)\n" }, { "change_type": "DELETE", "old_path": "upload_ppa.sh", "new_path": null, "diff": "-#!/bin/bash\n-rm -rf ~/Projects/aff3ct/build/Debian/\n-cd ~/Projects/aff3ct/build/\n-cmake .. -G\"Unix Makefiles\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"-funroll-loops -msse4.1\"\n-make -j8\n-cd Debian/xenial/\n-cpack -G TGZ --config ../../CPackSourceConfig.cmake\n-cd aff3ct_*~xenial1\n-tar zxf ../aff3ct_2.3.*.orig.tar.gz\n-debuild --no-tgz-check -S\n-cd ..\n-dput ppa:mathieu-leonardon/aff3ct aff3ct_2.3.*~xenial1_source.changes\n" } ]
C++
MIT License
aff3ct/aff3ct
Include PPA uploading directly in cmake.
8,488
05.03.2019 17:01:40
-3,600
066c7315bd404fa4b137bae3fb166539f4f051c9
Fix DPUT HOST.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -315,7 +315,7 @@ add_custom_target(debuild_${DISTRI} ALL\n# ##############################################################################\n# # dput ppa:your-lp-id/ppa <source.changes>\n-set(UPLOAD_PPA \"ppa:mathieu-leonardon/aff3ct\")\n+set(DPUT_HOST \"ppa:mathieu-leonardon/aff3ct\")\nadd_custom_target(dput_${DISTRI} ALL\nCOMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix DPUT HOST.
8,488
06.03.2019 13:45:37
-3,600
bcad8d7e0c90805a160eef95a4c3b802d136d73e
Update PPA Host to aff3ct team.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -196,7 +196,9 @@ file(WRITE ${debian_rules}\n\"\\n\\n%:\\n\"\n\"\\tdh $@ --buildsystem=cmake\\n\"\n\"\\noverride_dh_auto_configure:\\n\"\n- \"\\tDESTDIR=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DPACKAGE_TGZ=OFF -DAFF3CT_OVERRIDE_VERSION=${GIT_VERSION} -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'\"\n+ \"\\tDESTDIR=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" dh_auto_configure\"\n+ \" -- -DCMAKE_BUILD_TYPE=Release -DAFF3CT_COMPILE_SHARED_LIB=ON -DPACKAGE_TGZ=OFF \"\n+ \"-DAFF3CT_OVERRIDE_VERSION=${GIT_VERSION} -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'\"\n\"\\n\\noverride_dh_auto_install:\\n\"\n\"\\tdh_auto_install --destdir=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" --buildsystem=cmake\"\n\"\\n\\noverride_dh_strip:\\n\"\n@@ -316,7 +318,7 @@ add_custom_target(debuild_${DISTRI} ALL\n# ##############################################################################\n# # dput ppa:your-lp-id/ppa <source.changes>\n-set(DPUT_HOST \"ppa:mathieu-leonardon/aff3ct\")\n+set(DPUT_HOST \"ppa:aff3ct/aff3ct\")\nadd_custom_target(dput_${DISTRI} ALL\nCOMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES}\n" } ]
C++
MIT License
aff3ct/aff3ct
Update PPA Host to aff3ct team.
8,490
13.03.2019 13:27:10
-3,600
a2c56d2507fd689da79364df25b8c69907a19f09
Fix a bug in the Git CMake module.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/GetGitRevisionDescription.cmake", "new_path": "cmake/Modules/GetGitRevisionDescription.cmake", "diff": "@@ -62,9 +62,13 @@ function(get_git_head_revision _refspecvar _hashvar)\n# check if this is a submodule\nif(NOT IS_DIRECTORY ${GIT_DIR})\nfile(READ ${GIT_DIR} submodule)\n- string(REGEX REPLACE \"gitdir: (.*)\\n$\" \"\\\\1\" GIT_DIR_RELATIVE ${submodule})\n+ string(REGEX REPLACE \"gitdir: (.*)\\n$\" \"\\\\1\" GIT_DIR_RELATIVE_OR_ABSOLUTE ${submodule})\n+ if (IS_ABSOLUTE ${GIT_DIR_RELATIVE_OR_ABSOLUTE})\n+ set(GIT_DIR \"${GIT_DIR_RELATIVE_OR_ABSOLUTE}\")\n+ else()\nget_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)\n- get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)\n+ get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE_OR_ABSOLUTE} ABSOLUTE)\n+ endif()\nendif()\nset(GIT_DATA \"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data\")\nif(NOT EXISTS \"${GIT_DATA}\")\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix a bug in the Git CMake module.
8,490
20.03.2019 17:12:58
-3,600
dc743fe272400630c36abf3e79a2b9db4d315357
Thread safe '--enc-g-save-path' option.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/ldpc/encoder.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/ldpc/encoder.rst", "diff": "@@ -159,6 +159,3 @@ Description of the allowed values:\nmatrix can take a non-negligible part of the simulation time. With this\noption the :math:`G` matrix can be saved once for all and used in the\nstandard ``LDPC`` decoder after.\n\\ No newline at end of file\n-\n-.. warning:: This option is not thread-safe, please run it on a single thread\n- with the :ref:`sim-sim-threads` parameter.\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Encoder/LDPC/Encoder_LDPC.cpp", "new_path": "src/Factory/Module/Encoder/LDPC/Encoder_LDPC.cpp", "diff": "@@ -124,7 +124,7 @@ module::Encoder_LDPC<B>* Encoder_LDPC::parameters\n::build(const tools::Sparse_matrix &G, const tools::Sparse_matrix &H) const\n{\nif (this->type == \"LDPC\" ) return new module::Encoder_LDPC <B>(this->K, this->N_cw, G, this->n_frames);\n- if (this->type == \"LDPC_H\" ) return new module::Encoder_LDPC_from_H <B>(this->K, this->N_cw, H, this->G_method, this->G_save_path, this->n_frames);\n+ if (this->type == \"LDPC_H\" ) return new module::Encoder_LDPC_from_H <B>(this->K, this->N_cw, H, this->G_method, this->G_save_path, true, this->n_frames);\nif (this->type == \"LDPC_QC\" ) return new module::Encoder_LDPC_from_QC <B>(this->K, this->N_cw, H, this->n_frames);\nif (this->type == \"LDPC_IRA\") return new module::Encoder_LDPC_from_IRA<B>(this->K, this->N_cw, H, this->n_frames);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.cpp", "new_path": "src/Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.cpp", "diff": "using namespace aff3ct;\nusing namespace aff3ct::module;\n+template <typename B>\n+std::thread::id aff3ct::module::Encoder_LDPC_from_H<B>::master_thread_id = std::this_thread::get_id();\n+\ntemplate <typename B>\nEncoder_LDPC_from_H<B>\n::Encoder_LDPC_from_H(const int K, const int N, const tools::Sparse_matrix &_H, const std::string& G_method,\n- const std::string& G_save_path, const int n_frames)\n+ const std::string& G_save_path, const bool G_save_path_single_thread, const int n_frames)\n: Encoder_LDPC<B>(K, N, n_frames)\n{\nconst std::string name = \"Encoder_LDPC_from_H\";\n@@ -36,6 +39,8 @@ Encoder_LDPC_from_H<B>\n}\nif (G_save_path != \"\")\n+ {\n+ if (!G_save_path_single_thread || this->master_thread_id == std::this_thread::get_id())\n{\nstd::ofstream file(G_save_path);\nif (!file.is_open())\n@@ -48,6 +53,7 @@ Encoder_LDPC_from_H<B>\ntools::AList::write(this->G, file);\ntools::AList::write_info_bits_pos(this->info_bits_pos, file);\n}\n+ }\nthis->check_G_dimensions();\nthis->check_H_dimensions();\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.hpp", "new_path": "src/Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.hpp", "diff": "#define ENCODER_LDPC_FROM_H_HPP_\n#include <vector>\n+#include <thread>\n#include \"../Encoder_LDPC.hpp\"\n@@ -15,9 +16,13 @@ namespace module\ntemplate <typename B = int>\nclass Encoder_LDPC_from_H : public Encoder_LDPC<B>\n{\n+private:\n+ static std::thread::id master_thread_id;\n+\npublic:\nEncoder_LDPC_from_H(const int K, const int N, const tools::Sparse_matrix &H, const std::string& G_method = \"FAST\",\n- const std::string& G_save_path = \"\", const int n_frames = 1);\n+ const std::string& G_save_path = \"\", const bool G_save_path_single_thread = true,\n+ const int n_frames = 1);\nvirtual ~Encoder_LDPC_from_H() = default;\n};\n" } ]
C++
MIT License
aff3ct/aff3ct
Thread safe '--enc-g-save-path' option.
8,490
22.03.2019 11:08:55
-3,600
b3d8cd43428592effadabee678fc1dbe07f6e3e9
CI: rm the '-Wno-misleading-indentation' option.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -339,7 +339,7 @@ build-windows-gcc-x86-sse4.2:\npaths:\n- build_windows_gcc_x86_sse4.2\nscript:\n- - set \"CFLAGS=-Wall -funroll-loops -Wno-misleading-indentation -m32 -msse4.2\"\n+ - set \"CFLAGS=-Wall -funroll-loops -m32 -msse4.2\"\n- set \"LFLAGS=-static -static-libgcc -static-libstdc++\"\n- set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- set \"NAME=build_windows_gcc_x86_sse4.2\"\n@@ -365,7 +365,7 @@ build-windows-gcc-x64-avx2:\npaths:\n- build_windows_gcc_x64_avx2\nscript:\n- - set \"CFLAGS=-Wall -funroll-loops -Wno-misleading-indentation -m64 -mavx2\"\n+ - set \"CFLAGS=-Wall -funroll-loops -m64 -mavx2\"\n- set \"LFLAGS=-static -static-libgcc -static-libstdc++\"\n- set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- set \"NAME=build_windows_gcc_x64_avx2\"\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: rm the '-Wno-misleading-indentation' option.
8,490
27.03.2019 11:23:20
-3,600
e8774ada75b7db6339c4b41f1dfb0ebb432b38a8
Fix Monitor MI on 'std::vector' type.
[ { "change_type": "MODIFY", "old_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "new_path": "src/Module/Monitor/MI/Monitor_MI.hpp", "diff": "@@ -58,19 +58,19 @@ public:\ntemplate <class AB = std::allocator<B>, class AR = std::allocator<R>>\nR get_mutual_info(const std::vector<B,AB>& X, const std::vector<R,AR>& Y, const int frame_id = -1)\n{\n- if ((int)X.K() != this->K * this->n_frames)\n+ if ((int)X.size() != this->N * this->n_frames)\n{\nstd::stringstream message;\n- message << \"'X.K()' has to be equal to 'K' * 'n_frames' ('X.K()' = \" << X.K()\n- << \", 'K' = \" << this->K << \", 'n_frames' = \" << this->n_frames << \").\";\n+ message << \"'X.size()' has to be equal to 'N' * 'n_frames' ('X.size()' = \" << X.size()\n+ << \", 'N' = \" << this->N << \", 'n_frames' = \" << this->n_frames << \").\";\nthrow tools::length_error(__FILE__, __LINE__, __func__, message.str());\n}\n- if ((int)Y.K() != this->K * this->n_frames)\n+ if ((int)Y.size() != this->N * this->n_frames)\n{\nstd::stringstream message;\n- message << \"'Y.K()' has to be equal to 'K' * 'n_frames' ('Y.K()' = \" << Y.K()\n- << \", 'K' = \" << this->K << \", 'n_frames' = \" << this->n_frames << \").\";\n+ message << \"'Y.size()' has to be equal to 'N' * 'n_frames' ('Y.size()' = \" << Y.size()\n+ << \", 'N' = \" << this->N << \", 'n_frames' = \" << this->n_frames << \").\";\nthrow tools::length_error(__FILE__, __LINE__, __func__, message.str());\n}\n@@ -82,7 +82,7 @@ public:\nthrow tools::length_error(__FILE__, __LINE__, __func__, message.str());\n}\n- return this->check_errors(X.data(), Y.data(), frame_id);\n+ return this->get_mutual_info(X.data(), Y.data(), frame_id);\n}\nvirtual R get_mutual_info(const B *X, const R *Y, const int frame_id = -1);\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix Monitor MI on 'std::vector' type.
8,488
02.04.2019 10:45:27
-7,200
66c3e1645a021fc39be976227fd94bc449708b63
Change cpack file name. Change ppa package name.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -18,14 +18,13 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nset(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})\nset(CPACK_DEBIAN_PACKAGE_SECTION \"devel\")\nset(CPACK_DEBIAN_PACKAGE_PRIORITY \"optional\")\n- set(DEBIAN_PACKAGE_VERSION \"${CPACK_PACKAGE_VERSION}~${DISTRI}1\")\n- set(DEBIAN_SOURCE_DIR ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${CPACK_DEBIAN_PACKAGE_NAME}_${DEBIAN_PACKAGE_VERSION})\n+ set(DEBIAN_SOURCE_DIR ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION})\nset(DEBIAN_CONTROL ${DEBIAN_SOURCE_DIR}/debian/control)\nset(DEBIAN_COPYRIGHT ${DEBIAN_SOURCE_DIR}/debian/copyright)\nset(DEBIAN_RULES ${DEBIAN_SOURCE_DIR}/debian/rules)\nset(DEBIAN_CHANGELOG ${DEBIAN_SOURCE_DIR}/debian/changelog)\n- set(DEBIAN_SOURCE_CHANGES ${CPACK_DEBIAN_PACKAGE_NAME}_${DEBIAN_PACKAGE_VERSION}_source.changes)\n- set(PACKAGE_FILE_NAME \"${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}\")\n+ set(DEBIAN_SOURCE_CHANGES ${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_source.changes)\n+ set(PACKAGE_FILE_NAME \"${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}\")\nset(ORIG_FILE \"${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${PACKAGE_FILE_NAME}.orig.tar.gz\")\nset(DPUT_HOST \"ppa:aff3ct/aff3ct\")\nif(CHANGELOG_MESSAGE) # TODO get it from git\n@@ -59,24 +58,6 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n\"Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\\n\"\n\"${DEBIAN_LONG_DESCRIPTION}\\n\")\n- foreach(COMPONENT ${CPACK_COMPONENTS_ALL})\n- string(TOUPPER ${COMPONENT} UPPER_COMPONENT)\n- set(DEPENDS \"${CPACK_DEBIAN_PACKAGE_NAME}\")\n- foreach(DEP ${CPACK_COMPONENT_${UPPER_COMPONENT}_DEPENDS})\n- set(DEPENDS \"${DEPENDS}, ${CPACK_DEBIAN_PACKAGE_NAME}-${DEP}\")\n- endforeach(DEP ${CPACK_COMPONENT_${UPPER_COMPONENT}_DEPENDS})\n- set(DEPENDS \"${DEPENDS}, \\${misc:Depends}\")\n- file(APPEND ${DEBIAN_CONTROL} \"\\n\"\n- \"Package: ${CPACK_DEBIAN_PACKAGE_NAME}-${COMPONENT}\\n\"\n- \"Architecture: ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}\\n\"\n- \"Depends: ${DEPENDS}\\n\"\n- \"Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\"\n- \": ${CPACK_COMPONENT_${UPPER_COMPONENT}_DISPLAY_NAME}\\n\"\n- \"${DEBIAN_LONG_DESCRIPTION}\"\n- \"\\n .\\n\"\n- \" ${CPACK_COMPONENT_${UPPER_COMPONENT}_DESCRIPTION}\\n\")\n- endforeach(COMPONENT ${CPACK_COMPONENTS_ALL})\n-\n##############################################################################\n# debian/copyright\nconfigure_file(${CPACK_RESOURCE_FILE_LICENSE} ${DEBIAN_COPYRIGHT} COPYONLY)\n@@ -117,7 +98,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nOUTPUT_VARIABLE DATE_TIME\nOUTPUT_STRIP_TRAILING_WHITESPACE)\nfile(WRITE ${DEBIAN_CHANGELOG}\n- \"${CPACK_DEBIAN_PACKAGE_NAME} (${DEBIAN_PACKAGE_VERSION}) ${DISTRI}; urgency=low\\n\\n\"\n+ \"${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) ${DISTRI}; urgency=low\\n\\n\"\n\" ${output_changelog_msg}\\n\\n\"\n\" -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${DATE_TIME}\\n\\n\")\nfile(APPEND ${DEBIAN_CHANGELOG} ${DEBIAN_CHANGELOG_content})\n@@ -128,7 +109,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nOUTPUT_VARIABLE DATE_TIME\nOUTPUT_STRIP_TRAILING_WHITESPACE)\nfile(WRITE ${DEBIAN_CHANGELOG}\n- \"${CPACK_DEBIAN_PACKAGE_NAME} (${DEBIAN_PACKAGE_VERSION}) ${DISTRI}; urgency=low\\n\\n\"\n+ \"${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) ${DISTRI}; urgency=low\\n\\n\"\n\" ${output_changelog_msg}\\n\\n\"\n\" -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${DATE_TIME}\\n\")\nendif()\n" } ]
C++
MIT License
aff3ct/aff3ct
Change cpack file name. Change ppa package name.
8,488
02.04.2019 16:33:56
-7,200
c04233a213e036e0f819677491cf8d748e687b4d
CI: Integrate ppa uploading in CI.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -1224,6 +1224,35 @@ deploy-builds-linux:\n- source ./ci/tools/git-version.sh\n- ./ci/deploy-builds-linux.sh build_linux_gcc_x64_sse4.2 build_linux_gcc_x64_avx2 build_windows_gcc_x86_sse4.2 build_windows_gcc_x64_avx2 build_macos_clang_x64_sse4.2\n+deploy-upload-ppa:\n+ stage: deploy\n+ variables:\n+ GIT_SUBMODULE_STRATEGY: recursive\n+ except:\n+ - schedules\n+ dependencies:\n+ - build-linux-gcc-x64-sse4.2\n+ tags:\n+ - linux\n+ - gcc\n+ - cmake\n+ - x86\n+ - 64-bit\n+ - ppa\n+ artifacts:\n+ name: build-linux-gcc-x64-sse4.2\n+ paths:\n+ - build_linux_gcc_x64_sse4.2\n+ script:\n+ - export CC=\"gcc\"\n+ - export CXX=\"g++\"\n+ - export CFLAGS=\"-Wall -funroll-loops -m64 -msse4.2\"\n+ - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n+ - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n+ - export NAME=\"build_linux_gcc_x64_sse4.2\"\n+ - source ./ci/tools/threads.sh\n+ - ./ci/deploy-upload-ppa.sh\n+\npages:\nstage: deploy\nexcept:\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ci/deploy-upload-ppa.sh", "diff": "+#!/bin/bash\n+set -x\n+\n+cmake --version\n+mkdir build\n+cd build\n+\n+if [ -z \"$CXX\" ]\n+then\n+ echo \"Please define the 'CXX' environment variable.\"\n+ exit 1\n+fi\n+\n+if [ -z \"$THREADS\" ]\n+then\n+ echo \"The 'THREADS' environment variable is not set, default value = 1.\"\n+ THREADS=1\n+fi\n+\n+if [ -z \"$NAME\" ]\n+then\n+ echo \"The 'NAME' environment variable is not set, default value = 'build_deploy_upload_ppa'.\"\n+ NAME=\"build_deploy_upload_ppa\"\n+fi\n+\n+if [ -z \"$LFLAGS\" ]\n+then\n+ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CXX \\\n+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"$CFLAGS\" \\\n+ $CMAKE_OPT -DCMAKE_INSTALL_PREFIX=\"$NAME\" \\\n+ -DAFF3CT_UPLOAD_PPA=\"ON\"\n+ rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+else\n+ cmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CXX \\\n+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"$CFLAGS\" \\\n+ -DCMAKE_EXE_LINKER_FLAGS=\"$LFLAGS\" \\\n+ $CMAKE_OPT -DCMAKE_INSTALL_PREFIX=\"$NAME\" \\\n+ -DAFF3CT_UPLOAD_PPA=\"ON\"\n+ rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+fi\n+\n+make -j $THREADS -k\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+rm -rf $NAME\n+make install > /dev/null\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+mv $NAME ../\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: Integrate ppa uploading in CI.
8,488
04.04.2019 09:06:51
-7,200
b498628cb084ba5032bbeb167a23ed955251be0f
CI: Try to fix debsign.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -1230,8 +1230,6 @@ deploy-upload-ppa:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\ntags:\n- linux\n- gcc\n@@ -1240,9 +1238,9 @@ deploy-upload-ppa:\n- 64-bit\n- ppa\nartifacts:\n- name: build-linux-gcc-x64-sse4.2\n+ name: build\npaths:\n- - build_linux_gcc_x64_sse4.2\n+ - build\nscript:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n" }, { "change_type": "MODIFY", "old_path": "ci/deploy-upload-ppa.sh", "new_path": "ci/deploy-upload-ppa.sh", "diff": "@@ -5,6 +5,8 @@ cmake --version\nmkdir build\ncd build\n+export GPG_TTY=$(tty)\n+\nif [ -z \"$CXX\" ]\nthen\necho \"Please define the 'CXX' environment variable.\"\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: Try to fix debsign.
8,490
08.04.2019 17:18:06
-7,200
8cb652e40632a67e59df021edccec430c3c53efa
Generic polar mono-kernel is working!
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "new_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "diff": "@@ -58,7 +58,7 @@ void Decoder_polar_MK::parameters\ntemplate <typename B, typename Q>\nmodule::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\n-::build(const std::vector<bool> &frozen_bits, module::CRC<B> *crc,\n+::build(const tools::Polar_code &code, const std::vector<bool> &frozen_bits, module::CRC<B> *crc,\nconst std::unique_ptr<module::Encoder<B>>& encoder) const\n{\ntry\n@@ -73,7 +73,7 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\n{\nif (crc == nullptr || crc->get_size() == 0)\n{\n- if (this->type == \"SC\") return new module::Decoder_polar_MK_SC_naive<B,Q>(this->K, this->N_cw, frozen_bits, 2, this->n_frames);\n+ if (this->type == \"SC\") return new module::Decoder_polar_MK_SC_naive<B,Q>(this->K, this->N_cw, code, frozen_bits, this->n_frames);\n}\n}\n}\n@@ -84,25 +84,25 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\ntemplate <typename B, typename Q>\nmodule::Decoder_SIHO<B,Q>* Decoder_polar_MK\n-::build(const parameters& params, const std::vector<bool> &frozen_bits, module::CRC<B> *crc,\n- const std::unique_ptr<module::Encoder<B>>& encoder)\n+::build(const parameters& params, const tools::Polar_code &code, const std::vector<bool> &frozen_bits,\n+ module::CRC<B> *crc, const std::unique_ptr<module::Encoder<B>>& encoder)\n{\n- return params.template build<B,Q>(frozen_bits, crc, encoder);\n+ return params.template build<B,Q>(code, frozen_bits, crc, encoder);\n}\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef AFF3CT_MULTI_PREC\n-template aff3ct::module::Decoder_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder_polar_MK::parameters::build<B_8 ,Q_8 >(const std::vector<bool>&, module::CRC<B_8 >*, const std::unique_ptr<module::Encoder<B_8 >>&) const;\n-template aff3ct::module::Decoder_SIHO<B_16,Q_16>* aff3ct::factory::Decoder_polar_MK::parameters::build<B_16,Q_16>(const std::vector<bool>&, module::CRC<B_16>*, const std::unique_ptr<module::Encoder<B_16>>&) const;\n-template aff3ct::module::Decoder_SIHO<B_32,Q_32>* aff3ct::factory::Decoder_polar_MK::parameters::build<B_32,Q_32>(const std::vector<bool>&, module::CRC<B_32>*, const std::unique_ptr<module::Encoder<B_32>>&) const;\n-template aff3ct::module::Decoder_SIHO<B_64,Q_64>* aff3ct::factory::Decoder_polar_MK::parameters::build<B_64,Q_64>(const std::vector<bool>&, module::CRC<B_64>*, const std::unique_ptr<module::Encoder<B_64>>&) const;\n-template aff3ct::module::Decoder_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder_polar_MK::build<B_8 ,Q_8 >(const aff3ct::factory::Decoder_polar_MK::parameters&, const std::vector<bool>&, module::CRC<B_8 >*, const std::unique_ptr<module::Encoder<B_8 >>&);\n-template aff3ct::module::Decoder_SIHO<B_16,Q_16>* aff3ct::factory::Decoder_polar_MK::build<B_16,Q_16>(const aff3ct::factory::Decoder_polar_MK::parameters&, const std::vector<bool>&, module::CRC<B_16>*, const std::unique_ptr<module::Encoder<B_16>>&);\n-template aff3ct::module::Decoder_SIHO<B_32,Q_32>* aff3ct::factory::Decoder_polar_MK::build<B_32,Q_32>(const aff3ct::factory::Decoder_polar_MK::parameters&, const std::vector<bool>&, module::CRC<B_32>*, const std::unique_ptr<module::Encoder<B_32>>&);\n-template aff3ct::module::Decoder_SIHO<B_64,Q_64>* aff3ct::factory::Decoder_polar_MK::build<B_64,Q_64>(const aff3ct::factory::Decoder_polar_MK::parameters&, const std::vector<bool>&, module::CRC<B_64>*, const std::unique_ptr<module::Encoder<B_64>>&);\n+template aff3ct::module::Decoder_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder_polar_MK::parameters::build<B_8 ,Q_8 >(const tools::Polar_code&, const std::vector<bool>&, module::CRC<B_8 >*, const std::unique_ptr<module::Encoder<B_8 >>&) const;\n+template aff3ct::module::Decoder_SIHO<B_16,Q_16>* aff3ct::factory::Decoder_polar_MK::parameters::build<B_16,Q_16>(const tools::Polar_code&, const std::vector<bool>&, module::CRC<B_16>*, const std::unique_ptr<module::Encoder<B_16>>&) const;\n+template aff3ct::module::Decoder_SIHO<B_32,Q_32>* aff3ct::factory::Decoder_polar_MK::parameters::build<B_32,Q_32>(const tools::Polar_code&, const std::vector<bool>&, module::CRC<B_32>*, const std::unique_ptr<module::Encoder<B_32>>&) const;\n+template aff3ct::module::Decoder_SIHO<B_64,Q_64>* aff3ct::factory::Decoder_polar_MK::parameters::build<B_64,Q_64>(const tools::Polar_code&, const std::vector<bool>&, module::CRC<B_64>*, const std::unique_ptr<module::Encoder<B_64>>&) const;\n+template aff3ct::module::Decoder_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder_polar_MK::build<B_8 ,Q_8 >(const aff3ct::factory::Decoder_polar_MK::parameters&, const tools::Polar_code&, const std::vector<bool>&, module::CRC<B_8 >*, const std::unique_ptr<module::Encoder<B_8 >>&);\n+template aff3ct::module::Decoder_SIHO<B_16,Q_16>* aff3ct::factory::Decoder_polar_MK::build<B_16,Q_16>(const aff3ct::factory::Decoder_polar_MK::parameters&, const tools::Polar_code&, const std::vector<bool>&, module::CRC<B_16>*, const std::unique_ptr<module::Encoder<B_16>>&);\n+template aff3ct::module::Decoder_SIHO<B_32,Q_32>* aff3ct::factory::Decoder_polar_MK::build<B_32,Q_32>(const aff3ct::factory::Decoder_polar_MK::parameters&, const tools::Polar_code&, const std::vector<bool>&, module::CRC<B_32>*, const std::unique_ptr<module::Encoder<B_32>>&);\n+template aff3ct::module::Decoder_SIHO<B_64,Q_64>* aff3ct::factory::Decoder_polar_MK::build<B_64,Q_64>(const aff3ct::factory::Decoder_polar_MK::parameters&, const tools::Polar_code&, const std::vector<bool>&, module::CRC<B_64>*, const std::unique_ptr<module::Encoder<B_64>>&);\n#else\n-template aff3ct::module::Decoder_SIHO<B,Q>* aff3ct::factory::Decoder_polar_MK::parameters::build<B,Q>(const std::vector<bool>&, module::CRC<B>*, const std::unique_ptr<module::Encoder<B>>& ) const;\n-template aff3ct::module::Decoder_SIHO<B,Q>* aff3ct::factory::Decoder_polar_MK::build<B,Q>(const aff3ct::factory::Decoder_polar_MK::parameters&, const std::vector<bool>&, module::CRC<B>*, const std::unique_ptr<module::Encoder<B>>& );\n+template aff3ct::module::Decoder_SIHO<B,Q>* aff3ct::factory::Decoder_polar_MK::parameters::build<B,Q>(const tools::Polar_code&, const std::vector<bool>&, module::CRC<B>*, const std::unique_ptr<module::Encoder<B>>&) const;\n+template aff3ct::module::Decoder_SIHO<B,Q>* aff3ct::factory::Decoder_polar_MK::build<B,Q>(const aff3ct::factory::Decoder_polar_MK::parameters&, const tools::Polar_code&, const std::vector<bool>&, module::CRC<B>*, const std::unique_ptr<module::Encoder<B>>&);\n#endif\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.hpp", "new_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.hpp", "diff": "#include \"Module/Decoder/Decoder_SIHO.hpp\"\n#include \"Module/Encoder/Encoder.hpp\"\n+#include \"Tools/Code/Polar/Polar_code.hpp\"\n+\n#include \"../Decoder.hpp\"\nnamespace aff3ct\n@@ -37,7 +39,8 @@ struct Decoder_polar_MK : public Decoder\n// builder\ntemplate <typename B = int, typename Q = float>\n- module::Decoder_SIHO<B,Q>* build(const std::vector<bool> &frozen_bits, module::CRC<B> *crc = nullptr,\n+ module::Decoder_SIHO<B,Q>* build(const tools::Polar_code &code, const std::vector<bool> &frozen_bits,\n+ module::CRC<B> *crc = nullptr,\nconst std::unique_ptr<module::Encoder<B>>& encoder = nullptr) const;\nprotected:\n@@ -45,7 +48,9 @@ struct Decoder_polar_MK : public Decoder\n};\ntemplate <typename B = int, typename Q = float>\n- static module::Decoder_SIHO<B,Q>* build(const parameters& params, const std::vector<bool> &frozen_bits,\n+ static module::Decoder_SIHO<B,Q>* build(const parameters& params,\n+ const tools::Polar_code &code,\n+ const std::vector<bool> &frozen_bits,\nmodule::CRC<B> *crc = nullptr,\nconst std::unique_ptr<module::Encoder<B>>& encoder = nullptr);\n};\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.cpp", "new_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.cpp", "diff": "@@ -80,7 +80,8 @@ Codec_polar_MK<B,Q>\nthis->set_encoder(factory::Encoder::build<B>(enc_params));\n}\n- this->set_decoder_siho(factory::Decoder_polar_MK::build<B,Q>(dec_params, frozen_bits, crc, this->get_encoder()));\n+ this->set_decoder_siho(factory::Decoder_polar_MK::build<B,Q>(dec_params, *code.get(), frozen_bits, crc,\n+ this->get_encoder()));\nthis->fb_decoder = dynamic_cast<tools::Frozenbits_notifier*>(this->get_decoder_siho().get());\n// ------------------------------------------------------------------------------------------------- frozen bit gen\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "+#include <cmath>\n+#include <chrono>\n+#include <sstream>\n+#include <algorithm>\n+\n+#include \"Tools/Exception/exception.hpp\"\n+#include \"Tools/Math/utils.h\"\n+\n+#include \"Decoder_polar_MK_SC_naive.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::module;\n+\n+template <typename B, typename R>\n+Decoder_polar_MK_SC_naive<B,R>\n+::Decoder_polar_MK_SC_naive(const int& K,\n+ const int& N,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ const int n_frames)\n+: Decoder (K, N, n_frames, 1),\n+ Decoder_SIHO<B,R>(K, N, n_frames, 1),\n+ code(code),\n+ frozen_bits(frozen_bits),\n+ polar_tree(code.get_stages().size() +1, code.get_kernel_matrices()[0].size()),\n+ Ke(code.get_kernel_matrices().size()),\n+ idx(code.get_biggest_kernel_size()),\n+ u(code.get_biggest_kernel_size()),\n+ LLRs(code.get_kernel_matrices()[0].size()),\n+ bits(code.get_kernel_matrices()[0].size() -1),\n+ lambdas(code.get_kernel_matrices()[0].size())\n+{\n+ const std::string name = \"Decoder_polar_MK_SC_naive\";\n+ this->set_name(name);\n+\n+ if (!code.is_mono_kernel())\n+ {\n+ std::stringstream message;\n+ message << \"'code.is_mono_kernel()' has to be true.\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ const auto base = code.get_kernel_matrices()[0].size();\n+ if (base < 2)\n+ {\n+ std::stringstream message;\n+ message << \"'base' has to be bigger or equal to 2 ('base' = \" << base << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (this->N != code.get_codeword_size())\n+ {\n+ std::stringstream message;\n+ message << \"'N' has to be equal to 'code.get_codeword_size()' ('N' = \" << N\n+ << \", 'code.get_codeword_size()' = \" << code.get_codeword_size() << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (this->N != (int)frozen_bits.size())\n+ {\n+ std::stringstream message;\n+ message << \"'frozen_bits.size()' has to be equal to 'N' ('frozen_bits.size()' = \" << frozen_bits.size()\n+ << \", 'N' = \" << N << \").\";\n+ throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ auto k = 0; for (auto i = 0; i < this->N; i++) if (frozen_bits[i] == 0) k++;\n+ if (this->K != k)\n+ {\n+ std::stringstream message;\n+ message << \"The number of information bits in the frozen_bits is invalid ('K' = \" << K << \", 'k' = \"\n+ << k << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ this->recursive_allocate_nodes_contents(this->polar_tree.get_root(), this->N);\n+ this->recursive_initialize_frozen_bits(this->polar_tree.get_root(), frozen_bits);\n+\n+ for (auto ke = 0; ke < (int)this->code.get_kernel_matrices().size(); ke++)\n+ {\n+ const auto kernel_size = (int)this->code.get_kernel_matrices()[ke].size();\n+ Ke[ke].resize(kernel_size * kernel_size);\n+ for (auto i = 0; i < kernel_size; i++)\n+ for (auto j = 0; j < kernel_size; j++)\n+ this->Ke[ke][i * kernel_size +j] = (B)this->code.get_kernel_matrices()[ke][j][i];\n+ }\n+\n+ auto same_polar_kernel = [](const std::vector<std::vector<bool>>& a, const std::vector<std::vector<bool>>& b) {\n+ if (a.size() != b.size())\n+ return false;\n+\n+ for (size_t i = 0; i < a.size(); i++)\n+ {\n+ if (a[i].size() != b[i].size())\n+ return false;\n+ for (size_t j = 0; j < a[i].size(); j++)\n+ if (a[i][j] != b[i][j])\n+ return false;\n+ }\n+\n+ return true;\n+ };\n+\n+ if (same_polar_kernel(code.get_kernel_matrices()[0], {{1,0},{1,1}})) // Arikan kernel\n+ {\n+ lambdas[0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ // return tools::f_LLR<R>(LLRs[0], LLRs[1]);\n+ auto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]);\n+ auto abs0 = std::abs(LLRs[0]);\n+ auto abs1 = std::abs(LLRs[1]);\n+ auto min = std::min(abs0, abs1);\n+\n+ return sign ? -min : min;\n+ };\n+\n+ lambdas[1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ // return tools::g_LLR<B,R>(LLRs[0], LLRs[1], bits[0]);\n+ return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n+ };\n+ }\n+ else if (same_polar_kernel(code.get_kernel_matrices()[0], {{1,1,1},{1,0,1},{0,1,1}}))\n+ {\n+ lambdas[0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\n+ auto abs0 = std::abs(LLRs[0]);\n+ auto abs1 = std::abs(LLRs[1]);\n+ auto abs2 = std::abs(LLRs[2]);\n+ auto min = std::min(std::min(abs0, abs1), abs2);\n+\n+ return sign ? -min : min;\n+ };\n+\n+ lambdas[1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\n+ auto abs1 = std::abs(LLRs[1]);\n+ auto abs2 = std::abs(LLRs[2]);\n+ auto min = std::min(abs1, abs2);\n+\n+ auto l1_l2 = sign ? -min : min;\n+\n+ return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_l2;\n+ };\n+\n+ lambdas[2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ return (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n+ (((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n+ };\n+ }\n+ else if (same_polar_kernel(code.get_kernel_matrices()[0], {{1,0,0},{1,1,0},{1,0,1}}))\n+ {\n+ lambdas[0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\n+ auto abs0 = std::abs(LLRs[0]);\n+ auto abs1 = std::abs(LLRs[1]);\n+ auto abs2 = std::abs(LLRs[2]);\n+ auto min = std::min(std::min(abs0, abs1), abs2);\n+\n+ return sign ? -min : min;\n+ };\n+\n+ lambdas[1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = ((bits[0] == 0) ? LLRs[0] : -LLRs[0]);\n+\n+ auto sign = std::signbit(hl0) ^ std::signbit(LLRs[2]);\n+ auto abs0 = std::abs(hl0);\n+ auto abs2 = std::abs(LLRs[2]);\n+ auto min = std::min(abs0, abs2);\n+ auto hl0_l2 = sign ? -min : min;\n+\n+ return hl0_l2 + LLRs[1];\n+ };\n+\n+ lambdas[2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = (((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0]);\n+\n+ return hl0 + LLRs[2];\n+ };\n+ }\n+ else\n+ {\n+ std::stringstream message;\n+ message << \"Unsupported polar kernel.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+}\n+\n+template <typename B, typename R>\n+Decoder_polar_MK_SC_naive<B,R>\n+::~Decoder_polar_MK_SC_naive()\n+{\n+ this->recursive_deallocate_nodes_contents(this->polar_tree.get_root());\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::notify_frozenbits_update()\n+{\n+ this->recursive_initialize_frozen_bits(this->polar_tree.get_root(), frozen_bits);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::_load(const R *Y_N)\n+{\n+ auto *contents = this->polar_tree.get_root()->get_contents();\n+\n+ for (auto i = 0; i < this->N; i++)\n+ contents->l[i] = Y_N[i];\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::_decode_siho(const R *Y_N, B *V_K, const int frame_id)\n+{\n+// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\n+ this->_load(Y_N);\n+// auto d_load = std::chrono::steady_clock::now() - t_load;\n+\n+// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n+ this->recursive_decode(this->polar_tree.get_root());\n+// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n+\n+// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n+ this->_store(V_K);\n+// auto d_store = std::chrono::steady_clock::now() - t_store;\n+\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::load, d_load);\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::decode, d_decod);\n+// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::store, d_store);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::_decode_siho_cw(const R *Y_N, B *V_N, const int frame_id)\n+{\n+// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\n+ this->_load(Y_N);\n+// auto d_load = std::chrono::steady_clock::now() - t_load;\n+\n+// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n+ this->recursive_decode(this->polar_tree.get_root());\n+// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n+\n+// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n+ this->_store(V_N, true);\n+// auto d_store = std::chrono::steady_clock::now() - t_store;\n+\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::load, d_load);\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::decode, d_decod);\n+// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::store, d_store);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::_store(B *V, bool coded) const\n+{\n+ if (!coded)\n+ {\n+ auto k = 0;\n+ this->recursive_store(this->polar_tree.get_root(), V, k);\n+ }\n+ else\n+ {\n+ auto *contents_root = this->polar_tree.get_root()->get_c();\n+ std::copy(contents_root->s.begin(), contents_root->s.begin() + this->N, V);\n+ }\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::recursive_allocate_nodes_contents(tools::Generic_node<Contents_MK_SC<B,R>>* node_curr, const int vector_size)\n+{\n+ const int stage = node_curr->is_root() ? this->code.get_stages().size()-1 : node_curr->get_father()->get_c()->stage -1;\n+\n+ node_curr->set_contents(new Contents_MK_SC<B,R>(vector_size, stage));\n+\n+ for (auto c : node_curr->get_children())\n+ this->recursive_allocate_nodes_contents(c, vector_size / this->code.get_kernel_matrices()[0].size());\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::recursive_initialize_frozen_bits(const tools::Generic_node<Contents_MK_SC<B,R>>* node_curr,\n+ const std::vector<bool>& frozen_bits)\n+{\n+ auto *contents = node_curr->get_contents();\n+\n+ if (!node_curr->is_leaf()) // stop condition\n+ {\n+ for (auto c : node_curr->get_children())\n+ this->recursive_initialize_frozen_bits(c, frozen_bits); // recursive call\n+ }\n+ else\n+ contents->is_frozen_bit = frozen_bits[node_curr->get_lane_id()];\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::recursive_decode(const tools::Generic_node<Contents_MK_SC<B,R>>* node_curr)\n+{\n+ if (!node_curr->is_leaf()) // stop condition\n+ {\n+ const auto kern_size = (int)node_curr->get_children().size();\n+ const auto size = (int)node_curr->get_c()->l.size();\n+ const auto sub_part = size / kern_size;\n+\n+ for (auto child = 0; child < kern_size; child++)\n+ {\n+ const auto *node_child = node_curr->get_children()[child];\n+\n+ for (auto i = 0; i < sub_part; i++)\n+ {\n+ for (auto l = 0; l < kern_size; l++) LLRs[l] = node_curr->get_c()->l[l * sub_part +i];\n+ for (auto c = 0; c < child; c++) bits[c] = node_curr->get_children()[c]->get_c()->s[i];\n+\n+ node_child->get_c()->l[i] = lambdas[child](LLRs, bits);\n+ }\n+\n+ this->recursive_decode(node_child); // recursive call\n+ }\n+\n+ auto encode_polar_kernel = [](const B *u, const uint32_t *idx, const B *Ke, B *x, const int size)\n+ {\n+ for (auto i = 0; i < size; i++)\n+ {\n+ const auto stride = i * size;\n+ auto sum = 0;\n+ for (auto j = 0; j < size; j++)\n+ sum += u[j] & Ke[stride +j];\n+ x[idx[i]] = sum & (B)1;\n+ }\n+ };\n+\n+ // re-encode the bits (partial sums) (generalized to all kernels)\n+ const auto s = node_curr->get_c()->stage;\n+ const auto n_kernels = (int)node_curr->get_c()->s.size() / kern_size;\n+ for (auto k = 0; k < n_kernels; k++)\n+ {\n+ for (auto i = 0; i < kern_size; i++)\n+ {\n+ this->idx[i] = (uint32_t)(n_kernels * i +k);\n+ this->u[i] = node_curr->get_children()[(this->idx[i]/sub_part)]->get_c()->s[this->idx[i]%sub_part];\n+ }\n+\n+ encode_polar_kernel(this->u.data(),\n+ this->idx.data(),\n+ this->Ke[code.get_stages()[s]].data(),\n+ node_curr->get_c()->s.data(),\n+ kern_size);\n+ }\n+ }\n+ else // specific leaf treatment\n+ {\n+ node_curr->get_c()->s[0] = (!node_curr->get_c()->is_frozen_bit && // if this is a frozen bit then s == 0\n+ tools::h_LLR<B,R>(node_curr->get_c()->l[0])); // apply h()\n+ }\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::recursive_store(const tools::Generic_node<Contents_MK_SC<B,R>>* node_curr, B *V_K, int &k) const\n+{\n+ auto *contents = node_curr->get_contents();\n+\n+ if (!node_curr->is_leaf()) // stop condition\n+ for (auto c : node_curr->get_children())\n+ this->recursive_store(c, V_K, k); // recursive call\n+ else\n+ if (!frozen_bits[node_curr->get_lane_id()])\n+ V_K[k++] = contents->s[0];\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive<B,R>\n+::recursive_deallocate_nodes_contents(tools::Generic_node<Contents_MK_SC<B,R>>* node_curr)\n+{\n+ if (node_curr != nullptr)\n+ {\n+ for (auto c : node_curr->get_children())\n+ this->recursive_deallocate_nodes_contents(c); // recursive call\n+\n+ auto *contents = node_curr->get_contents();\n+ delete contents;\n+ node_curr->set_contents(nullptr);\n+ }\n+}\n+\n+// ==================================================================================== explicit template instantiation\n+#include \"Tools/types.h\"\n+#ifdef AFF3CT_MULTI_PREC\n+template class aff3ct::module::Decoder_polar_MK_SC_naive<B_8,Q_8>;\n+template class aff3ct::module::Decoder_polar_MK_SC_naive<B_16,Q_16>;\n+template class aff3ct::module::Decoder_polar_MK_SC_naive<B_32,Q_32>;\n+template class aff3ct::module::Decoder_polar_MK_SC_naive<B_64,Q_64>;\n+#else\n+template class aff3ct::module::Decoder_polar_MK_SC_naive<B,Q>;\n+#endif\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp", "diff": "#include \"Tools/Algo/Tree/Generic/Generic_tree.hpp\"\n#include \"Tools/Code/Polar/decoder_polar_functions.h\"\n#include \"Tools/Code/Polar/Frozenbits_notifier.hpp\"\n+#include \"Tools/Code/Polar/Polar_code.hpp\"\n#include \"../../Decoder_SIHO.hpp\"\n@@ -17,11 +18,12 @@ template <typename B = int, typename R = float>\nclass Contents_MK_SC\n{\npublic:\n- std::vector<R> lambda;\n+ std::vector<R> l;\nstd::vector<B> s;\nbool is_frozen_bit;\n+ int stage;\n- explicit Contents_MK_SC(int size) : lambda(size), s(size), is_frozen_bit(false) {}\n+ explicit Contents_MK_SC(int size, int stage = -1) : l(size), s(size), is_frozen_bit(false), stage(stage) {}\nvirtual ~Contents_MK_SC() {}\n};\n@@ -29,17 +31,22 @@ template <typename B = int, typename R = float>\nclass Decoder_polar_MK_SC_naive : public Decoder_SIHO<B,R>, public tools::Frozenbits_notifier\n{\nprotected:\n- const int base;\n- const int m; // graph depth\n-\n+ const tools::Polar_code &code;\nconst std::vector<bool> &frozen_bits;\ntools::Generic_tree<Contents_MK_SC<B,R>> polar_tree;\n+ std::vector<std::vector<B>> Ke;\n+ std::vector<uint32_t> idx;\n+ std::vector<B> u;\n+\n+ std::vector<R> LLRs;\n+ std::vector<B> bits;\n+ std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>> lambdas;\npublic:\nDecoder_polar_MK_SC_naive(const int& K,\nconst int& N,\n+ const tools::Polar_code& code,\nconst std::vector<bool>& frozen_bits,\n- const int base,\nconst int n_frames = 1);\nvirtual ~Decoder_polar_MK_SC_naive();\n@@ -61,6 +68,4 @@ private:\n}\n}\n-#include \"Decoder_polar_MK_SC_naive.hxx\"\n-\n#endif /* DECODER_POLAR_MK_SC_NAIVE_ */\n" }, { "change_type": "DELETE", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hxx", "new_path": null, "diff": "-#include <chrono>\n-#include <algorithm>\n-#include <sstream>\n-\n-#include \"Tools/Exception/exception.hpp\"\n-#include \"Tools/Math/utils.h\"\n-\n-#include \"Decoder_polar_MK_SC_naive.hpp\"\n-\n-namespace aff3ct\n-{\n-namespace module\n-{\n-template <typename B, typename R>\n-Decoder_polar_MK_SC_naive<B,R>\n-::Decoder_polar_MK_SC_naive(const int& K,\n- const int& N,\n- const std::vector<bool>& frozen_bits,\n- const int base,\n- const int n_frames)\n-: Decoder (K, N, n_frames, 1),\n- Decoder_SIHO<B,R>(K, N, n_frames, 1),\n- base(base), m((int)std::log2(N)), frozen_bits(frozen_bits), polar_tree(m +1, 2)\n-{\n- const std::string name = \"Decoder_polar_MK_SC_naive\";\n- this->set_name(name);\n-\n- if (base < 2)\n- {\n- std::stringstream message;\n- message << \"'base' has to be bigger or equal to 2 ('base' = \" << this->base << \").\";\n- throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n- }\n-\n- if (!tools::is_power_of_2(this->N))\n- {\n- std::stringstream message;\n- message << \"'N' has to be a power of 2 ('N' = \" << N << \").\";\n- throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n- }\n-\n- if (this->N != (int)frozen_bits.size())\n- {\n- std::stringstream message;\n- message << \"'frozen_bits.size()' has to be equal to 'N' ('frozen_bits.size()' = \" << frozen_bits.size()\n- << \", 'N' = \" << N << \").\";\n- throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n- }\n-\n- auto k = 0; for (auto i = 0; i < this->N; i++) if (frozen_bits[i] == 0) k++;\n- if (this->K != k)\n- {\n- std::stringstream message;\n- message << \"The number of information bits in the frozen_bits is invalid ('K' = \" << K << \", 'k' = \"\n- << k << \").\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n-\n- this->recursive_allocate_nodes_contents(this->polar_tree.get_root(), this->N);\n- this->recursive_initialize_frozen_bits(this->polar_tree.get_root(), frozen_bits);\n-}\n-\n-template <typename B, typename R>\n-Decoder_polar_MK_SC_naive<B,R>\n-::~Decoder_polar_MK_SC_naive()\n-{\n- this->recursive_deallocate_nodes_contents(this->polar_tree.get_root());\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::notify_frozenbits_update()\n-{\n- this->recursive_initialize_frozen_bits(this->polar_tree.get_root(), frozen_bits);\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::_load(const R *Y_N)\n-{\n- auto *contents = this->polar_tree.get_root()->get_contents();\n-\n- for (auto i = 0; i < this->N; i++)\n- contents->lambda[i] = Y_N[i];\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::_decode_siho(const R *Y_N, B *V_K, const int frame_id)\n-{\n-// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\n- this->_load(Y_N);\n-// auto d_load = std::chrono::steady_clock::now() - t_load;\n-\n-// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- this->recursive_decode(this->polar_tree.get_root());\n-// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n-\n-// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- this->_store(V_K);\n-// auto d_store = std::chrono::steady_clock::now() - t_store;\n-\n-// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::load, d_load);\n-// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::decode, d_decod);\n-// (*this)[dec::tsk::decode_siho].update_timer(dec::tm::decode_siho::store, d_store);\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::_decode_siho_cw(const R *Y_N, B *V_N, const int frame_id)\n-{\n-// auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- LOAD\n- this->_load(Y_N);\n-// auto d_load = std::chrono::steady_clock::now() - t_load;\n-\n-// auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- DECODE\n- this->recursive_decode(this->polar_tree.get_root());\n-// auto d_decod = std::chrono::steady_clock::now() - t_decod;\n-\n-// auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- STORE\n- this->_store(V_N, true);\n-// auto d_store = std::chrono::steady_clock::now() - t_store;\n-\n-// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::load, d_load);\n-// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::decode, d_decod);\n-// (*this)[dec::tsk::decode_siho_cw].update_timer(dec::tm::decode_siho_cw::store, d_store);\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::_store(B *V, bool coded) const\n-{\n- if (!coded)\n- {\n- auto k = 0;\n- this->recursive_store(this->polar_tree.get_root(), V, k);\n- }\n- else\n- {\n- auto *contents_root = this->polar_tree.get_root()->get_c();\n- std::copy(contents_root->s.begin(), contents_root->s.begin() + this->N, V);\n- }\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::recursive_allocate_nodes_contents(tools::Generic_node<Contents_MK_SC<B,R>>* node_curr, const int vector_size)\n-{\n- node_curr->set_contents(new Contents_MK_SC<B,R>(vector_size));\n-\n- for (auto c : node_curr->get_children())\n- this->recursive_allocate_nodes_contents(c, vector_size / 2);\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::recursive_initialize_frozen_bits(const tools::Generic_node<Contents_MK_SC<B,R>>* node_curr,\n- const std::vector<bool>& frozen_bits)\n-{\n- auto *contents = node_curr->get_contents();\n-\n- if (!node_curr->is_leaf()) // stop condition\n- {\n- for (auto c : node_curr->get_children())\n- this->recursive_initialize_frozen_bits(c, frozen_bits); // recursive call\n- }\n- else\n- contents->is_frozen_bit = frozen_bits[node_curr->get_lane_id()];\n-}\n-\n-template <typename R>\n-R F(const R& lambda_a, const R& lambda_b)\n-{\n- return tools::f_LLR<R>(lambda_a, lambda_b);\n-}\n-\n-template <typename B, typename R>\n-R G(const R& lambda_a, const R& lambda_b, const B& u)\n-{\n- return tools::g_LLR<B,R>(lambda_a, lambda_b, u);\n-}\n-\n-template <typename B, typename R>\n-B H(const R& lambda_a)\n-{\n- return tools::h_LLR<B,R>(lambda_a);\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::recursive_decode(const tools::Generic_node<Contents_MK_SC<B,R>>* node_curr)\n-{\n- if (!node_curr->is_leaf()) // stop condition\n- {\n- const auto size = (int)node_curr->get_c()->lambda.size();\n- const auto size_2 = size / 2;\n-\n- const auto *node_left = node_curr->get_children()[0]; // get left node\n- const auto *node_right = node_curr->get_children()[1]; // get right node\n-\n- for (auto i = 0; i < size_2; i++)\n- node_left->get_c()->lambda[i] = F<R>(node_curr->get_c()->lambda[ i], // apply f()\n- node_curr->get_c()->lambda[size_2 +i]);\n-\n- this->recursive_decode(node_left); // recursive call\n-\n- for (auto i = 0; i < size_2; i++)\n- node_right->get_c()->lambda[i] = G<B,R>(node_curr->get_c()->lambda[ i], // apply g()\n- node_curr->get_c()->lambda[size_2 +i],\n- node_left->get_c()->s [ i]);\n-\n- this->recursive_decode(node_right); // recursive call\n-\n- for (auto i = 0; i < size_2; i++)\n- node_curr->get_c()->s[i] = node_left ->get_c()->s[i] ^ node_right->get_c()->s[i]; // bit xor\n-\n- for (auto i = 0; i < size_2; i++)\n- node_curr->get_c()->s[size_2 +i] = node_right->get_c()->s[i]; // bit eq\n- }\n- else // specific leaf treatment\n- {\n- node_curr->get_c()->s[0] = (!node_curr->get_c()->is_frozen_bit && // if this is a frozen bit then s == 0\n- H<B,R>(node_curr->get_c()->lambda[0])); // apply h()\n- }\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::recursive_store(const tools::Generic_node<Contents_MK_SC<B,R>>* node_curr, B *V_K, int &k) const\n-{\n- auto *contents = node_curr->get_contents();\n-\n- if (!node_curr->is_leaf()) // stop condition\n- for (auto c : node_curr->get_children())\n- this->recursive_store(c, V_K, k); // recursive call\n- else\n- if (!frozen_bits[node_curr->get_lane_id()])\n- V_K[k++] = contents->s[0];\n-}\n-\n-template <typename B, typename R>\n-void Decoder_polar_MK_SC_naive<B,R>\n-::recursive_deallocate_nodes_contents(tools::Generic_node<Contents_MK_SC<B,R>>* node_curr)\n-{\n- if (node_curr != nullptr)\n- {\n- for (auto c : node_curr->get_children())\n- this->recursive_deallocate_nodes_contents(c); // recursive call\n-\n- auto *contents = node_curr->get_contents();\n- delete contents;\n- node_curr->set_contents(nullptr);\n- }\n-}\n-}\n-}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp", "new_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp", "diff": "@@ -18,22 +18,15 @@ Encoder_polar_MK<B>\ncode(code),\nfrozen_bits(frozen_bits),\nKe(code.get_kernel_matrices().size()),\n- idx(),\n- u()\n+ idx(code.get_biggest_kernel_size()),\n+ u(code.get_biggest_kernel_size())\n{\nconst std::string name = \"Encoder_polar_MK\";\nthis->set_name(name);\nthis->set_sys(false);\n- size_t biggest_kernel_size = 0;\nfor (auto ke = 0; ke < (int)this->code.get_kernel_matrices().size(); ke++)\n- {\nKe[ke].resize(this->code.get_kernel_matrices()[ke].size() * this->code.get_kernel_matrices()[ke].size());\n- biggest_kernel_size = std::max(biggest_kernel_size, this->code.get_kernel_matrices()[ke].size());\n- }\n-\n- idx.resize(biggest_kernel_size);\n- u.resize(biggest_kernel_size);\nif (this->N != (int)this->frozen_bits.size())\n{\n@@ -74,7 +67,10 @@ void Encoder_polar_MK<B>\n}\ntemplate <typename B>\n-void polar_kernel(const B *u, const uint32_t *idx, const B *Ke, B *x, const int size)\n+void Encoder_polar_MK<B>\n+::light_encode(B *X_N)\n+{\n+ auto apply_polar_kernel = [](const B *u, const uint32_t *idx, const B *Ke, B *x, const int size)\n{\nfor (auto i = 0; i < size; i++)\n{\n@@ -84,12 +80,8 @@ void polar_kernel(const B *u, const uint32_t *idx, const B *Ke, B *x, const int\nsum += u[j] & Ke[stride +j];\nx[idx[i]] = sum & (B)1;\n}\n-}\n+ };\n-template <typename B>\n-void Encoder_polar_MK<B>\n-::light_encode(B *X_N)\n-{\nauto n_kernels = (int)1;\nfor (auto s = 0; s < (int)this->code.get_stages().size(); s++)\n{\n@@ -106,7 +98,11 @@ void Encoder_polar_MK<B>\nthis->u[i] = X_N[this->idx[i]];\n}\n- polar_kernel(this->u.data(), this->idx.data(), this->Ke[code.get_stages()[s]].data(), X_N, kernel_size);\n+ apply_polar_kernel(this->u.data(),\n+ this->idx.data(),\n+ this->Ke[code.get_stages()[s]].data(),\n+ X_N,\n+ kernel_size);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Polar_code.cpp", "new_path": "src/Tools/Code/Polar/Polar_code.cpp", "diff": "@@ -406,3 +406,13 @@ const std::vector<uint32_t>& Polar_code\n{\nreturn this->stages;\n}\n+\n+size_t Polar_code\n+::get_biggest_kernel_size() const\n+{\n+ size_t biggest_kernel_size = 0;\n+ for (auto ke = 0; ke < (int)this->get_kernel_matrices().size(); ke++)\n+ biggest_kernel_size = std::max(biggest_kernel_size, this->get_kernel_matrices()[ke].size());\n+\n+ return biggest_kernel_size;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Polar_code.hpp", "new_path": "src/Tools/Code/Polar/Polar_code.hpp", "diff": "@@ -34,6 +34,8 @@ public:\nconst std::vector<std::vector<std::vector<bool>>>& get_kernel_matrices() const;\nconst std::vector<uint32_t>& get_stages() const;\n+ size_t get_biggest_kernel_size() const;\n+\nprivate:\nvoid verif_MK();\nvoid verif();\n" } ]
C++
MIT License
aff3ct/aff3ct
Generic polar mono-kernel is working!
8,490
09.04.2019 11:33:11
-7,200
22f3445254b04000adb485b3470ea4fa9d0521ea
Generic polar multi-kernel SC decoder is working.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "using namespace aff3ct;\nusing namespace aff3ct::module;\n+std::vector<uint32_t> gen_sequence(const tools::Polar_code& code)\n+{\n+ std::vector<uint32_t> sequence(code.get_stages().size());\n+ for (size_t s = 0; s < code.get_stages().size(); s++)\n+ sequence[s] = code.get_kernel_matrices()[code.get_stages()[(sequence.size()-1)-s]].size();\n+\n+ return sequence;\n+}\n+\ntemplate <typename B, typename R>\nDecoder_polar_MK_SC_naive<B,R>\n::Decoder_polar_MK_SC_naive(const int& K,\n@@ -22,24 +31,17 @@ Decoder_polar_MK_SC_naive<B,R>\nDecoder_SIHO<B,R>(K, N, n_frames, 1),\ncode(code),\nfrozen_bits(frozen_bits),\n- polar_tree(code.get_stages().size() +1, code.get_kernel_matrices()[0].size()),\n+ polar_tree(gen_sequence(code)),\nKe(code.get_kernel_matrices().size()),\nidx(code.get_biggest_kernel_size()),\nu(code.get_biggest_kernel_size()),\n- LLRs(code.get_kernel_matrices()[0].size()),\n- bits(code.get_kernel_matrices()[0].size() -1),\n- lambdas(code.get_kernel_matrices()[0].size())\n+ LLRs(code.get_biggest_kernel_size()),\n+ bits(code.get_biggest_kernel_size() -1),\n+ lambdas(code.get_kernel_matrices().size())\n{\nconst std::string name = \"Decoder_polar_MK_SC_naive\";\nthis->set_name(name);\n- if (!code.is_mono_kernel())\n- {\n- std::stringstream message;\n- message << \"'code.is_mono_kernel()' has to be true.\";\n- throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n- }\n-\nconst auto base = code.get_kernel_matrices()[0].size();\nif (base < 2)\n{\n@@ -85,7 +87,8 @@ Decoder_polar_MK_SC_naive<B,R>\nthis->Ke[ke][i * kernel_size +j] = (B)this->code.get_kernel_matrices()[ke][j][i];\n}\n- auto same_polar_kernel = [](const std::vector<std::vector<bool>>& a, const std::vector<std::vector<bool>>& b) {\n+ auto same_polar_kernel = [](const std::vector<std::vector<bool>>& a, const std::vector<std::vector<bool>>& b)\n+ {\nif (a.size() != b.size())\nreturn false;\n@@ -101,10 +104,15 @@ Decoder_polar_MK_SC_naive<B,R>\nreturn true;\n};\n- if (same_polar_kernel(code.get_kernel_matrices()[0], {{1,0},{1,1}})) // Arikan kernel\n+ for (size_t l = 0; l < lambdas.size(); l++)\n{\n- lambdas[0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ lambdas[l].resize(code.get_kernel_matrices()[l].size());\n+\n+ if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0},{1,1}})) // Arikan kernel\n+ {\n+ lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\n+ // std::cout << \"k2 l0\" << std::endl;\n// return tools::f_LLR<R>(LLRs[0], LLRs[1]);\nauto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]);\nauto abs0 = std::abs(LLRs[0]);\n@@ -114,16 +122,18 @@ Decoder_polar_MK_SC_naive<B,R>\nreturn sign ? -min : min;\n};\n- lambdas[1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\n+ // std::cout << \"k2 l1\" << std::endl;\n// return tools::g_LLR<B,R>(LLRs[0], LLRs[1], bits[0]);\nreturn ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n};\n}\n- else if (same_polar_kernel(code.get_kernel_matrices()[0], {{1,1,1},{1,0,1},{0,1,1}}))\n+ else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,1,1},{1,0,1},{0,1,1}}))\n{\n- lambdas[0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\n+ // std::cout << \"k3 l0\" << std::endl;\nauto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\nauto abs0 = std::abs(LLRs[0]);\nauto abs1 = std::abs(LLRs[1]);\n@@ -133,8 +143,9 @@ Decoder_polar_MK_SC_naive<B,R>\nreturn sign ? -min : min;\n};\n- lambdas[1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\n+ // std::cout << \"k3 l1\" << std::endl;\nauto sign = std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\nauto abs1 = std::abs(LLRs[1]);\nauto abs2 = std::abs(LLRs[2]);\n@@ -145,16 +156,18 @@ Decoder_polar_MK_SC_naive<B,R>\nreturn ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_l2;\n};\n- lambdas[2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ lambdas[l][2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\n+ // std::cout << \"k3 l2\" << std::endl;\nreturn (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n(((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n};\n}\n- else if (same_polar_kernel(code.get_kernel_matrices()[0], {{1,0,0},{1,1,0},{1,0,1}}))\n+ else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0,0},{1,1,0},{1,0,1}}))\n{\n- lambdas[0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\n+ // std::cout << \"k3 l0\" << std::endl;\nauto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\nauto abs0 = std::abs(LLRs[0]);\nauto abs1 = std::abs(LLRs[1]);\n@@ -164,8 +177,9 @@ Decoder_polar_MK_SC_naive<B,R>\nreturn sign ? -min : min;\n};\n- lambdas[1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\n+ // std::cout << \"k3 l1\" << std::endl;\nauto hl0 = ((bits[0] == 0) ? LLRs[0] : -LLRs[0]);\nauto sign = std::signbit(hl0) ^ std::signbit(LLRs[2]);\n@@ -177,8 +191,9 @@ Decoder_polar_MK_SC_naive<B,R>\nreturn hl0_l2 + LLRs[1];\n};\n- lambdas[2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ lambdas[l][2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\n+ // std::cout << \"k3 l2\" << std::endl;\nauto hl0 = (((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0]);\nreturn hl0 + LLRs[2];\n@@ -191,6 +206,7 @@ Decoder_polar_MK_SC_naive<B,R>\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n}\n+}\ntemplate <typename B, typename R>\nDecoder_polar_MK_SC_naive<B,R>\n@@ -282,8 +298,9 @@ void Decoder_polar_MK_SC_naive<B,R>\nnode_curr->set_contents(new Contents_MK_SC<B,R>(vector_size, stage));\n+ const auto new_vector_size = vector_size / this->code.get_kernel_matrices()[code.get_stages()[stage]].size();\nfor (auto c : node_curr->get_children())\n- this->recursive_allocate_nodes_contents(c, vector_size / this->code.get_kernel_matrices()[0].size());\n+ this->recursive_allocate_nodes_contents(c, new_vector_size);\n}\ntemplate <typename B, typename R>\n@@ -308,20 +325,21 @@ void Decoder_polar_MK_SC_naive<B,R>\n{\nif (!node_curr->is_leaf()) // stop condition\n{\n+ const auto stage = node_curr->get_c()->stage;\nconst auto kern_size = (int)node_curr->get_children().size();\nconst auto size = (int)node_curr->get_c()->l.size();\n- const auto sub_part = size / kern_size;\n+ const auto nelmts = size / kern_size;\nfor (auto child = 0; child < kern_size; child++)\n{\nconst auto *node_child = node_curr->get_children()[child];\n- for (auto i = 0; i < sub_part; i++)\n+ for (auto e = 0; e < nelmts; e++)\n{\n- for (auto l = 0; l < kern_size; l++) LLRs[l] = node_curr->get_c()->l[l * sub_part +i];\n- for (auto c = 0; c < child; c++) bits[c] = node_curr->get_children()[c]->get_c()->s[i];\n+ for (auto l = 0; l < kern_size; l++) LLRs[l] = node_curr->get_c()->l[l * nelmts +e];\n+ for (auto c = 0; c < child; c++) bits[c] = node_curr->get_children()[c]->get_c()->s[e];\n- node_child->get_c()->l[i] = lambdas[child](LLRs, bits);\n+ node_child->get_c()->l[e] = lambdas[this->code.get_stages()[stage]][child](LLRs, bits);\n}\nthis->recursive_decode(node_child); // recursive call\n@@ -340,19 +358,18 @@ void Decoder_polar_MK_SC_naive<B,R>\n};\n// re-encode the bits (partial sums) (generalized to all kernels)\n- const auto s = node_curr->get_c()->stage;\nconst auto n_kernels = (int)node_curr->get_c()->s.size() / kern_size;\nfor (auto k = 0; k < n_kernels; k++)\n{\nfor (auto i = 0; i < kern_size; i++)\n{\nthis->idx[i] = (uint32_t)(n_kernels * i +k);\n- this->u[i] = node_curr->get_children()[(this->idx[i]/sub_part)]->get_c()->s[this->idx[i]%sub_part];\n+ this->u[i] = node_curr->get_children()[(this->idx[i]/nelmts)]->get_c()->s[this->idx[i]%nelmts];\n}\nencode_polar_kernel(this->u.data(),\nthis->idx.data(),\n- this->Ke[code.get_stages()[s]].data(),\n+ this->Ke[code.get_stages()[stage]].data(),\nnode_curr->get_c()->s.data(),\nkern_size);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp", "diff": "@@ -40,7 +40,7 @@ protected:\nstd::vector<R> LLRs;\nstd::vector<B> bits;\n- std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>> lambdas;\n+ std::vector<std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>> lambdas;\npublic:\nDecoder_polar_MK_SC_naive(const int& K,\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Tree/Generic/Generic_tree.hpp", "new_path": "src/Tools/Algo/Tree/Generic/Generic_tree.hpp", "diff": "#define GENERIC_TREE_HPP_\n#include <vector>\n+#include <cstdint>\n#include \"Generic_node.hpp\"\n@@ -41,6 +42,8 @@ public:\n*/\nexplicit Generic_tree(const int depth, const int base);\n+ explicit Generic_tree(const std::vector<uint32_t> &sequence);\n+\n/*!\n* \\brief Destructor.\n*\n@@ -63,7 +66,7 @@ public:\nstd::vector<Generic_node<T>*> get_leaves() const;\nprivate:\n- void create_nodes (Generic_node<T>* cur_node, int cur_depth, std::vector<int>& lanes, const int base);\n+ void create_nodes (Generic_node<T>* cur_node, int cur_depth, std::vector<int>& lanes, const std::vector<uint32_t> &sequence);\nvoid delete_nodes (Generic_node<T>* cur_node );\nvoid recursive_get_leaves(Generic_node<T>* cur_node );\n};\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Algo/Tree/Generic/Generic_tree.hxx", "new_path": "src/Tools/Algo/Tree/Generic/Generic_tree.hxx", "diff": "#include <vector>\n+#include <sstream>\n#include <iostream>\n#include \"Tools/Exception/exception.hpp\"\n@@ -18,9 +19,34 @@ Generic_tree<T>\nfor (unsigned i = 0; i < lanes.size(); i++)\nlanes[i] = 0;\n+ std::vector<uint32_t> sequence(depth, base);\n+\n+ auto cur_depth = 0;\n+ this->root = new Generic_node<T>(nullptr, std::vector<Generic_node<T>*>(), nullptr, cur_depth, lanes[cur_depth]);\n+ this->create_nodes(this->root, cur_depth +1, lanes, sequence);\n+ recursive_get_leaves(this->get_root());\n+}\n+\n+template <typename T>\n+Generic_tree<T>\n+::Generic_tree(const std::vector<uint32_t> &sequence)\n+: depth(sequence.size() +1), root(nullptr)\n+{\n+ for (size_t s = 0; s < sequence.size(); s++)\n+ if (sequence[s] == 0)\n+ {\n+ std::stringstream message;\n+ message << \"'sequence[\" << s << \"]' has to be bigger than 0.\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ std::vector<int> lanes(depth +1);\n+ for (unsigned i = 0; i < lanes.size(); i++)\n+ lanes[i] = 0;\n+\nauto cur_depth = 0;\nthis->root = new Generic_node<T>(nullptr, std::vector<Generic_node<T>*>(), nullptr, cur_depth, lanes[cur_depth]);\n- this->create_nodes(this->root, cur_depth +1, lanes, base);\n+ this->create_nodes(this->root, cur_depth +1, lanes, sequence);\nrecursive_get_leaves(this->get_root());\n}\n@@ -40,14 +66,14 @@ Generic_node<T>* Generic_tree<T>\ntemplate <typename T>\nvoid Generic_tree<T>\n-::create_nodes(Generic_node<T>* cur_node, int cur_depth, std::vector<int> &lanes, const int base)\n+::create_nodes(Generic_node<T>* cur_node, int cur_depth, std::vector<int> &lanes, const std::vector<uint32_t> &sequence)\n{\nif (cur_node->children.size())\nthrow runtime_error(__FILE__, __LINE__, __func__, \"'cur_node->children.size()' has to be equal to 0.\");\nif (cur_depth < this->depth)\n{\n- for (auto c = 0; c < base; c++)\n+ for (auto c = 0; c < (int)sequence[cur_depth -1]; c++)\n{\nauto child = new Generic_node<T>(cur_node,\nstd::vector<Generic_node<T>*>(),\n@@ -55,7 +81,7 @@ void Generic_tree<T>\ncur_depth,\nlanes[cur_depth]++);\ncur_node->children.push_back(child);\n- this->create_nodes(child, cur_depth +1, lanes, base);\n+ this->create_nodes(child, cur_depth +1, lanes, sequence);\n}\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Generic polar multi-kernel SC decoder is working.
8,490
09.04.2019 11:54:03
-7,200
d8cd058a586b9e107388e4507ca4db6ef4a0401e
Try to fix compilation error.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "@@ -108,13 +108,14 @@ Decoder_polar_MK_SC_naive<B,R>\n{\nlambdas[l].resize(code.get_kernel_matrices()[l].size());\n- if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0},{1,1}})) // Arikan kernel\n+ if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0},{1,1}})) // Arikan kernel 1 0\n+ // 1 1\n{\nlambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\nauto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]);\n- auto abs0 = std::abs(LLRs[0]);\n- auto abs1 = std::abs(LLRs[1]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\nauto min = std::min(abs0, abs1);\nreturn sign ? -min : min;\n@@ -125,14 +126,16 @@ Decoder_polar_MK_SC_naive<B,R>\nreturn ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n};\n}\n- else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,1,1},{1,0,1},{0,1,1}}))\n+ else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,1,1},{1,0,1},{0,1,1}})) // 1 1 1\n+ // 1 0 1\n+ // 0 1 1\n{\nlambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\nauto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\n- auto abs0 = std::abs(LLRs[0]);\n- auto abs1 = std::abs(LLRs[1]);\n- auto abs2 = std::abs(LLRs[2]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\nauto min = std::min(std::min(abs0, abs1), abs2);\nreturn sign ? -min : min;\n@@ -141,8 +144,8 @@ Decoder_polar_MK_SC_naive<B,R>\nlambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\nauto sign = std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\n- auto abs1 = std::abs(LLRs[1]);\n- auto abs2 = std::abs(LLRs[2]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\nauto min = std::min(abs1, abs2);\nauto l1_l2 = sign ? -min : min;\n@@ -156,14 +159,16 @@ Decoder_polar_MK_SC_naive<B,R>\n(((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n};\n}\n- else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0,0},{1,1,0},{1,0,1}}))\n+ else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0,0},{1,1,0},{1,0,1}})) // 1 0 0\n+ // 1 1 0\n+ // 1 0 1\n{\nlambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n{\nauto sign = std::signbit(LLRs[0]) ^ std::signbit(LLRs[1]) ^ std::signbit(LLRs[2]);\n- auto abs0 = std::abs(LLRs[0]);\n- auto abs1 = std::abs(LLRs[1]);\n- auto abs2 = std::abs(LLRs[2]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\nauto min = std::min(std::min(abs0, abs1), abs2);\nreturn sign ? -min : min;\n@@ -174,8 +179,8 @@ Decoder_polar_MK_SC_naive<B,R>\nauto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\nauto sign = std::signbit(hl0) ^ std::signbit(LLRs[2]);\n- auto abs0 = std::abs(hl0);\n- auto abs2 = std::abs(LLRs[2]);\n+ auto abs0 = (R)std::abs(hl0);\n+ auto abs2 = (R)std::abs(LLRs[2]);\nauto min = std::min(abs0, abs2);\nauto hl0_l2 = sign ? -min : min;\n" } ]
C++
MIT License
aff3ct/aff3ct
Try to fix compilation error.
8,490
09.04.2019 14:41:26
-7,200
9154225876e544a3f9c5e3910ca614a82ffb0047
Add systematic polar MK SC decoder.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "new_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "diff": "#include \"Tools/Exception/exception.hpp\"\n#include \"Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp\"\n+#include \"Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.hpp\"\n#include \"Decoder_polar_MK.hpp\"\n@@ -77,6 +78,16 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\n}\n}\n}\n+ else // systematic encoding\n+ {\n+ if (this->implem == \"NAIVE\")\n+ {\n+ if (crc == nullptr || crc->get_size() == 0)\n+ {\n+ if (this->type == \"SC\") return new module::Decoder_polar_MK_SC_naive_sys<B,Q>(this->K, this->N_cw, code, frozen_bits, this->n_frames);\n+ }\n+ }\n+ }\n}\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.cpp", "diff": "+#include \"Decoder_polar_MK_SC_naive_sys.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::module;\n+\n+template <typename B, typename R>\n+Decoder_polar_MK_SC_naive_sys<B,R>\n+::Decoder_polar_MK_SC_naive_sys(const int& K,\n+ const int& N,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ const int n_frames)\n+: Decoder (K, N, n_frames, 1),\n+ Decoder_polar_MK_SC_naive<B,R>(K, N, code, frozen_bits, n_frames)\n+{\n+ const std::string name = \"Decoder_polar_MK_SC_sys_naive\";\n+ this->set_name(name);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SC_naive_sys<B,R>\n+::_store(B *V, bool coded) const\n+{\n+ auto *contents_root = this->polar_tree.get_root()->get_c();\n+\n+ if (!coded)\n+ {\n+ auto k = 0;\n+ for (auto i = 0; i < this->N; i++)\n+ if (!this->frozen_bits[i])\n+ V[k++] = contents_root->s[i];\n+ }\n+ else\n+ std::copy(contents_root->s.begin(), contents_root->s.begin() + this->N, V);\n+}\n+\n+// ==================================================================================== explicit template instantiation\n+#include \"Tools/types.h\"\n+#ifdef AFF3CT_MULTI_PREC\n+template class aff3ct::module::Decoder_polar_MK_SC_naive_sys<B_8,Q_8>;\n+template class aff3ct::module::Decoder_polar_MK_SC_naive_sys<B_16,Q_16>;\n+template class aff3ct::module::Decoder_polar_MK_SC_naive_sys<B_32,Q_32>;\n+template class aff3ct::module::Decoder_polar_MK_SC_naive_sys<B_64,Q_64>;\n+#else\n+template class aff3ct::module::Decoder_polar_MK_SC_naive_sys<B,Q>;\n+#endif\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.hpp", "diff": "+#ifndef DECODER_POLAR_MK_SC_NAIVE_SYS_\n+#define DECODER_POLAR_MK_SC_NAIVE_SYS_\n+\n+#include <vector>\n+\n+#include \"Decoder_polar_MK_SC_naive.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B = int, typename R = float>\n+class Decoder_polar_MK_SC_naive_sys : public Decoder_polar_MK_SC_naive<B,R>\n+{\n+public:\n+ Decoder_polar_MK_SC_naive_sys(const int& K,\n+ const int& N,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ const int n_frames = 1);\n+ virtual ~Decoder_polar_MK_SC_naive_sys() = default;\n+\n+protected:\n+ void _store(B *V, bool coded = false) const;\n+};\n+}\n+}\n+\n+#endif /* DECODER_POLAR_MK_SC_NAIVE_SYS_ */\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp", "new_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp", "diff": "@@ -70,6 +70,22 @@ template <typename B>\nvoid Encoder_polar_MK<B>\n::light_encode(B *X_N)\n{\n+ // std::cout << \"frozen: [\";\n+ // for (auto e = 0; e < this->N; e++)\n+ // {\n+ // if (e > 0) std::cout << \",\";\n+ // std::cout << frozen_bits[e];\n+ // }\n+ // std::cout << \"]\" << std::endl;\n+\n+ // std::cout << \"X_N: [\";\n+ // for (auto e = 0; e < this->N; e++)\n+ // {\n+ // if (e > 0) std::cout << \",\";\n+ // std::cout << X_N[e];\n+ // }\n+ // std::cout << \"]\" << std::endl;\n+\nauto apply_polar_kernel = [](const B *u, const uint32_t *idx, const B *Ke, B *x, const int size)\n{\nfor (auto i = 0; i < size; i++)\n@@ -104,6 +120,15 @@ void Encoder_polar_MK<B>\nX_N,\nkernel_size);\n}\n+\n+ // std::cout << \"stage \" << s << \" - block \" << b << \": [\";\n+ // for (auto e = 0; e < n_kernels * kernel_size; e++)\n+ // {\n+ // if (e > 0)\n+ // std::cout << \",\";\n+ // std::cout << X_N[b * n_kernels * kernel_size + e];\n+ // }\n+ // std::cout << \"]\" << std::endl;\n}\nn_kernels *= kernel_size;\n" } ]
C++
MIT License
aff3ct/aff3ct
Add systematic polar MK SC decoder.
8,488
11.04.2019 07:59:50
-7,200
4f651b4e44b49354cd3a16d6c301316da9300daf
CI: PPA on multiple distribs.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -1239,16 +1239,21 @@ deploy-upload-ppa:\n- 64-bit\n- ppa\nartifacts:\n- name: build\n+ name: ppa_files\n+ when: always\npaths:\n- - build\n+ - build/Debian/xenial/*.gz\n+ - build/Debian/xenial/*.xz\n+ - build/Debian/xenial/*.dsc\n+ - build/Debian/xenial/*.build\nscript:\n+ - export DISTRIBS=\"xenial;bionic\"\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -m64 -msse4.2\"\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- - export NAME=\"build_linux_gcc_x64_sse4.2\"\n+ - export NAME=\"build\"\n- source ./ci/tools/threads.sh\n- ./ci/deploy-upload-ppa.sh\n" }, { "change_type": "MODIFY", "old_path": "ci/deploy-upload-ppa.sh", "new_path": "ci/deploy-upload-ppa.sh", "diff": "@@ -5,7 +5,12 @@ cmake --version\nmkdir build\ncd build\n-export GPG_TTY=$(tty)\n+if [ -z \"DISTRIBS\" ]\n+then\n+ echo \"Please define the 'DISTRIBS' environment variable.\"\n+ exit 1\n+fi\n+\nif [ -z \"$CXX\" ]\nthen\n@@ -30,20 +35,18 @@ then\ncmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CXX \\\n-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"$CFLAGS\" \\\n$CMAKE_OPT -DCMAKE_INSTALL_PREFIX=\"$NAME\" \\\n- -DAFF3CT_UPLOAD_PPA=\"ON\"\n+ -DAFF3CT_UPLOAD_PPA=\"ON\" \\\n+ -DAFF3CT_PPA_DISTRIB=\"$DISTRIBS\"\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nelse\ncmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CXX \\\n-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"$CFLAGS\" \\\n-DCMAKE_EXE_LINKER_FLAGS=\"$LFLAGS\" \\\n$CMAKE_OPT -DCMAKE_INSTALL_PREFIX=\"$NAME\" \\\n- -DAFF3CT_UPLOAD_PPA=\"ON\"\n+ -DAFF3CT_UPLOAD_PPA=\"ON\"\\\n+ -DAFF3CT_PPA_DISTRIB=\"$DISTRIBS\"\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nfi\nmake -j $THREADS -k\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-rm -rf $NAME\n-make install > /dev/null\n-rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-mv $NAME ../\n" }, { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -15,17 +15,15 @@ endif()\nforeach(DISTRI ${AFF3CT_PPA_DISTRIB})\nstring(REPLACE \"\\n\" \"\\n \" DEBIAN_LONG_DESCRIPTION \" ${CPACK_PACKAGE_DESCRIPTION}\")\n- set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})\n- set(CPACK_DEBIAN_PACKAGE_SECTION \"devel\")\n- set(CPACK_DEBIAN_PACKAGE_PRIORITY \"optional\")\n- set(DEBIAN_SOURCE_DIR ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION})\n+ set(DEBIAN_PACKAGE_FILE_NAME \"aff3ct-${AFF3CT_VERSION_FULL}-${DISTRI}.orig\")\n+ set(DEBIAN_PACKAGE_VERSION \"${AFF3CT_VERSION_FULL}-${DISTRI}\")\n+ set(DEBIAN_SOURCE_DIR ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${CPACK_DEBIAN_PACKAGE_NAME}-${DEBIAN_PACKAGE_VERSION})\nset(DEBIAN_CONTROL ${DEBIAN_SOURCE_DIR}/debian/control)\nset(DEBIAN_COPYRIGHT ${DEBIAN_SOURCE_DIR}/debian/copyright)\nset(DEBIAN_RULES ${DEBIAN_SOURCE_DIR}/debian/rules)\nset(DEBIAN_CHANGELOG ${DEBIAN_SOURCE_DIR}/debian/changelog)\nset(DEBIAN_SOURCE_CHANGES ${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_source.changes)\n- set(PACKAGE_FILE_NAME \"${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}\")\n- set(ORIG_FILE \"${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${PACKAGE_FILE_NAME}.orig.tar.gz\")\n+ set(ORIG_FILE \"${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEBIAN_PACKAGE_FILE_NAME}.tar.gz\")\nset(DPUT_HOST \"ppa:aff3ct/aff3ct\")\nif(CHANGELOG_MESSAGE) # TODO get it from git\nset(output_changelog_msg ${CHANGELOG_MESSAGE})\n@@ -98,7 +96,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nOUTPUT_VARIABLE DATE_TIME\nOUTPUT_STRIP_TRAILING_WHITESPACE)\nfile(WRITE ${DEBIAN_CHANGELOG}\n- \"${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) ${DISTRI}; urgency=low\\n\\n\"\n+ \"${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL} ${DISTRI}; urgency=low\\n\\n\"\n\" ${output_changelog_msg}\\n\\n\"\n\" -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${DATE_TIME}\\n\\n\")\nfile(APPEND ${DEBIAN_CHANGELOG} ${DEBIAN_CHANGELOG_content})\n@@ -109,7 +107,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nOUTPUT_VARIABLE DATE_TIME\nOUTPUT_STRIP_TRAILING_WHITESPACE)\nfile(WRITE ${DEBIAN_CHANGELOG}\n- \"${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) ${DISTRI}; urgency=low\\n\\n\"\n+ \"${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL}) ${DISTRI}; urgency=low\\n\\n\"\n\" ${output_changelog_msg}\\n\\n\"\n\" -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${DATE_TIME}\\n\")\nendif()\n@@ -118,6 +116,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n# .orig.tar.gz\nadd_custom_command(OUTPUT ${ORIG_FILE}\nCOMMAND cpack -G TGZ --config ${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake\n+ -D CPACK_PACKAGE_FILE_NAME=${DEBIAN_PACKAGE_FILE_NAME}\nWORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI})\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: PPA on multiple distribs.
8,488
11.04.2019 11:02:15
-7,200
648075c5d881e0580043ab67485a4ebccc858a4c
CI: Fix multiple distributions management. Add changelog message.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -6,6 +6,12 @@ if(NOT DEBUILD_EXECUTABLE OR NOT DPUT_EXECUTABLE)\nreturn()\nendif(NOT DEBUILD_EXECUTABLE OR NOT DPUT_EXECUTABLE)\n+\n+execute_process(COMMAND git tag -n20 --points-at v${AFF3CT_VERSION}\n+ OUTPUT_VARIABLE CHANGELOG\n+ OUTPUT_STRIP_TRAILING_WHITESPACE)\n+set(CHANGELOG_MESSAGE ${CHANGELOG})\n+\nif(NOT AFF3CT_PPA_DISTRIB)\nexecute_process(COMMAND lsb_release -cs\nOUTPUT_VARIABLE DISTRI\n@@ -22,7 +28,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nset(DEBIAN_COPYRIGHT ${DEBIAN_SOURCE_DIR}/debian/copyright)\nset(DEBIAN_RULES ${DEBIAN_SOURCE_DIR}/debian/rules)\nset(DEBIAN_CHANGELOG ${DEBIAN_SOURCE_DIR}/debian/changelog)\n- set(DEBIAN_SOURCE_CHANGES ${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_source.changes)\n+ set(DEBIAN_SOURCE_CHANGES ${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}-${DISTRI}_source.changes)\nset(ORIG_FILE \"${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEBIAN_PACKAGE_FILE_NAME}.tar.gz\")\nset(DPUT_HOST \"ppa:aff3ct/aff3ct\")\nif(CHANGELOG_MESSAGE) # TODO get it from git\n@@ -96,7 +102,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nOUTPUT_VARIABLE DATE_TIME\nOUTPUT_STRIP_TRAILING_WHITESPACE)\nfile(WRITE ${DEBIAN_CHANGELOG}\n- \"${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL} ${DISTRI}; urgency=low\\n\\n\"\n+ \"${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL}-${DISTRI} ${DISTRI}; urgency=low\\n\\n\"\n\" ${output_changelog_msg}\\n\\n\"\n\" -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${DATE_TIME}\\n\\n\")\nfile(APPEND ${DEBIAN_CHANGELOG} ${DEBIAN_CHANGELOG_content})\n@@ -107,7 +113,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nOUTPUT_VARIABLE DATE_TIME\nOUTPUT_STRIP_TRAILING_WHITESPACE)\nfile(WRITE ${DEBIAN_CHANGELOG}\n- \"${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL}) ${DISTRI}; urgency=low\\n\\n\"\n+ \"${CPACK_DEBIAN_PACKAGE_NAME} (${AFF3CT_VERSION_FULL}-${DISTRI}) ${DISTRI}; urgency=low\\n\\n\"\n\" ${output_changelog_msg}\\n\\n\"\n\" -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${DATE_TIME}\\n\")\nendif()\n@@ -144,4 +150,6 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nCOMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEBIAN_SOURCE_CHANGES}\nDEPENDS debuild_${DISTRI}\nWORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI})\n+\n+\nendforeach(DISTRI)\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: Fix multiple distributions management. Add changelog message.
8,488
11.04.2019 17:02:27
-7,200
ddb6f65dd2c9de32bbff1d3e519f5c5fbfa4298b
CI: Do not build during ppa upload stage.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -1252,7 +1252,7 @@ deploy-upload-ppa:\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -m64 -msse4.2\"\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n+ - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=OFF -DAFF3CT_COMPILE_STATIC_LIB=OFF -DAFF3CT_COMPILE_SHARED_LIB=OFF -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build\"\n- source ./ci/tools/threads.sh\n- ./ci/deploy-upload-ppa.sh\n" }, { "change_type": "MODIFY", "old_path": "CMakeLists.txt", "new_path": "CMakeLists.txt", "diff": "@@ -29,6 +29,10 @@ option(AFF3CT_POLAR_BOUNDS \"Enable the use of the external Tal & Vardy Pol\noption(AFF3CT_COLORS \"Enable the colors in the terminal\" ON )\noption(AFF3CT_OVERRIDE_VERSION \"Compile without .git directory, provided a version and hash\" OFF)\n+if (AFF3CT_COMPILE_EXE OR AFF3CT_COMPILE_STATIC_LIB OR AFF3CT_COMPILE_SHARED_LIB)\n+ set(AFF3CT_COMPILE_OBJ)\n+endif()\n+\nif(NOT EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/.git\" AND NOT AFF3CT_OVERRIDE_VERSION)\nmessage(FATAL_ERROR \"The '.git' folder can't be found, AFF3CT can't be compiled if it is not cloned \"\n\"from a Git repository. Please do not download archives from GitHub and make a Git \"\n@@ -188,9 +192,11 @@ if(${CMAKE_VERSION} VERSION_EQUAL \"3.14\" OR ${CMAKE_VERSION} VERSION_GREATER \"3.\nendif()\n# Object\n+if(AFF3CT_COMPILE_OBJ)\nadd_library(aff3ct-obj OBJECT ${source_files})\nset_target_properties(aff3ct-obj PROPERTIES\nPOSITION_INDEPENDENT_CODE ON) # set -fpic\n+endif()\n# Binary\nif(AFF3CT_COMPILE_EXE)\n@@ -227,7 +233,9 @@ endif()\n# ---------------------------------------------------------------------------------------------------------------------\nmacro(aff3ct_target_compile_definitions privacy def)\n+ if(AFF3CT_COMPILE_OBJ)\ntarget_compile_definitions(aff3ct-obj ${privacy} $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\n+ endif()\nif(AFF3CT_COMPILE_EXE)\ntarget_compile_definitions(aff3ct-bin ${privacy} $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)\nendif()\n@@ -307,9 +315,11 @@ endif()\n# ---------------------------------------------------------------------------------------------------------------------\nmacro(aff3ct_target_include_directories privacy dir_build dir_install)\n+ if(AFF3CT_COMPILE_OBJ)\ntarget_include_directories(aff3ct-obj ${privacy}\n$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${dir_build}/>\n$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-${AFF3CT_VERSION_FULL}/${dir_install}>)\n+ endif()\nif(AFF3CT_COMPILE_EXE)\ntarget_include_directories(aff3ct-bin ${privacy}\n$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${dir_build}/>\n@@ -380,7 +390,9 @@ macro(aff3ct_target_link_libraries privacy lib)\nendmacro()\nmacro(aff3ct_target_include_directories privacy dir)\n+ if(AFF3CT_COMPILE_OBJ)\ntarget_include_directories(aff3ct-obj ${privacy} $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\n+ endif()\nif(AFF3CT_COMPILE_EXE)\ntarget_include_directories(aff3ct-bin ${privacy} $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)\nendif()\n" }, { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -139,8 +139,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nWORKING_DIRECTORY ${DEBIAN_SOURCE_DIR})\nadd_custom_target(debuild_${DISTRI} ALL\n- DEPENDS ${DEBIAN_SOURCE_DIR}/CMakeLists.txt aff3ct-bin\n- ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEBIAN_SOURCE_CHANGES}\n+ DEPENDS ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEBIAN_SOURCE_CHANGES}\nWORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI})\n# ##############################################################################\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: Do not build during ppa upload stage.
8,490
11.04.2019 21:44:26
-7,200
f91d62b9cb208721713088052b0429aa9a83a9b2
Add polar multi-kernel SCL sys.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "new_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "diff": "#include \"Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp\"\n#include \"Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.hpp\"\n#include \"Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp\"\n+#include \"Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive_sys.hpp\"\n#include \"Decoder_polar_MK.hpp\"\n@@ -68,7 +69,7 @@ void Decoder_polar_MK::parameters\nauto p = this->get_prefix();\n- if (this->type == \"SCL\" || this->type == \"SCL_MEM\")\n+ if (this->type == \"SCL\")\nheaders[p].push_back(std::make_pair(\"Num. of lists (L)\", std::to_string(this->L)));\n}\n@@ -101,6 +102,7 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\nif (crc == nullptr || crc->get_size() == 0)\n{\nif (this->type == \"SC\" ) return new module::Decoder_polar_MK_SC_naive_sys <B,Q>(this->K, this->N_cw, code, frozen_bits, this->n_frames);\n+ if (this->type == \"SCL\") return new module::Decoder_polar_MK_SCL_naive_sys<B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, this->n_frames);\n}\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive_sys.cpp", "diff": "+#include <algorithm>\n+#include <cmath>\n+#include <map>\n+\n+#include <iostream>\n+#include <fstream>\n+\n+#include \"Decoder_polar_MK_SCL_naive_sys.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::module;\n+\n+template <typename B, typename R>\n+Decoder_polar_MK_SCL_naive_sys<B,R>\n+::Decoder_polar_MK_SCL_naive_sys(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ const int n_frames)\n+: Decoder (K, N, n_frames, 1),\n+ Decoder_polar_MK_SCL_naive<B,R>(K, N, L, code, frozen_bits, n_frames )\n+{\n+ const std::string name = \"Decoder_polar_MK_SCL_naive_sys\";\n+ this->set_name(name);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SCL_naive_sys<B,R>\n+::_store(B *V, bool coded) const\n+{\n+ if (!coded)\n+ {\n+ auto k = 0;\n+ for (auto i = 0; i < this->N; i++)\n+ if (!this->frozen_bits[i])\n+ V[k++] = this->polar_trees[*this->active_paths.begin()]->get_root()->get_c()->s[i] ? 1 : 0;\n+ }\n+ else\n+ for (auto i = 0; i < this->N; i++)\n+ V[i] = this->polar_trees[*this->active_paths.begin()]->get_root()->get_c()->s[i] ? 1 : 0;\n+}\n+\n+// ==================================================================================== explicit template instantiation\n+#include \"Tools/types.h\"\n+#ifdef AFF3CT_MULTI_PREC\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_sys<B_8,Q_8>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_sys<B_16,Q_16>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_sys<B_32,Q_32>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_sys<B_64,Q_64>;\n+#else\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_sys<B,Q>;\n+#endif\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive_sys.hpp", "diff": "+#ifndef DECODER_POLAR_MK_SCL_NAIVE_SYS\n+#define DECODER_POLAR_MK_SCL_NAIVE_SYS\n+\n+#include <vector>\n+\n+#include \"Decoder_polar_MK_SCL_naive.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B, typename R>\n+class Decoder_polar_MK_SCL_naive_sys : public Decoder_polar_MK_SCL_naive<B,R>\n+{\n+\n+public:\n+ Decoder_polar_MK_SCL_naive_sys(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ const int n_frames = 1);\n+\n+ virtual ~Decoder_polar_MK_SCL_naive_sys() = default;\n+\n+protected:\n+ virtual void _store(B *V, bool coded = false) const;\n+};\n+}\n+}\n+\n+#endif /* DECODER_POLAR_MK_SCL_NAIVE_SYS */\n" }, { "change_type": "MODIFY", "old_path": "src/aff3ct.hpp", "new_path": "src/aff3ct.hpp", "diff": "#ifndef DECODER_POLAR_MK_SCL_NAIVE\n#include <Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp>\n#endif\n+#ifndef DECODER_POLAR_MK_SCL_NAIVE_SYS\n+#include <Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive_sys.hpp>\n+#endif\n#ifndef DECODER_POLAR_SCAN_NAIVE_H_\n#include <Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hpp>\n#endif\n" } ]
C++
MIT License
aff3ct/aff3ct
Add polar multi-kernel SCL sys.
8,490
11.04.2019 22:21:21
-7,200
76035b95855a3f4cba5b6179ad0cbb27f6a42c59
Add polar multi-kernel CA-SCL (sys and non-sys) decoder.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/decoder.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/decoder.rst", "diff": "@@ -9,9 +9,9 @@ Polar |MK| Decoder parameters\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n:Type: text\n- :Allowed values: ``SC`` ``CHASE`` ``ML``\n+ :Allowed values: ``SC`` ``SCL`` ``CHASE`` ``ML``\n:Default: ``SC``\n- :Examples: ``--dec-type ML``\n+ :Examples: ``--dec-type SCL``\n|factory::Decoder::parameters::p+type,D|\n@@ -22,7 +22,8 @@ Description of the allowed values:\n+==============+===============================================================+\n| ``SC`` | Select the original |SC| algorithm from :cite:`Arikan2009`. |\n+--------------+---------------------------------------------------------------+\n-| ``SCL`` | Select the |SCL| algorithm from :cite:`Tal2011`. |\n+| ``SCL`` | Select the |SCL| algorithm from :cite:`Tal2011`, also support |\n+| | the improved |CA|-|SCL| algorithm. |\n+--------------+---------------------------------------------------------------+\n| ``CHASE`` | See the common :ref:`dec-common-dec-type` parameter. |\n+--------------+---------------------------------------------------------------+\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "new_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "diff": "#include \"Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.hpp\"\n#include \"Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp\"\n#include \"Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive_sys.hpp\"\n+#include \"Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA.hpp\"\n+#include \"Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA_sys.hpp\"\n#include \"Decoder_polar_MK.hpp\"\n@@ -93,6 +95,10 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\nif (this->type == \"SC\" ) return new module::Decoder_polar_MK_SC_naive <B,Q>(this->K, this->N_cw, code, frozen_bits, this->n_frames);\nif (this->type == \"SCL\") return new module::Decoder_polar_MK_SCL_naive<B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, this->n_frames);\n}\n+ else\n+ {\n+ if (this->type == \"SCL\") return new module::Decoder_polar_MK_SCL_naive_CA<B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, *crc, this->n_frames);\n+ }\n}\n}\nelse // systematic encoding\n@@ -104,6 +110,10 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\nif (this->type == \"SC\" ) return new module::Decoder_polar_MK_SC_naive_sys <B,Q>(this->K, this->N_cw, code, frozen_bits, this->n_frames);\nif (this->type == \"SCL\") return new module::Decoder_polar_MK_SCL_naive_sys<B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, this->n_frames);\n}\n+ else\n+ {\n+ if (this->type == \"SCL\") return new module::Decoder_polar_MK_SCL_naive_CA_sys<B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, *crc, this->n_frames);\n+ }\n}\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA.cpp", "diff": "+#include <sstream>\n+\n+#include \"Tools/Exception/exception.hpp\"\n+#include \"Decoder_polar_MK_SCL_naive_CA.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::module;\n+\n+template <typename B, typename R>\n+Decoder_polar_MK_SCL_naive_CA<B,R>\n+::Decoder_polar_MK_SCL_naive_CA(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc, const int n_frames)\n+: Decoder (K, N, n_frames, 1),\n+ Decoder_polar_MK_SCL_naive<B,R>(K, N, L, code, frozen_bits, n_frames ),\n+ crc(crc)\n+{\n+ const std::string name = \"Decoder_polar_MK_SCL_naive_CA\";\n+ this->set_name(name);\n+\n+ if (crc.get_size() > K)\n+ {\n+ std::stringstream message;\n+ message << \"'crc.get_size()' has to be equal or smaller than 'K' ('crc.get_size()' = \" << crc.get_size()\n+ << \", 'K' = \" << K << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SCL_naive_CA<B,R>\n+::select_best_path()\n+{\n+ std::vector<B> U_test;\n+ std::set<int> active_paths_before_crc = this->active_paths;\n+ for (auto path : active_paths_before_crc)\n+ {\n+ U_test.clear();\n+\n+ for (auto leaf = 0 ; leaf < this->N ; leaf++)\n+ if (!this->frozen_bits[leaf])\n+ U_test.push_back(this->leaves_array[path][leaf]->get_c()->s[0]);\n+\n+ bool decode_result = crc.check(U_test, this->get_simd_inter_frame_level());\n+ if (!decode_result)\n+ this->active_paths.erase(path);\n+ }\n+\n+ this->Decoder_polar_MK_SCL_naive<B,R>::select_best_path();\n+}\n+\n+// ==================================================================================== explicit template instantiation\n+#include \"Tools/types.h\"\n+#ifdef AFF3CT_MULTI_PREC\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA<B_8,Q_8>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA<B_16,Q_16>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA<B_32,Q_32>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA<B_64,Q_64>;\n+#else\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA<B,Q>;\n+#endif\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA.hpp", "diff": "+#ifndef DECODER_POLAR_MK_SCL_NAIVE_CA_\n+#define DECODER_POLAR_MK_SCL_NAIVE_CA_\n+\n+#include \"Module/CRC/CRC.hpp\"\n+\n+#include \"../Decoder_polar_MK_SCL_naive.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B, typename R>\n+class Decoder_polar_MK_SCL_naive_CA : public Decoder_polar_MK_SCL_naive<B,R>\n+{\n+protected:\n+ CRC<B>& crc;\n+\n+public:\n+ Decoder_polar_MK_SCL_naive_CA(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc,\n+ const int n_frames = 1);\n+\n+ virtual ~Decoder_polar_MK_SCL_naive_CA() = default;\n+\n+protected:\n+ virtual void select_best_path();\n+};\n+}\n+}\n+\n+#endif /* DECODER_POLAR_MK_SCL_NAIVE_CA_ */\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA_sys.cpp", "diff": "+#include \"Decoder_polar_MK_SCL_naive_CA_sys.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::module;\n+\n+template <typename B, typename R>\n+Decoder_polar_MK_SCL_naive_CA_sys<B,R>\n+::Decoder_polar_MK_SCL_naive_CA_sys(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc,\n+ const int n_frames)\n+: Decoder (K, N, n_frames, 1),\n+ Decoder_polar_MK_SCL_naive_CA<B,R>(K, N, L, code, frozen_bits, crc, n_frames )\n+{\n+ const std::string name = \"Decoder_polar_MK_SCL_naive_CA_sys\";\n+ this->set_name(name);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SCL_naive_CA_sys<B,R>\n+::select_best_path()\n+{\n+ std::vector<B> U_test;\n+ std::set<int> active_paths_before_crc = this->active_paths;\n+ for (auto path : active_paths_before_crc)\n+ {\n+ U_test.clear();\n+\n+ for (auto i = 0 ; i < this->N ; i++)\n+ if (!this->frozen_bits[i]) U_test.push_back(this->polar_trees[path]->get_root()->get_c()->s[i]);\n+\n+ bool decode_result = this->crc.check(U_test, this->get_simd_inter_frame_level());\n+ if (!decode_result)\n+ this->active_paths.erase(path);\n+ }\n+\n+ this->Decoder_polar_MK_SCL_naive<B,R>::select_best_path();\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_SCL_naive_CA_sys<B,R>\n+::_store(B *V, bool coded) const\n+{\n+ if (!coded)\n+ {\n+ auto k = 0;\n+ for (auto i = 0; i < this->N; i++)\n+ if (!this->frozen_bits[i])\n+ V[k++] = this->polar_trees[*this->active_paths.begin()]->get_root()->get_c()->s[i] ? 1 : 0;\n+ }\n+ else\n+ for (auto i = 0; i < this->N; i++)\n+ V[i] = this->polar_trees[*this->active_paths.begin()]->get_root()->get_c()->s[i] ? 1 : 0;\n+}\n+\n+// ==================================================================================== explicit template instantiation\n+#include \"Tools/types.h\"\n+#ifdef AFF3CT_MULTI_PREC\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA_sys<B_8,Q_8>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA_sys<B_16,Q_16>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA_sys<B_32,Q_32>;\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA_sys<B_64,Q_64>;\n+#else\n+template class aff3ct::module::Decoder_polar_MK_SCL_naive_CA_sys<B,Q>;\n+#endif\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA_sys.hpp", "diff": "+#ifndef DECODER_POLAR_MK_SCL_NAIVE_CA_SYS_\n+#define DECODER_POLAR_MK_SCL_NAIVE_CA_SYS_\n+\n+#include \"Decoder_polar_MK_SCL_naive_CA.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B, typename R>\n+class Decoder_polar_MK_SCL_naive_CA_sys : public Decoder_polar_MK_SCL_naive_CA<B,R>\n+{\n+\n+public:\n+ Decoder_polar_MK_SCL_naive_CA_sys(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc,\n+ const int n_frames = 1);\n+\n+ virtual ~Decoder_polar_MK_SCL_naive_CA_sys() = default;\n+\n+protected:\n+ virtual void select_best_path();\n+ virtual void _store(B *V, bool coded = false) const;\n+};\n+}\n+}\n+\n+#endif /* DECODER_POLAR_MK_SCL_NAIVE_CA_SYS_ */\n" }, { "change_type": "MODIFY", "old_path": "src/aff3ct.hpp", "new_path": "src/aff3ct.hpp", "diff": "#ifndef DECODER_POLAR_MK_SC_NAIVE_SYS_\n#include <Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.hpp>\n#endif\n+#ifndef DECODER_POLAR_MK_SCL_NAIVE_CA_\n+#include <Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA.hpp>\n+#endif\n+#ifndef DECODER_POLAR_MK_SCL_NAIVE_CA_SYS_\n+#include <Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA_sys.hpp>\n+#endif\n#ifndef DECODER_POLAR_MK_SCL_NAIVE\n#include <Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp>\n#endif\n" } ]
C++
MIT License
aff3ct/aff3ct
Add polar multi-kernel CA-SCL (sys and non-sys) decoder.
8,490
12.04.2019 10:53:13
-7,200
46b3cdd22146960caec92bcbef8edbc4a1a03a50
Add polar multi-kernel PA-SCL (sys and non-sys) decoder.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/decoder.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/decoder.rst", "diff": "@@ -9,7 +9,7 @@ Polar |MK| Decoder parameters\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n:Type: text\n- :Allowed values: ``SC`` ``SCL`` ``CHASE`` ``ML``\n+ :Allowed values: ``SC`` ``SCL`` ``ASCL`` ``CHASE`` ``ML``\n:Default: ``SC``\n:Examples: ``--dec-type SCL``\n@@ -25,6 +25,9 @@ Description of the allowed values:\n| ``SCL`` | Select the |SCL| algorithm from :cite:`Tal2011`, also support |\n| | the improved |CA|-|SCL| algorithm. |\n+--------------+---------------------------------------------------------------+\n+| ``ASCL`` | Select the |A-SCL| algorithm from :cite:`Li2012`, only the |\n+| | |PA-SCL| variant is available. |\n++--------------+---------------------------------------------------------------+\n| ``CHASE`` | See the common :ref:`dec-common-dec-type` parameter. |\n+--------------+---------------------------------------------------------------+\n| ``ML`` | See the common :ref:`dec-common-dec-type` parameter. |\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/references_dec.bib", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/references_dec.bib", "diff": "issn = {2157-8095},\nkeywords = {maximum likelihood decoding, Arikan, decoding paths, maximum likelihood decoder, polar codes, successive-cancellation list decoder, Arrays, Complexity theory, Equations, Error analysis, Mathematical model, Maximum likelihood decoding},\n}\n+\n+@Article{Li2012,\n+ author = {B. Li and H. Shen and D. Tse},\n+ title = {An Adaptive Successive Cancellation List Decoder for Polar Codes with Cyclic Redundancy Check},\n+ journal = {IEEE Communications Letters (COMML)},\n+ year = {2012},\n+ volume = {16},\n+ number = {12},\n+ pages = {2044--2047},\n+ month = dec,\n+ issn = {1089-7798},\n+ abstract = {In this letter, we propose an adaptive SC (Successive Cancellation)-List decoder for polar codes with CRC. This adaptive SC-List decoder iteratively increases the list size until at least one survival path can pass CRC. Simulation shows that the adaptive SC-List decoder provides significant complexity reduction. We also demonstrate that polar code (2048, 1024) with 24-bit CRC decoded by our proposed adaptive SC-List decoder with very large maximum list size can achieve a frame error rate FER $\\leq$ 10\\textsuperscript{-3}{-3} at E\\textsubscript{b}/N\\textsubscript{o} = 1.1dB, which is about 0.25dB from the information theoretic limit at this block length.},\n+ doi = {10.1109/LCOMM.2012.111612.121898},\n+ file = {:pdf/Li2012 - An Adaptive Successive Cancellation List Decoder for Polar Codes with Cyclic Redundancy Check.pdf:PDF},\n+ groups = {Polar Codes},\n+ keywords = {adaptive codes, cyclic redundancy check codes, decoding, CRC code, FER, adaptive SC list decoder, adaptive successive cancellation list decoder, cyclic redundancy check codes, frame error rate, information theoretic limit, polar codes, word length 24 bit, Complexity theory, Cyclic redundancy check, Error analysis, Iterative decoding, Maximum likelihood decoding, Signal to noise ratio, Polar codes, list decoder},\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "new_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "diff": "#include \"Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive_sys.hpp\"\n#include \"Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA.hpp\"\n#include \"Module/Decoder/Polar_MK/SCL/CRC/Decoder_polar_MK_SCL_naive_CA_sys.hpp\"\n+#include \"Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA.hpp\"\n+#include \"Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA_sys.hpp\"\n#include \"Decoder_polar_MK.hpp\"\n@@ -46,7 +48,7 @@ void Decoder_polar_MK::parameters\nauto p = this->get_prefix();\nconst std::string class_name = \"factory::Decoder_polar_MK::parameters::\";\n- tools::add_options(args.at({p+\"-type\", \"D\"}), 0, \"SC\", \"SCL\");\n+ tools::add_options(args.at({p+\"-type\", \"D\"}), 0, \"SC\", \"SCL\", \"ASCL\");\nargs.at({p+\"-implem\"})->change_type(tools::Text(tools::Example_set(\"NAIVE\")));\n@@ -98,6 +100,7 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\nelse\n{\nif (this->type == \"SCL\" ) return new module::Decoder_polar_MK_SCL_naive_CA <B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, *crc, this->n_frames);\n+ if (this->type == \"ASCL\") return new module::Decoder_polar_MK_ASCL_naive_CA<B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, *crc, this->n_frames);\n}\n}\n}\n@@ -113,6 +116,7 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\nelse\n{\nif (this->type == \"SCL\" ) return new module::Decoder_polar_MK_SCL_naive_CA_sys <B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, *crc, this->n_frames);\n+ if (this->type == \"ASCL\") return new module::Decoder_polar_MK_ASCL_naive_CA_sys<B,Q>(this->K, this->N_cw, this->L, code, frozen_bits, *crc, this->n_frames);\n}\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA.cpp", "diff": "+#include <chrono>\n+\n+#include \"Decoder_polar_MK_ASCL_naive_CA.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::module;\n+\n+template <typename B, typename R>\n+Decoder_polar_MK_ASCL_naive_CA<B,R>\n+::Decoder_polar_MK_ASCL_naive_CA(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc,\n+ const int n_frames)\n+: Decoder (K, N, n_frames, 1),\n+ Decoder_polar_MK_SCL_naive_CA<B,R>(K, N, L, code, frozen_bits, crc, n_frames ),\n+ sc_decoder (K, N, code, frozen_bits, n_frames )\n+{\n+ const std::string name = \"Decoder_polar_MK_ASCL_naive_CA\";\n+ this->set_name(name);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_ASCL_naive_CA<B,R>\n+::notify_frozenbits_update()\n+{\n+ Decoder_polar_MK_SCL_naive_CA<B,R>::notify_frozenbits_update();\n+ sc_decoder.notify_frozenbits_update();\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_ASCL_naive_CA<B,R>\n+::_decode_siho(const R *Y_N, B *V_K, const int frame_id)\n+{\n+ sc_decoder._decode_siho(Y_N, V_K, frame_id);\n+\n+ // check the CRC\n+ auto crc_decode_result = this->crc.check(V_K, this->get_simd_inter_frame_level());\n+\n+ if (!crc_decode_result)\n+ Decoder_polar_MK_SCL_naive_CA<B,R>::_decode_siho(Y_N, V_K, frame_id);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_ASCL_naive_CA<B,R>\n+::_decode_siho_cw(const R *Y_N, B *V_N, const int frame_id)\n+{\n+ sc_decoder._decode_siho(Y_N, V_N, frame_id);\n+\n+ // check the CRC\n+ auto crc_decode_result = this->crc.check(V_N, this->get_simd_inter_frame_level());\n+\n+ if (!crc_decode_result)\n+ Decoder_polar_MK_SCL_naive_CA<B,R>::_decode_siho_cw(Y_N, V_N, frame_id);\n+ else\n+ sc_decoder._store(V_N, true);\n+}\n+\n+// ==================================================================================== explicit template instantiation\n+#include \"Tools/types.h\"\n+#ifdef AFF3CT_MULTI_PREC\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA<B_8,Q_8>;\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA<B_16,Q_16>;\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA<B_32,Q_32>;\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA<B_64,Q_64>;\n+#else\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA<B,Q>;\n+#endif\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA.hpp", "diff": "+#ifndef DECODER_POLAR_MK_ASCL_NAIVE_CA\n+#define DECODER_POLAR_MK_ASCL_NAIVE_CA\n+\n+#include \"../SC/Decoder_polar_MK_SC_naive.hpp\"\n+#include \"../SCL/CRC/Decoder_polar_MK_SCL_naive_CA.hpp\"\n+\n+#include \"Module/CRC/CRC.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B = int, typename R = float>\n+class Decoder_polar_MK_ASCL_naive_CA : public Decoder_polar_MK_SCL_naive_CA<B,R>\n+{\n+private:\n+ Decoder_polar_MK_SC_naive<B,R> sc_decoder;\n+\n+public:\n+ Decoder_polar_MK_ASCL_naive_CA(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc,\n+ const int n_frames = 1);\n+\n+ virtual ~Decoder_polar_MK_ASCL_naive_CA() = default;\n+\n+ virtual void notify_frozenbits_update();\n+\n+protected:\n+ void _decode (const R *Y_N, B *V_K, const int frame_id);\n+ void _decode_siho (const R *Y_N, B *V_K, const int frame_id);\n+ void _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\n+};\n+}\n+}\n+\n+#endif /* DECODER_POLAR_MK_ASCL_NAIVE_CA */\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA_sys.cpp", "diff": "+#include <chrono>\n+\n+#include \"Decoder_polar_MK_ASCL_naive_CA_sys.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::module;\n+\n+template <typename B, typename R>\n+Decoder_polar_MK_ASCL_naive_CA_sys<B,R>\n+::Decoder_polar_MK_ASCL_naive_CA_sys(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc,\n+ const int n_frames)\n+: Decoder (K, N, n_frames, 1),\n+ Decoder_polar_MK_SCL_naive_CA_sys<B,R>(K, N, L, code, frozen_bits, crc, n_frames ),\n+ sc_decoder (K, N, code, frozen_bits, n_frames )\n+{\n+ const std::string name = \"Decoder_polar_MK_ASCL_naive_CA_sys\";\n+ this->set_name(name);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_ASCL_naive_CA_sys<B,R>\n+::notify_frozenbits_update()\n+{\n+ Decoder_polar_MK_SCL_naive_CA_sys<B,R>::notify_frozenbits_update();\n+ sc_decoder.notify_frozenbits_update();\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_ASCL_naive_CA_sys<B,R>\n+::_decode_siho(const R *Y_N, B *V_K, const int frame_id)\n+{\n+ sc_decoder._decode_siho(Y_N, V_K, frame_id);\n+\n+ // check the CRC\n+ auto crc_decode_result = this->crc.check(V_K, this->get_simd_inter_frame_level());\n+\n+ if (!crc_decode_result)\n+ Decoder_polar_MK_SCL_naive_CA_sys<B,R>::_decode_siho(Y_N, V_K, frame_id);\n+}\n+\n+template <typename B, typename R>\n+void Decoder_polar_MK_ASCL_naive_CA_sys<B,R>\n+::_decode_siho_cw(const R *Y_N, B *V_N, const int frame_id)\n+{\n+ sc_decoder._decode_siho(Y_N, V_N, frame_id);\n+\n+ // check the CRC\n+ auto crc_decode_result = this->crc.check(V_N, this->get_simd_inter_frame_level());\n+\n+ if (!crc_decode_result)\n+ Decoder_polar_MK_SCL_naive_CA_sys<B,R>::_decode_siho_cw(Y_N, V_N, frame_id);\n+ else\n+ sc_decoder._store(V_N, true);\n+}\n+\n+// ==================================================================================== explicit template instantiation\n+#include \"Tools/types.h\"\n+#ifdef AFF3CT_MULTI_PREC\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA_sys<B_8,Q_8>;\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA_sys<B_16,Q_16>;\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA_sys<B_32,Q_32>;\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA_sys<B_64,Q_64>;\n+#else\n+template class aff3ct::module::Decoder_polar_MK_ASCL_naive_CA_sys<B,Q>;\n+#endif\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA_sys.hpp", "diff": "+#ifndef DECODER_POLAR_MK_ASCL_NAIVE_CA_SYS\n+#define DECODER_POLAR_MK_ASCL_NAIVE_CA_SYS\n+\n+#include \"../SC/Decoder_polar_MK_SC_naive_sys.hpp\"\n+#include \"../SCL/CRC/Decoder_polar_MK_SCL_naive_CA_sys.hpp\"\n+\n+#include \"Module/CRC/CRC.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+template <typename B = int, typename R = float>\n+class Decoder_polar_MK_ASCL_naive_CA_sys : public Decoder_polar_MK_SCL_naive_CA_sys<B,R>\n+{\n+private:\n+ Decoder_polar_MK_SC_naive_sys<B,R> sc_decoder;\n+\n+public:\n+ Decoder_polar_MK_ASCL_naive_CA_sys(const int& K,\n+ const int& N,\n+ const int& L,\n+ const tools::Polar_code& code,\n+ const std::vector<bool>& frozen_bits,\n+ CRC<B>& crc,\n+ const int n_frames = 1);\n+\n+ virtual ~Decoder_polar_MK_ASCL_naive_CA_sys() = default;\n+\n+ virtual void notify_frozenbits_update();\n+\n+protected:\n+ void _decode (const R *Y_N, B *V_K, const int frame_id);\n+ void _decode_siho (const R *Y_N, B *V_K, const int frame_id);\n+ void _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\n+};\n+}\n+}\n+\n+#endif /* DECODER_POLAR_MK_ASCL_NAIVE_CA_SYS */\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp", "diff": "@@ -25,9 +25,14 @@ public:\nvirtual ~Contents_MK_SC() {}\n};\n+template <typename B, typename R>\n+class Decoder_polar_MK_ASCL_naive_CA;\n+\ntemplate <typename B = int, typename R = float>\nclass Decoder_polar_MK_SC_naive : public Decoder_SIHO<B,R>, public tools::Frozenbits_notifier\n{\n+ friend Decoder_polar_MK_ASCL_naive_CA<B,R>;\n+\nprotected:\nconst tools::Polar_code &code;\nconst std::vector<bool> &frozen_bits;\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.hpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.hpp", "diff": "@@ -9,9 +9,15 @@ namespace aff3ct\n{\nnamespace module\n{\n+\n+template <typename B, typename R>\n+class Decoder_polar_MK_ASCL_naive_CA_sys;\n+\ntemplate <typename B = int, typename R = float>\nclass Decoder_polar_MK_SC_naive_sys : public Decoder_polar_MK_SC_naive<B,R>\n{\n+ friend Decoder_polar_MK_ASCL_naive_CA_sys<B,R>;\n+\npublic:\nDecoder_polar_MK_SC_naive_sys(const int& K,\nconst int& N,\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp", "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp", "diff": "@@ -61,8 +61,8 @@ public:\nprotected:\nvoid _load (const R *Y_N );\nvoid _decode ( );\n- void _decode_siho (const R *Y_N, B *V_K, const int frame_id);\n- void _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\n+ virtual void _decode_siho (const R *Y_N, B *V_K, const int frame_id);\n+ virtual void _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\nvirtual void _store ( B *V, bool coded = false) const;\nprivate:\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK_sys.cpp", "new_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK_sys.cpp", "diff": "@@ -95,43 +95,47 @@ Encoder_polar_MK_sys<B>\nthis->set_name(name);\nthis->set_sys(true);\n- // generate the \"G\" matrix from the \"kernel_matrices\"\n- auto G = this->code.get_kernel_matrices()[this->code.get_stages()[0]];\n- for (auto s = 1; s < (int)this->code.get_stages().size(); s++)\n- G = kronecker_product<bool>(G, this->code.get_kernel_matrices()[this->code.get_stages()[s]]);\n-\n- // compute the \"G x G\" product\n- auto G_x_G = G;\n- for (auto i = 0; i < (int)G.size(); i++)\n- for (auto j = 0; j < (int)G.size(); j++)\n- {\n- uint32_t sum_r = 0;\n- for (auto k = 0; k < (int)G.size(); k++)\n- sum_r += (uint32_t)(G[i][k] & G[k][j]);\n- G_x_G[i][j] = (bool)(sum_r & (B)1);\n- }\n-\n- // check if \"G x G\" is the identity matrix\n- for (auto i = 0; i < (int)G_x_G.size(); i++)\n- for (auto j = 0; j < (int)G_x_G.size(); j++)\n- if (i == j && G_x_G[i][j] != true)\n- {\n- std::stringstream message;\n- message << \"'G_x_G' has to be the identity matrix (\"\n- << \"'i' = \" << i << \", \"\n- << \"'j' = \" << j << \", \"\n- << \"'G_x_G[i][j]' = \" << G_x_G[i][j] << \").\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- else if (i != j && G_x_G[i][j] != false)\n- {\n- std::stringstream message;\n- message << \"'G_x_G' has to be the identity matrix (\"\n- << \"'i' = \" << i << \", \"\n- << \"'j' = \" << j << \", \"\n- << \"'G_x_G[i][j]' = \" << G_x_G[i][j] << \").\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n+ ////////////////////////////////////////////////////////////////////////////\n+ // /!\\ The following lines are commented because they take too many time! //\n+ ////////////////////////////////////////////////////////////////////////////\n+\n+ // // generate the \"G\" matrix from the \"kernel_matrices\"\n+ // auto G = this->code.get_kernel_matrices()[this->code.get_stages()[0]];\n+ // for (auto s = 1; s < (int)this->code.get_stages().size(); s++)\n+ // G = kronecker_product<bool>(G, this->code.get_kernel_matrices()[this->code.get_stages()[s]]);\n+\n+ // // compute the \"G x G\" product\n+ // auto G_x_G = G;\n+ // for (auto i = 0; i < (int)G.size(); i++)\n+ // for (auto j = 0; j < (int)G.size(); j++)\n+ // {\n+ // uint32_t sum_r = 0;\n+ // for (auto k = 0; k < (int)G.size(); k++)\n+ // sum_r += (uint32_t)(G[i][k] & G[k][j]);\n+ // G_x_G[i][j] = (bool)(sum_r & (B)1);\n+ // }\n+\n+ // // check if \"G x G\" is the identity matrix\n+ // for (auto i = 0; i < (int)G_x_G.size(); i++)\n+ // for (auto j = 0; j < (int)G_x_G.size(); j++)\n+ // if (i == j && G_x_G[i][j] != true)\n+ // {\n+ // std::stringstream message;\n+ // message << \"'G_x_G' has to be the identity matrix (\"\n+ // << \"'i' = \" << i << \", \"\n+ // << \"'j' = \" << j << \", \"\n+ // << \"'G_x_G[i][j]' = \" << G_x_G[i][j] << \").\";\n+ // throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ // }\n+ // else if (i != j && G_x_G[i][j] != false)\n+ // {\n+ // std::stringstream message;\n+ // message << \"'G_x_G' has to be the identity matrix (\"\n+ // << \"'i' = \" << i << \", \"\n+ // << \"'j' = \" << j << \", \"\n+ // << \"'G_x_G[i][j]' = \" << G_x_G[i][j] << \").\";\n+ // throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ // }\n}\ntemplate <typename B>\n" }, { "change_type": "MODIFY", "old_path": "src/aff3ct.hpp", "new_path": "src/aff3ct.hpp", "diff": "#ifndef DECODER_POLAR_ASCL_MEM_FAST_SYS_CA\n#include <Module/Decoder/Polar/ASCL/Decoder_polar_ASCL_MEM_fast_CA_sys.hpp>\n#endif\n+#ifndef DECODER_POLAR_MK_ASCL_NAIVE_CA\n+#include <Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA.hpp>\n+#endif\n+#ifndef DECODER_POLAR_MK_ASCL_NAIVE_CA_SYS\n+#include <Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA_sys.hpp>\n+#endif\n#ifndef DECODER_POLAR_MK_SC_NAIVE_\n#include <Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp>\n#endif\n" } ]
C++
MIT License
aff3ct/aff3ct
Add polar multi-kernel PA-SCL (sys and non-sys) decoder.
8,490
12.04.2019 13:48:20
-7,200
2c525205eee5de2980e0b12ee4a0fdd1cd99c1ea
Externalize polar decoder lambda functions.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "@@ -80,119 +80,12 @@ Decoder_polar_MK_SC_naive<B,R>\nthis->Ke[ke][i * kernel_size +j] = (B)this->code.get_kernel_matrices()[ke][j][i];\n}\n- auto same_polar_kernel = [](const std::vector<std::vector<bool>>& a, const std::vector<std::vector<bool>>& b)\n- {\n- if (a.size() != b.size())\n- return false;\n-\n- for (size_t i = 0; i < a.size(); i++)\n- {\n- if (a[i].size() != b[i].size())\n- return false;\n- for (size_t j = 0; j < a[i].size(); j++)\n- if (a[i][j] != b[i][j])\n- return false;\n- }\n-\n- return true;\n- };\n-\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\n- lambdas[l].resize(code.get_kernel_matrices()[l].size());\n-\n- if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0},{1,1}})) // Arikan kernel 1 0\n- // 1 1\n- {\n- lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto min = std::min(abs0, abs1);\n-\n- return sign ? -min : min;\n- };\n-\n- lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n- };\n- }\n- else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,1,1},{1,0,1},{0,1,1}})) // 1 1 1\n- // 1 0 1\n- // 0 1 1\n- {\n- lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(std::min(abs0, abs1), abs2);\n-\n- return sign ? -min : min;\n- };\n-\n- lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(abs1, abs2);\n-\n- auto l1_l2 = sign ? -min : min;\n-\n- return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_l2;\n- };\n-\n- lambdas[l][2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- return (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n- (((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n- };\n- }\n- else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0,0},{1,1,0},{1,0,1}})) // 1 0 0\n- // 1 1 0\n- // 1 0 1\n- {\n- lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(std::min(abs0, abs1), abs2);\n-\n- return sign ? -min : min;\n- };\n-\n- lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n-\n- auto sign = std::signbit((float)hl0) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(hl0);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(abs0, abs2);\n- auto hl0_l2 = sign ? -min : min;\n-\n- return hl0_l2 + LLRs[1];\n- };\n-\n- lambdas[l][2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n-\n- return hl0 + LLRs[2];\n- };\n- }\n- else\n- {\n- std::stringstream message;\n- message << \"Unsupported polar kernel.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n+ if (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n+ tools::Polar_lambdas<B,R>::functions.end())\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\n+ lambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "diff": "@@ -97,119 +97,12 @@ Decoder_polar_MK_SCL_naive<B,R>\nthis->Ke[ke][i * kernel_size +j] = (B)this->code.get_kernel_matrices()[ke][j][i];\n}\n- auto same_polar_kernel = [](const std::vector<std::vector<bool>>& a, const std::vector<std::vector<bool>>& b)\n- {\n- if (a.size() != b.size())\n- return false;\n-\n- for (size_t i = 0; i < a.size(); i++)\n- {\n- if (a[i].size() != b[i].size())\n- return false;\n- for (size_t j = 0; j < a[i].size(); j++)\n- if (a[i][j] != b[i][j])\n- return false;\n- }\n-\n- return true;\n- };\n-\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\n- lambdas[l].resize(code.get_kernel_matrices()[l].size());\n-\n- if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0},{1,1}})) // Arikan kernel 1 0\n- // 1 1\n- {\n- lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto min = std::min(abs0, abs1);\n-\n- return sign ? -min : min;\n- };\n-\n- lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n- };\n- }\n- else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,1,1},{1,0,1},{0,1,1}})) // 1 1 1\n- // 1 0 1\n- // 0 1 1\n- {\n- lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(std::min(abs0, abs1), abs2);\n-\n- return sign ? -min : min;\n- };\n-\n- lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(abs1, abs2);\n-\n- auto l1_l2 = sign ? -min : min;\n-\n- return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_l2;\n- };\n-\n- lambdas[l][2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- return (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n- (((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n- };\n- }\n- else if (same_polar_kernel(code.get_kernel_matrices()[l], {{1,0,0},{1,1,0},{1,0,1}})) // 1 0 0\n- // 1 1 0\n- // 1 0 1\n- {\n- lambdas[l][0] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(std::min(abs0, abs1), abs2);\n-\n- return sign ? -min : min;\n- };\n-\n- lambdas[l][1] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n-\n- auto sign = std::signbit((float)hl0) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(hl0);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(abs0, abs2);\n- auto hl0_l2 = sign ? -min : min;\n-\n- return hl0_l2 + LLRs[1];\n- };\n-\n- lambdas[l][2] = [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n-\n- return hl0 + LLRs[2];\n- };\n- }\n- else\n- {\n- std::stringstream message;\n- message << \"Unsupported polar kernel.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n+ if (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n+ tools::Polar_lambdas<B,R>::functions.end())\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\n+ lambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "diff": "+#include \"decoder_polar_functions.h\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::tools;\n+\n+template <typename B, typename R>\n+std::map<std::vector<std::vector<bool>>,\n+ std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n+aff3ct::tools::Polar_lambdas<B,R>::functions = {\n+{\n+ {{1,0},\n+ {1,1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto min = std::min(abs0, abs1);\n+\n+ return sign ? -min : min;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n+ }\n+ }\n+},\n+{\n+ {{1,1,1},\n+ {1,0,1},\n+ {0,1,1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(std::min(abs0, abs1), abs2);\n+\n+ return sign ? -min : min;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(abs1, abs2);\n+\n+ auto l1_l2 = sign ? -min : min;\n+\n+ return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_l2;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ return (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n+ (((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n+ }\n+ }\n+},\n+{\n+ {{1,0,0},\n+ {1,1,0},\n+ {1,0,1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(std::min(abs0, abs1), abs2);\n+\n+ return sign ? -min : min;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n+\n+ auto sign = std::signbit((float)hl0) ^ std::signbit((float)LLRs[2]);\n+ auto abs0 = (R)std::abs(hl0);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(abs0, abs2);\n+ auto hl0_l2 = sign ? -min : min;\n+\n+ return hl0_l2 + LLRs[1];\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n+\n+ return hl0 + LLRs[2];\n+ }\n+ }\n+}};\n+\n+// ==================================================================================== explicit template instantiation\n+#include \"Tools/types.h\"\n+#ifdef AFF3CT_MULTI_PREC\n+template struct aff3ct::tools::Polar_lambdas<B_8,Q_8>;\n+template struct aff3ct::tools::Polar_lambdas<B_16,Q_16>;\n+template struct aff3ct::tools::Polar_lambdas<B_32,Q_32>;\n+template struct aff3ct::tools::Polar_lambdas<B_64,Q_64>;\n+#else\n+template struct aff3ct::tools::Polar_lambdas<B,Q>;\n+#endif\n+// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "diff": "#include <limits>\n#include <utility> // pair\n#include <mipp.h>\n+#include <functional>\n#include \"Tools/Math/utils.h\"\n@@ -120,6 +121,14 @@ template <typename B, typename R>\n__forceinline R phi(const R& mu, const R& lambda, const B& u);\n__forceinline int compute_depth(int index, int tree_depth);\n+\n+template <typename B, typename R>\n+struct Polar_lambdas\n+{\n+ static std::map<std::vector<std::vector<bool>>,\n+ std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>> functions;\n+};\n+\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Externalize polar decoder lambda functions.
8,490
12.04.2019 18:14:11
-7,200
6753515a03c467b77f04d6e4930d4120239ab691
Fix clang error + add 4x4 polar kernel.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "diff": "@@ -20,7 +20,12 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn sign ? -min : min;\n},\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1) -> R\n+#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n{\nreturn ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n}\n@@ -31,7 +36,13 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\n{1,0,1},\n{0,1,1}},\n{\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1,\n+ int b = 1) -> R\n+#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n{\nauto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\nauto abs0 = (R)std::abs(LLRs[0]);\n@@ -41,18 +52,29 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn sign ? -min : min;\n},\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1) -> R\n+#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n{\nauto sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\nauto abs1 = (R)std::abs(LLRs[1]);\nauto abs2 = (R)std::abs(LLRs[2]);\nauto min = std::min(abs1, abs2);\n- auto l1_l2 = sign ? -min : min;\n+ auto l1_x_l2 = sign ? -min : min;\n- return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_l2;\n+ return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_x_l2;\n},\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n+ int d = 1) -> R\n+#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n{\nreturn (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n(((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n@@ -64,7 +86,13 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\n{1,1,0},\n{1,0,1}},\n{\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n+ int d = 1, int e = 1) -> R\n+#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n{\nauto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\nauto abs0 = (R)std::abs(LLRs[0]);\n@@ -74,7 +102,13 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn sign ? -min : min;\n},\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n+ int d = 1, int e = 1, int f = 1) -> R\n+#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n{\nauto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n@@ -82,17 +116,117 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nauto abs0 = (R)std::abs(hl0);\nauto abs2 = (R)std::abs(LLRs[2]);\nauto min = std::min(abs0, abs2);\n- auto hl0_l2 = sign ? -min : min;\n+ auto hl0_x_l2 = sign ? -min : min;\n- return hl0_l2 + LLRs[1];\n+ return hl0_x_l2 + LLRs[1];\n},\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n+ int d = 1, int e = 1, int f = 1,\n+ int g = 1) -> R\n+#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n{\nauto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\nreturn hl0 + LLRs[2];\n}\n}\n+},\n+{\n+ {{1,0,0,0},\n+ {1,1,0,0},\n+ {1,0,1,0},\n+ {1,1,1,1}},\n+ {\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n+ int d = 1, int e = 1, int f = 1,\n+ int g = 1, int h = 1) -> R\n+#else\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n+ {\n+ auto sign = std::signbit((float)LLRs[0]) ^\n+ std::signbit((float)LLRs[1]) ^\n+ std::signbit((float)LLRs[2]) ^\n+ std::signbit((float)LLRs[3]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto abs3 = (R)std::abs(LLRs[3]);\n+ auto min = std::min(std::min(std::min(abs0, abs1), abs2), abs3);\n+\n+ return sign ? -min : min;\n+ },\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n+ int d = 1, int e = 1, int f = 1,\n+ int g = 1, int h = 1, int i = 1) -> R\n+#else\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n+ {\n+ auto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n+\n+ auto sign = std::signbit((float)hl0) ^ std::signbit((float)LLRs[2]);\n+ auto abs0 = (R)std::abs(hl0);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(abs0, abs2);\n+ auto hl0_x_l2 = sign ? -min : min;\n+\n+ sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[3]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs3 = (R)std::abs(LLRs[3]);\n+ min = std::min(abs1, abs3);\n+ auto l1_x_l3 = sign ? -min : min;\n+\n+ return hl0_x_l2 + l1_x_l3;\n+ },\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n+ int d = 1, int e = 1, int f = 1,\n+ int g = 1, int h = 1, int i = 1,\n+ int j = 1) -> R\n+#else\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n+ {\n+ auto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n+ auto hl1 = (( bits[1]) == 0) ? LLRs[1] : -LLRs[1];\n+\n+ auto hl0_p_l2 = hl0 + LLRs[2];\n+ auto hl1_p_l3 = hl1 + LLRs[3];\n+\n+ auto sign = std::signbit((float)hl0_p_l2) ^ std::signbit((float)hl1_p_l3);\n+ auto abs02 = (R)std::abs(hl0_p_l2);\n+ auto abs13 = (R)std::abs(hl1_p_l3);\n+ auto min = std::min(abs02, abs13);\n+\n+ return sign ? -min : min;\n+ },\n+#if defined(__clang__) || defined(__llvm__)\n+ // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n+ int d = 1, int e = 1, int f = 1,\n+ int g = 1, int h = 1, int i = 1,\n+ int j = 1, int k = 1) -> R\n+#else\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+#endif\n+ {\n+ auto hl0 = ((bits[0] ^ bits[1] ^ bits[2]) == 0) ? LLRs[0] : -LLRs[0];\n+ auto hl1 = (( bits[1] ) == 0) ? LLRs[1] : -LLRs[1];\n+ auto hl2 = (( bits[2]) == 0) ? LLRs[2] : -LLRs[2];\n+\n+ return hl0 + hl1 + hl2 + LLRs[3];\n+ }\n+ }\n}};\n// ==================================================================================== explicit template instantiation\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix clang error + add 4x4 polar kernel.
8,490
15.04.2019 14:08:12
-7,200
8da4227ba484d56e3814ca5d7de946b0663a3f5b
Hotfix for Clang compiler.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "diff": "using namespace aff3ct;\nusing namespace aff3ct::tools;\n+#if defined(__clang__) || defined(__llvm__)\n+// hotfix clang bug: \"definition with same mangled name as another definition\"\n+template <typename B, typename R>\n+std::map<std::vector<std::vector<bool>>,\n+ std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n+aff3ct::tools::Polar_lambdas<B,R>::functions = {};\n+#else\ntemplate <typename B, typename R>\nstd::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n@@ -20,12 +27,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn sign ? -min : min;\n},\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nreturn ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n}\n@@ -36,13 +38,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\n{1,0,1},\n{0,1,1}},\n{\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1,\n- int b = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\nauto abs0 = (R)std::abs(LLRs[0]);\n@@ -52,12 +48,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn sign ? -min : min;\n},\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\nauto abs1 = (R)std::abs(LLRs[1]);\n@@ -68,13 +59,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_x_l2;\n},\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n- int d = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nreturn (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n(((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n@@ -86,13 +71,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\n{1,1,0},\n{1,0,1}},\n{\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n- int d = 1, int e = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\nauto abs0 = (R)std::abs(LLRs[0]);\n@@ -102,13 +81,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn sign ? -min : min;\n},\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n- int d = 1, int e = 1, int f = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n@@ -120,14 +93,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn hl0_x_l2 + LLRs[1];\n},\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n- int d = 1, int e = 1, int f = 1,\n- int g = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n@@ -141,14 +107,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\n{1,0,1,0},\n{1,1,1,1}},\n{\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n- int d = 1, int e = 1, int f = 1,\n- int g = 1, int h = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto sign = std::signbit((float)LLRs[0]) ^\nstd::signbit((float)LLRs[1]) ^\n@@ -162,14 +121,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn sign ? -min : min;\n},\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n- int d = 1, int e = 1, int f = 1,\n- int g = 1, int h = 1, int i = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n@@ -187,15 +139,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn hl0_x_l2 + l1_x_l3;\n},\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n- int d = 1, int e = 1, int f = 1,\n- int g = 1, int h = 1, int i = 1,\n- int j = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\nauto hl1 = (( bits[1]) == 0) ? LLRs[1] : -LLRs[1];\n@@ -210,15 +154,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\nreturn sign ? -min : min;\n},\n-#if defined(__clang__) || defined(__llvm__)\n- // fix clang <= 3.9 bug: \"definition with same mangled name as another definition\"\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits, int a = 1, int b = 1, int c = 1,\n- int d = 1, int e = 1, int f = 1,\n- int g = 1, int h = 1, int i = 1,\n- int j = 1, int k = 1) -> R\n-#else\n[](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n-#endif\n{\nauto hl0 = ((bits[0] ^ bits[1] ^ bits[2]) == 0) ? LLRs[0] : -LLRs[0];\nauto hl1 = (( bits[1] ) == 0) ? LLRs[1] : -LLRs[1];\n@@ -228,6 +164,7 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\n}\n}\n}};\n+#endif\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n" } ]
C++
MIT License
aff3ct/aff3ct
Hotfix for Clang compiler.
8,490
15.04.2019 14:51:12
-7,200
3877b00cdf762346a4350745616bd23e3a960158
Hotfix2 for macOS Clang compiler.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "diff": "@@ -8,12 +8,30 @@ using namespace aff3ct::tools;\ntemplate <typename B, typename R>\nstd::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n-aff3ct::tools::Polar_lambdas<B,R>::functions = {};\n+aff3ct::tools::Polar_lambdas<B,R>::functions = {\n+{\n+ {{1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ return LLRs[0];\n+ }\n+ }\n+}};\n#else\ntemplate <typename B, typename R>\nstd::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\naff3ct::tools::Polar_lambdas<B,R>::functions = {\n+{\n+ {{1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ return LLRs[0];\n+ }\n+ }\n+},\n{\n{{1,0},\n{1,1}},\n" } ]
C++
MIT License
aff3ct/aff3ct
Hotfix2 for macOS Clang compiler.
8,490
15.04.2019 17:24:53
-7,200
497a9e830e1266efe7d6b7f1a92cef0fed28b346
Hotfix3 for Clang compiler.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "@@ -80,6 +80,7 @@ Decoder_polar_MK_SC_naive<B,R>\nthis->Ke[ke][i * kernel_size +j] = (B)this->code.get_kernel_matrices()[ke][j][i];\n}\n+#if !defined(__clang__) && !defined(__llvm__)\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\nif (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n@@ -87,6 +88,11 @@ Decoder_polar_MK_SC_naive<B,R>\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\nlambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n+#else\n+ std::stringstream message;\n+ message << \"This decoder is not supported by Clang at this time.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+#endif\n}\ntemplate <typename B, typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "diff": "@@ -97,6 +97,7 @@ Decoder_polar_MK_SCL_naive<B,R>\nthis->Ke[ke][i * kernel_size +j] = (B)this->code.get_kernel_matrices()[ke][j][i];\n}\n+#if !defined(__clang__) && !defined(__llvm__)\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\nif (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n@@ -104,6 +105,11 @@ Decoder_polar_MK_SCL_naive<B,R>\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\nlambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n+#else\n+ std::stringstream message;\n+ message << \"This decoder is not supported by Clang at this time.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+#endif\n}\ntemplate <typename B, typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "diff": "+#if !defined(__clang__) && !defined(__llvm__)\n+\n#include \"decoder_polar_functions.h\"\nusing namespace aff3ct;\nusing namespace aff3ct::tools;\n-#if defined(__clang__) || defined(__llvm__)\n-// hotfix clang bug: \"definition with same mangled name as another definition\"\n-template <typename B, typename R>\n-std::map<std::vector<std::vector<bool>>,\n- std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n-aff3ct::tools::Polar_lambdas<B,R>::functions = {\n-{\n- {{1}},\n- {\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- return LLRs[0];\n- }\n- }\n-}};\n-#else\ntemplate <typename B, typename R>\nstd::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n@@ -182,7 +168,6 @@ aff3ct::tools::Polar_lambdas<B,R>::functions = {\n}\n}\n}};\n-#endif\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n@@ -195,3 +180,5 @@ template struct aff3ct::tools::Polar_lambdas<B_64,Q_64>;\ntemplate struct aff3ct::tools::Polar_lambdas<B,Q>;\n#endif\n// ==================================================================================== explicit template instantiation\n+\n+#endif\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "diff": "@@ -122,13 +122,14 @@ __forceinline R phi(const R& mu, const R& lambda, const B& u);\n__forceinline int compute_depth(int index, int tree_depth);\n+#if !defined(__clang__) && !defined(__llvm__)\ntemplate <typename B, typename R>\nstruct Polar_lambdas\n{\nstatic std::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>> functions;\n};\n-\n+#endif\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Hotfix3 for Clang compiler.
8,490
16.04.2019 15:56:38
-7,200
281a5526e7c3dddedf0e07ebe461322764282682
Fix lambda functions not working on Clang.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "@@ -80,7 +80,6 @@ Decoder_polar_MK_SC_naive<B,R>\nthis->Ke[ke][i * kernel_size +j] = (B)this->code.get_kernel_matrices()[ke][j][i];\n}\n-#if !defined(__clang__) && !defined(__llvm__)\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\nif (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n@@ -88,11 +87,6 @@ Decoder_polar_MK_SC_naive<B,R>\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\nlambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n-#else\n- std::stringstream message;\n- message << \"This decoder is not supported by Clang at this time.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n-#endif\n}\ntemplate <typename B, typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "diff": "@@ -97,7 +97,6 @@ Decoder_polar_MK_SCL_naive<B,R>\nthis->Ke[ke][i * kernel_size +j] = (B)this->code.get_kernel_matrices()[ke][j][i];\n}\n-#if !defined(__clang__) && !defined(__llvm__)\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\nif (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n@@ -105,11 +104,6 @@ Decoder_polar_MK_SCL_naive<B,R>\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\nlambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n-#else\n- std::stringstream message;\n- message << \"This decoder is not supported by Clang at this time.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n-#endif\n}\ntemplate <typename B, typename R>\n" }, { "change_type": "DELETE", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.cpp", "new_path": null, "diff": "-#if !defined(__clang__) && !defined(__llvm__)\n-\n-#include \"decoder_polar_functions.h\"\n-\n-using namespace aff3ct;\n-using namespace aff3ct::tools;\n-\n-template <typename B, typename R>\n-std::map<std::vector<std::vector<bool>>,\n- std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n-aff3ct::tools::Polar_lambdas<B,R>::functions = {\n-{\n- {{1}},\n- {\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- return LLRs[0];\n- }\n- }\n-},\n-{\n- {{1,0},\n- {1,1}},\n- {\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto min = std::min(abs0, abs1);\n-\n- return sign ? -min : min;\n- },\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n- }\n- }\n-},\n-{\n- {{1,1,1},\n- {1,0,1},\n- {0,1,1}},\n- {\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(std::min(abs0, abs1), abs2);\n-\n- return sign ? -min : min;\n- },\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(abs1, abs2);\n-\n- auto l1_x_l2 = sign ? -min : min;\n-\n- return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_x_l2;\n- },\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- return (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n- (((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n- }\n- }\n-},\n-{\n- {{1,0,0},\n- {1,1,0},\n- {1,0,1}},\n- {\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(std::min(abs0, abs1), abs2);\n-\n- return sign ? -min : min;\n- },\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n-\n- auto sign = std::signbit((float)hl0) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(hl0);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(abs0, abs2);\n- auto hl0_x_l2 = sign ? -min : min;\n-\n- return hl0_x_l2 + LLRs[1];\n- },\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n-\n- return hl0 + LLRs[2];\n- }\n- }\n-},\n-{\n- {{1,0,0,0},\n- {1,1,0,0},\n- {1,0,1,0},\n- {1,1,1,1}},\n- {\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto sign = std::signbit((float)LLRs[0]) ^\n- std::signbit((float)LLRs[1]) ^\n- std::signbit((float)LLRs[2]) ^\n- std::signbit((float)LLRs[3]);\n- auto abs0 = (R)std::abs(LLRs[0]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto abs3 = (R)std::abs(LLRs[3]);\n- auto min = std::min(std::min(std::min(abs0, abs1), abs2), abs3);\n-\n- return sign ? -min : min;\n- },\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n-\n- auto sign = std::signbit((float)hl0) ^ std::signbit((float)LLRs[2]);\n- auto abs0 = (R)std::abs(hl0);\n- auto abs2 = (R)std::abs(LLRs[2]);\n- auto min = std::min(abs0, abs2);\n- auto hl0_x_l2 = sign ? -min : min;\n-\n- sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[3]);\n- auto abs1 = (R)std::abs(LLRs[1]);\n- auto abs3 = (R)std::abs(LLRs[3]);\n- min = std::min(abs1, abs3);\n- auto l1_x_l3 = sign ? -min : min;\n-\n- return hl0_x_l2 + l1_x_l3;\n- },\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n- auto hl1 = (( bits[1]) == 0) ? LLRs[1] : -LLRs[1];\n-\n- auto hl0_p_l2 = hl0 + LLRs[2];\n- auto hl1_p_l3 = hl1 + LLRs[3];\n-\n- auto sign = std::signbit((float)hl0_p_l2) ^ std::signbit((float)hl1_p_l3);\n- auto abs02 = (R)std::abs(hl0_p_l2);\n- auto abs13 = (R)std::abs(hl1_p_l3);\n- auto min = std::min(abs02, abs13);\n-\n- return sign ? -min : min;\n- },\n- [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n- {\n- auto hl0 = ((bits[0] ^ bits[1] ^ bits[2]) == 0) ? LLRs[0] : -LLRs[0];\n- auto hl1 = (( bits[1] ) == 0) ? LLRs[1] : -LLRs[1];\n- auto hl2 = (( bits[2]) == 0) ? LLRs[2] : -LLRs[2];\n-\n- return hl0 + hl1 + hl2 + LLRs[3];\n- }\n- }\n-}};\n-\n-// ==================================================================================== explicit template instantiation\n-#include \"Tools/types.h\"\n-#ifdef AFF3CT_MULTI_PREC\n-template struct aff3ct::tools::Polar_lambdas<B_8,Q_8>;\n-template struct aff3ct::tools::Polar_lambdas<B_16,Q_16>;\n-template struct aff3ct::tools::Polar_lambdas<B_32,Q_32>;\n-template struct aff3ct::tools::Polar_lambdas<B_64,Q_64>;\n-#else\n-template struct aff3ct::tools::Polar_lambdas<B,Q>;\n-#endif\n-// ==================================================================================== explicit template instantiation\n-\n-#endif\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "diff": "@@ -122,14 +122,12 @@ __forceinline R phi(const R& mu, const R& lambda, const B& u);\n__forceinline int compute_depth(int index, int tree_depth);\n-#if !defined(__clang__) && !defined(__llvm__)\ntemplate <typename B, typename R>\nstruct Polar_lambdas\n{\nstatic std::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>> functions;\n};\n-#endif\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "diff": "@@ -302,5 +302,170 @@ inline int compute_depth(int index, int tree_depth)\nreturn res;\n}\n}\n+\n+template <typename B, typename R>\n+std::map<std::vector<std::vector<bool>>,\n+ std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n+Polar_lambdas<B,R>::functions = {\n+{\n+ {{1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ return LLRs[0];\n+ }\n+ }\n+},\n+{\n+ {{1,0},\n+ {1,1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto min = std::min(abs0, abs1);\n+\n+ return sign ? -min : min;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + LLRs[1];\n+ }\n+ }\n+},\n+{\n+ {{1,1,1},\n+ {1,0,1},\n+ {0,1,1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(std::min(abs0, abs1), abs2);\n+\n+ return sign ? -min : min;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(abs1, abs2);\n+\n+ auto l1_x_l2 = sign ? -min : min;\n+\n+ return ((bits[0] == 0) ? LLRs[0] : -LLRs[0]) + l1_x_l2;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ return (( bits[0] == 0) ? LLRs[1] : -LLRs[1]) +\n+ (((bits[0] ^ bits[1]) == 0) ? LLRs[2] : -LLRs[2]);\n+ }\n+ }\n+},\n+{\n+ {{1,0,0},\n+ {1,1,0},\n+ {1,0,1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[0]) ^ std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[2]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(std::min(abs0, abs1), abs2);\n+\n+ return sign ? -min : min;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n+\n+ auto sign = std::signbit((float)hl0) ^ std::signbit((float)LLRs[2]);\n+ auto abs0 = (R)std::abs(hl0);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(abs0, abs2);\n+ auto hl0_x_l2 = sign ? -min : min;\n+\n+ return hl0_x_l2 + LLRs[1];\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n+\n+ return hl0 + LLRs[2];\n+ }\n+ }\n+},\n+{\n+ {{1,0,0,0},\n+ {1,1,0,0},\n+ {1,0,1,0},\n+ {1,1,1,1}},\n+ {\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto sign = std::signbit((float)LLRs[0]) ^\n+ std::signbit((float)LLRs[1]) ^\n+ std::signbit((float)LLRs[2]) ^\n+ std::signbit((float)LLRs[3]);\n+ auto abs0 = (R)std::abs(LLRs[0]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto abs3 = (R)std::abs(LLRs[3]);\n+ auto min = std::min(std::min(std::min(abs0, abs1), abs2), abs3);\n+\n+ return sign ? -min : min;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = (bits[0] == 0) ? LLRs[0] : -LLRs[0];\n+\n+ auto sign = std::signbit((float)hl0) ^ std::signbit((float)LLRs[2]);\n+ auto abs0 = (R)std::abs(hl0);\n+ auto abs2 = (R)std::abs(LLRs[2]);\n+ auto min = std::min(abs0, abs2);\n+ auto hl0_x_l2 = sign ? -min : min;\n+\n+ sign = std::signbit((float)LLRs[1]) ^ std::signbit((float)LLRs[3]);\n+ auto abs1 = (R)std::abs(LLRs[1]);\n+ auto abs3 = (R)std::abs(LLRs[3]);\n+ min = std::min(abs1, abs3);\n+ auto l1_x_l3 = sign ? -min : min;\n+\n+ return hl0_x_l2 + l1_x_l3;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = ((bits[0] ^ bits[1]) == 0) ? LLRs[0] : -LLRs[0];\n+ auto hl1 = (( bits[1]) == 0) ? LLRs[1] : -LLRs[1];\n+\n+ auto hl0_p_l2 = hl0 + LLRs[2];\n+ auto hl1_p_l3 = hl1 + LLRs[3];\n+\n+ auto sign = std::signbit((float)hl0_p_l2) ^ std::signbit((float)hl1_p_l3);\n+ auto abs02 = (R)std::abs(hl0_p_l2);\n+ auto abs13 = (R)std::abs(hl1_p_l3);\n+ auto min = std::min(abs02, abs13);\n+\n+ return sign ? -min : min;\n+ },\n+ [](const std::vector<R> &LLRs, const std::vector<B> &bits) -> R\n+ {\n+ auto hl0 = ((bits[0] ^ bits[1] ^ bits[2]) == 0) ? LLRs[0] : -LLRs[0];\n+ auto hl1 = (( bits[1] ) == 0) ? LLRs[1] : -LLRs[1];\n+ auto hl2 = (( bits[2]) == 0) ? LLRs[2] : -LLRs[2];\n+\n+ return hl0 + hl1 + hl2 + LLRs[3];\n+ }\n+ }\n+}};\n+\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix lambda functions not working on Clang.
8,490
18.04.2019 11:02:24
-7,200
3148db83e0ca5cd919d8ef466ca44b9a4b997cf0
Add a more generic way to represent the polar lambda functions.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "@@ -82,10 +82,10 @@ Decoder_polar_MK_SC_naive<B,R>\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\n- if (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n- tools::Polar_lambdas<B,R>::functions.end())\n+ if (tools::Polar_lambdas_bis<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n+ tools::Polar_lambdas_bis<B,R>::functions.end())\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\n- lambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n+ lambdas[l] = tools::Polar_lambdas_bis<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "diff": "@@ -99,10 +99,10 @@ Decoder_polar_MK_SCL_naive<B,R>\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\n- if (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n- tools::Polar_lambdas<B,R>::functions.end())\n+ if (tools::Polar_lambdas_bis<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n+ tools::Polar_lambdas_bis<B,R>::functions.end())\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\n- lambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n+ lambdas[l] = tools::Polar_lambdas_bis<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "diff": "#include <functional>\n#include \"Tools/Math/utils.h\"\n+#include \"Tools/Code/Polar/Polar_code.hpp\"\n#ifndef _MSC_VER\n#ifndef __forceinline\n@@ -128,6 +129,33 @@ struct Polar_lambdas\nstatic std::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>> functions;\n};\n+\n+template <typename R>\n+using proto_xor = R (*)(const R& lambda_a, const R& lambda_b);\n+\n+template <typename R>\n+using proto_plus = R (*)(const R& lambda_a, const R& lambda_b);\n+\n+\n+template <typename R>\n+__forceinline R square_plus(const R& lambda_a, const R& lambda_b);\n+\n+template <typename R>\n+__forceinline R plus(const R& lambda_a, const R& lambda_b);\n+\n+\n+template <typename B, typename R, proto_xor <R> X = square_plus,\n+ proto_plus<R> P = plus>\n+struct Polar_lambdas_bis\n+{\n+private:\n+ static R h(const R &L, const std::vector<B> &u, const std::vector<bool> &m);\n+\n+public:\n+ static std::map<std::vector<std::vector<bool>>,\n+ std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>> functions;\n+};\n+\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "diff": "@@ -467,5 +467,152 @@ Polar_lambdas<B,R>::functions = {\n}\n}};\n+template <typename R>\n+R square_plus(const R& ll, const R& lr)\n+{\n+ auto sign = std::signbit((float)ll) ^ std::signbit((float)lr);\n+ auto absl = (R)std::abs(ll);\n+ auto absr = (R)std::abs(lr);\n+ auto min = std::min(absl, absr);\n+\n+ return sign ? -min : min;\n+}\n+\n+template <typename R>\n+R plus(const R& ll, const R& lr)\n+{\n+ return ll + lr;\n+}\n+\n+template <typename B, typename R, proto_xor<R> X, proto_plus<R> P>\n+R Polar_lambdas_bis<B,R,X,P>\n+::h(const R &L, const std::vector<B> &u, const std::vector<bool> &m)\n+{\n+ bool switch_sign = false;\n+ for (size_t i = 0; i < m.size(); i++)\n+ switch_sign ^= m[i] & u[i];\n+\n+ return switch_sign ? -L : L;\n+}\n+\n+template <typename B, typename R, proto_xor<R> X, proto_plus<R> P>\n+std::map<std::vector<std::vector<bool>>,\n+ std::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n+Polar_lambdas_bis<B,R,X,P>::functions = {\n+{\n+ {{1}},\n+ {\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return L[0];\n+ }\n+ }\n+},\n+{\n+ {{1,0},\n+ {1,1}},\n+ {\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return X(L[0], L[1]);\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(h(L[0],u,{1}), L[1]);\n+ }\n+ }\n+},\n+{\n+ {{1,1,1},\n+ {1,0,1},\n+ {0,1,1}},\n+ {\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return X(X(L[0], L[1]), L[2]);\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(h(L[0],u,{1}), X(L[1], L[2]));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(h(L[1],u,{1,0}), h(L[2],u,{1,1}));\n+ }\n+ }\n+},\n+{\n+ {{1,0,0},\n+ {1,1,0},\n+ {1,0,1}},\n+ {\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return X(X(L[0], L[1]), L[2]);\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(X(h(L[0],u,{1}), L[2]), L[1]);\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(h(L[0],u,{1,1}), L[2]);\n+ }\n+ }\n+},\n+{\n+ {{1,0,0,0},\n+ {1,1,0,0},\n+ {1,0,1,0},\n+ {1,1,1,1}},\n+ {\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return X(X(X(L[0], L[1]), L[2]), L[3]);\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(X(h(L[0],u,{1}), L[2]), X(L[1], L[2]));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return X(P(h(L[0],u,{1,1}), L[2]), P(h(L[1],u,{0,1}), L[3]));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(P(P(h(L[0],u,{1,1,1}), h(L[1],u,{0,1,0})), h(L[2],u,{0,0,1})), L[3]);\n+ }\n+ }\n+},\n+{\n+ {{1,0,0,0,0},\n+ {1,1,0,0,0},\n+ {1,0,1,0,0},\n+ {1,0,0,1,0},\n+ {1,1,1,0,1}},\n+ {\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return X(X(X(X(L[0], L[1]), L[2]), L[3]), L[4]);\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(X(X(h(L[0],u,{1}), L[2]), L[3]), X(L[1], L[4]));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return X(P(h(L[1],u,{0,1}), L[4]), P(L[2], X(h(L[0],u,{1,1}), L[3])));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(L[3], (X(h(L[0],u,{1,1,1}), P(P(h(L[1],u,{0,1,0}), h(L[2],u,{0,0,1})), L[3]))));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ return P(P(P(h(L[0],u,{1,1,1,1}), h(L[1],u,{0,1,0,0})), h(L[2],u,{0,0,1,0})), L[4]);\n+ }\n+ }\n+}};\n+\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a more generic way to represent the polar lambda functions.
8,490
18.04.2019 11:30:43
-7,200
998dfb9a07b7189395e8d100d7ff1cd3e1f3b621
Rm useless include + cosmetics.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "diff": "#include <functional>\n#include \"Tools/Math/utils.h\"\n-#include \"Tools/Code/Polar/Polar_code.hpp\"\n#ifndef _MSC_VER\n#ifndef __forceinline\n@@ -131,18 +130,16 @@ struct Polar_lambdas\n};\ntemplate <typename R>\n-using proto_xor = R (*)(const R& lambda_a, const R& lambda_b);\n+using proto_xor = R (*)(const R& ll, const R& lr);\ntemplate <typename R>\n-using proto_plus = R (*)(const R& lambda_a, const R& lambda_b);\n-\n+using proto_plus = R (*)(const R& ll, const R& lr);\ntemplate <typename R>\n-__forceinline R square_plus(const R& lambda_a, const R& lambda_b);\n+__forceinline R square_plus(const R& ll, const R& lr);\ntemplate <typename R>\n-__forceinline R plus(const R& lambda_a, const R& lambda_b);\n-\n+__forceinline R plus(const R& ll, const R& lr);\ntemplate <typename B, typename R, proto_xor <R> X = square_plus,\nproto_plus<R> P = plus>\n" } ]
C++
MIT License
aff3ct/aff3ct
Rm useless include + cosmetics.
8,490
18.04.2019 16:14:02
-7,200
42a84a9542c72a1862dac5f6ca3ced3b5d8800ae
Add a generic GA frozen bits generator for mono/multi-kernel polar codes.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/encoder.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/encoder.rst", "diff": "@@ -109,7 +109,8 @@ Kronecker product:\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n:Type: text\n- :Allowed values: ``FILE`` ``GA``\n+ :Default: ``GA``\n+ :Allowed values: ``GA`` ``GAA`` ``FILE``\n:Examples: ``--enc-fb-gen-method FILE``\n|factory::Frozenbits_generator_MK::parameters::p+gen-method|\n@@ -119,11 +120,14 @@ Description of the allowed values:\n+----------+-------------------------------------------------------------------+\n| Value | Description |\n+==========+===================================================================+\n+| ``GA`` | Select the |GA| method from :cite:`Trifonov2012`. |\n++----------+-------------------------------------------------------------------+\n+| ``GAA`` | Select the |GA| method from :cite:`Trifonov2012` (works only for |\n+| | Arikan mono-kernel polar codes). |\n++----------+-------------------------------------------------------------------+\n| ``FILE`` | Read the best channels from an external file, to use with the |\n| | :ref:`enc-polar_mk-enc-fb-awgn-path` parameter. |\n+----------+-------------------------------------------------------------------+\n-| ``GA`` | Select the |GA| method from :cite:`Trifonov2012`. |\n-+----------+-------------------------------------------------------------------+\n.. note:: When using the ``FILE`` method, the frozen bits are always the same\nregardless of the |SNR| value.\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar/Frozenbits_generator.cpp", "new_path": "src/Factory/Tools/Code/Polar/Frozenbits_generator.cpp", "diff": "#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_file.hpp\"\n#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_5G.hpp\"\n#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_TV.hpp\"\n-#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp\"\n+#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA_Arikan.hpp\"\n#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_BEC.hpp\"\n#include \"Frozenbits_generator.hpp\"\n@@ -98,7 +98,7 @@ void Frozenbits_generator::parameters\ntools::Frozenbits_generator* Frozenbits_generator::parameters\n::build() const\n{\n- if (this->type == \"GA\" ) return new tools::Frozenbits_generator_GA (this->K, this->N_cw, 2 );\n+ if (this->type == \"GA\" ) return new tools::Frozenbits_generator_GA_Arikan(this->K, this->N_cw );\nif (this->type == \"TV\" ) return new tools::Frozenbits_generator_TV (this->K, this->N_cw, this->path_fb, this->path_pb);\nif (this->type == \"FILE\") return new tools::Frozenbits_generator_file (this->K, this->N_cw, this->path_fb );\nif (this->type == \"5G\") return new tools::Frozenbits_generator_5G (this->K, this->N_cw );\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.cpp", "new_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.cpp", "diff": "#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_file.hpp\"\n#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp\"\n+#include \"Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA_Arikan.hpp\"\n#include \"Frozenbits_generator_MK.hpp\"\n@@ -42,7 +43,7 @@ void Frozenbits_generator_MK::parameters\ntools::Real(tools::Positive(), tools::Non_zero()));\ntools::add_arg(args, p, class_name+\"p+gen-method\",\n- tools::Text(tools::Including_set(\"FILE\", \"GA\")));\n+ tools::Text(tools::Including_set(\"FILE\", \"GA\", \"GAA\")));\ntools::add_arg(args, p, class_name+\"p+awgn-path\",\ntools::Path(tools::openmode::read));\n@@ -76,7 +77,8 @@ void Frozenbits_generator_MK::parameters\ntools::Frozenbits_generator* Frozenbits_generator_MK::parameters\n::build(const tools::Polar_code &pc) const\n{\n- if (this->type == \"GA\" && pc.is_mono_kernel()) return new tools::Frozenbits_generator_GA (this->K, this->N_cw, pc.get_kernel_matrices()[0].size());\n+ if (this->type == \"GAA\" && pc.is_mono_kernel() == 2) return new tools::Frozenbits_generator_GA_Arikan(this->K, this->N_cw );\n+ if (this->type == \"GA\" ) return new tools::Frozenbits_generator_GA (this->K, this->N_cw, pc );\nif (this->type == \"FILE\" ) return new tools::Frozenbits_generator_file (this->K, this->N_cw, this->path_fb);\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.hpp", "new_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.hpp", "diff": "@@ -23,7 +23,7 @@ struct Frozenbits_generator_MK : public Factory\nint N_cw = -1;\n// optional parameters\n- std::string type = \"FILE\";\n+ std::string type = \"GA\";\nstd::string path_fb = \"../conf/cde/awgn_polar_codes/TV\";\nfloat noise = -1.f;\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "@@ -292,5 +292,8 @@ template class aff3ct::module::Decoder_polar_MK_SC_naive<B_32,Q_32>;\ntemplate class aff3ct::module::Decoder_polar_MK_SC_naive<B_64,Q_64>;\n#else\ntemplate class aff3ct::module::Decoder_polar_MK_SC_naive<B,Q>;\n+#if !defined(AFF3CT_64BIT_PREC)\n+template class aff3ct::module::Decoder_polar_MK_SC_naive<B_64,Q_64>;\n+#endif\n#endif\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp", "diff": "namespace aff3ct\n{\n+namespace tools\n+{\n+class Frozenbits_generator_GA;\n+}\nnamespace module\n{\ntemplate <typename B = int, typename R = float>\n@@ -32,6 +36,7 @@ template <typename B = int, typename R = float>\nclass Decoder_polar_MK_SC_naive : public Decoder_SIHO<B,R>, public tools::Frozenbits_notifier\n{\nfriend Decoder_polar_MK_ASCL_naive_CA<B,R>;\n+ friend tools::Frozenbits_generator_GA;\nprotected:\nconst tools::Polar_code &code;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "diff": "#include <iostream>\n#include <algorithm>\n+#include \"Tools/Code/Polar/decoder_polar_functions.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Frozenbits_generator_GA.hpp\"\nusing namespace aff3ct::tools;\n+std::vector<bool> init_fb(const int K, const int N)\n+{\n+ std::vector<bool> fake_frozen_bits(N);\n+ std::fill(fake_frozen_bits.begin(), fake_frozen_bits.begin() + K, 0);\n+ std::fill(fake_frozen_bits.begin() + K, fake_frozen_bits.end(), 1);\n+ return fake_frozen_bits;\n+}\n+\nFrozenbits_generator_GA\n-::Frozenbits_generator_GA(const int K, const int N, const int base)\n-: Frozenbits_generator(K, N), base(base), m((int)(std::log(N) / std::log(base))), z((int)std::pow(base, m), 0)\n+::Frozenbits_generator_GA(const int K, const int N, const Polar_code& code)\n+: Frozenbits_generator(K, N),\n+ code(code),\n+ z(code.get_codeword_size()),\n+ fake_frozen_bits(init_fb(K, code.get_codeword_size())),\n+ decoder_sc(K, code.get_codeword_size(), code, fake_frozen_bits)\n{\n- if (base < 2)\n+ recursive_override_frozen_bits(decoder_sc.polar_tree.get_root());\n+\n+ for (size_t l = 0; l < decoder_sc.lambdas.size(); l++)\n{\n- std::stringstream message;\n- message << \"'base' has to be bigger or equal to 2 ('base' = \" << this->base << \").\";\n- throw invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ if (Polar_lambdas_bis<int64_t,double>::functions.find(code.get_kernel_matrices()[l]) ==\n+ Polar_lambdas_bis<int64_t,double>::functions.end())\n+ throw runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\n+ decoder_sc.lambdas[l] =\n+ Polar_lambdas_bis<int64_t,double,square_plus_DE,plus_DE>::functions[code.get_kernel_matrices()[l]];\n}\n}\n@@ -32,28 +49,14 @@ void Frozenbits_generator_GA\n{\nthis->check_noise();\n- std::iota(this->best_channels.begin(), this->best_channels.end(), 0);\n-\n- for (auto i = 0; i < std::pow(this->base, m); i++)\n+ for (auto i = 0; i < this->N; i++)\nz[i] = 2.0 / std::pow((double)this->n->get_noise(), 2.0);\n- for (auto l = 1; l <= m; l++)\n- {\n- auto o1 = (int)std::pow(this->base, m - l +1);\n- auto o2 = (int)std::pow(this->base, m - l );\n-\n- for (auto t = 0; t < (int)std::pow(this->base, l -1); t++)\n- {\n- double T = z[t * o1];\n-\n- z[t * o1] = phi_inv(1.0 - std::pow(1.0 - phi(T), 2.0));\n- if (z[t * o1] == HUGE_VAL)\n- z[t * o1] = T + M_LN2 / (alpha * gamma);\n-\n- z[t * o1 + o2] = 2.0 * T;\n- }\n- }\n+ this->decoder_sc._load(z.data());\n+ this->decoder_sc.recursive_decode(this->decoder_sc.polar_tree.get_root());\n+ this->recursive_store_DE(this->decoder_sc.polar_tree.get_root(), z.data());\n+ std::iota(this->best_channels.begin(), this->best_channels.end(), 0);\nstd::sort(this->best_channels.begin(), this->best_channels.end(), [this](int i1, int i2) { return z[i1] > z[i2]; });\n}\n@@ -82,3 +85,37 @@ void Frozenbits_generator_GA\nthis->n->is_of_type_throw(tools::Noise_type::SIGMA);\n}\n+\n+void Frozenbits_generator_GA\n+::recursive_override_frozen_bits(const Generic_node<module::Contents_MK_SC<int64_t, double>>* node_curr)\n+{\n+ if (!node_curr->is_leaf()) // stop condition\n+ for (auto c : node_curr->get_children())\n+ this->recursive_override_frozen_bits(c); // recursive call\n+ else\n+ node_curr->get_contents()->is_frozen_bit = true;\n+}\n+\n+void Frozenbits_generator_GA\n+::recursive_store_DE(const Generic_node<module::Contents_MK_SC<int64_t, double>>* node_curr, double *z) const\n+{\n+ if (!node_curr->is_leaf()) // stop condition\n+ for (auto c : node_curr->get_children())\n+ this->recursive_store_DE(c, z); // recursive call\n+ else\n+ z[node_curr->get_lane_id()] = node_curr->get_contents()->l[0];\n+}\n+\n+double Frozenbits_generator_GA\n+::square_plus_DE(const double& zl, const double& zr)\n+{\n+ auto z = phi_inv(1.0 - ((1.0 - phi(zl)) * (1.0 - phi(zr))));\n+ return (z == HUGE_VAL) ? zl + M_LN2 / (alpha * gamma) : z;\n+ // return z;\n+}\n+\n+double Frozenbits_generator_GA\n+::plus_DE(const double& zl, const double& zr)\n+{\n+ return zl + zr;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp", "diff": "#include <limits>\n#include <vector>\n+#include \"Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp\"\n+\n+#include \"Tools/Code/Polar/Polar_code.hpp\"\n+\n#include \"Frozenbits_generator.hpp\"\nnamespace aff3ct\n@@ -13,33 +17,41 @@ namespace tools\nclass Frozenbits_generator_GA : public Frozenbits_generator\n{\nprivate:\n- const int base;\n- const int m;\n+ const Polar_code& code;\nstd::vector<double> z;\n- const double alpha = -0.4527;\n- const double beta = 0.0218;\n- const double gamma = 0.8600;\n+ static constexpr double alpha = -0.4527;\n+ static constexpr double beta = 0.0218;\n+ static constexpr double gamma = 0.8600;\n+\n+ static constexpr double a = 1.0 / alpha;\n+ static constexpr double b = -beta / alpha;\n+ static constexpr double c = 1.0 / gamma;\n- const double a = 1.0 / alpha;\n- const double b = -beta / alpha;\n- const double c = 1.0 / gamma;\n+ static constexpr double phi_pivot = 0.867861;\n+ static constexpr double phi_inv_pivot = 0.6845772418;\n- const double phi_pivot = 0.867861;\n- const double phi_inv_pivot = 0.6845772418;\n+ static constexpr double bisection_max = std::numeric_limits<double>::max();\n- const double bisection_max = std::numeric_limits<double>::max();\n+ std::vector<bool> fake_frozen_bits;\n+ module::Decoder_polar_MK_SC_naive<int64_t, double> decoder_sc;\npublic:\n- Frozenbits_generator_GA(const int K, const int N, const int base = 2);\n+ Frozenbits_generator_GA(const int K, const int N, const Polar_code& code);\nvirtual ~Frozenbits_generator_GA() = default;\nprotected:\nvoid evaluate();\n- double phi (double t);\n- double phi_inv(double t);\n+ static double phi (double t);\n+ static double phi_inv(double t);\nvirtual void check_noise();\n+\n+ void recursive_override_frozen_bits(const Generic_node<module::Contents_MK_SC<int64_t, double>>* node_curr);\n+ void recursive_store_DE(const Generic_node<module::Contents_MK_SC<int64_t, double>>* node_curr, double *z) const;\n+\n+ static double square_plus_DE(const double& ll, const double& lr);\n+ static double plus_DE (const double& ll, const double& lr);\n};\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA_Arikan.cpp", "diff": "+#ifndef _USE_MATH_DEFINES\n+#define _USE_MATH_DEFINES\n+#endif\n+\n+#include <cmath>\n+#include <limits>\n+#include <numeric>\n+#include <fstream>\n+#include <iostream>\n+#include <algorithm>\n+\n+#include \"Tools/Exception/exception.hpp\"\n+\n+#include \"Frozenbits_generator_GA_Arikan.hpp\"\n+\n+using namespace aff3ct::tools;\n+\n+Frozenbits_generator_GA_Arikan\n+::Frozenbits_generator_GA_Arikan(const int K, const int N)\n+: Frozenbits_generator(K, N), m((int)std::log2(N)), z((int)std::exp2(m), 0)\n+{\n+}\n+\n+void Frozenbits_generator_GA_Arikan\n+::evaluate()\n+{\n+ this->check_noise();\n+\n+ for (auto i = 0; i < std::exp2(m); i++)\n+ z[i] = 2.0 / std::pow((double)this->n->get_noise(), 2.0);\n+\n+ for (auto l = 1; l <= m; l++)\n+ {\n+ auto o1 = (int)std::exp2(m - l +1);\n+ auto o2 = (int)std::exp2(m - l );\n+\n+ for (auto t = 0; t < (int)std::exp2(l -1); t++)\n+ {\n+ double T = z[t * o1];\n+\n+ z[t * o1] = phi_inv(1.0 - std::pow(1.0 - phi(T), 2.0));\n+ if (z[t * o1] == HUGE_VAL)\n+ z[t * o1] = T + M_LN2 / (alpha * gamma);\n+\n+ z[t * o1 + o2] = 2.0 * T;\n+ }\n+ }\n+\n+ std::iota(this->best_channels.begin(), this->best_channels.end(), 0);\n+ std::sort(this->best_channels.begin(), this->best_channels.end(), [this](int i1, int i2) { return z[i1] > z[i2]; });\n+}\n+\n+double Frozenbits_generator_GA_Arikan\n+::phi(double t)\n+{\n+ if (t < phi_pivot)\n+ return std::exp(0.0564 * t * t - 0.48560 * t);\n+ else // if(t >= phi_pivot)\n+ return std::exp(alpha * std::pow(t, gamma) + beta);\n+}\n+\n+double Frozenbits_generator_GA_Arikan\n+::phi_inv(double t)\n+{\n+ if (t > phi_inv_pivot)\n+ return 4.304964539 * (1 - sqrt(1 + 0.9567131408 * std::log(t)));\n+ else\n+ return std::pow(a * std::log(t) + b, c);\n+}\n+\n+void Frozenbits_generator_GA_Arikan\n+::check_noise()\n+{\n+ Frozenbits_generator::check_noise();\n+\n+ this->n->is_of_type_throw(tools::Noise_type::SIGMA);\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA_Arikan.hpp", "diff": "+#ifndef FROZENBITS_GENERATOR_GA_ARIKAN_HPP_\n+#define FROZENBITS_GENERATOR_GA_ARIKAN_HPP_\n+\n+#include <limits>\n+#include <vector>\n+\n+#include \"Frozenbits_generator.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+class Frozenbits_generator_GA_Arikan : public Frozenbits_generator\n+{\n+private:\n+ const int m;\n+ std::vector<double> z;\n+\n+ const double alpha = -0.4527;\n+ const double beta = 0.0218;\n+ const double gamma = 0.8600;\n+\n+ const double a = 1.0 / alpha;\n+ const double b = -beta / alpha;\n+ const double c = 1.0 / gamma;\n+\n+ const double phi_pivot = 0.867861;\n+ const double phi_inv_pivot = 0.6845772418;\n+\n+ const double bisection_max = std::numeric_limits<double>::max();\n+\n+public:\n+ Frozenbits_generator_GA_Arikan(const int K, const int N);\n+\n+ virtual ~Frozenbits_generator_GA_Arikan() = default;\n+\n+protected:\n+ void evaluate();\n+ double phi (double t);\n+ double phi_inv(double t);\n+ virtual void check_noise();\n+};\n+}\n+}\n+\n+#endif /* FROZENBITS_GENERATOR_GA_ARIKAN_HPP_ */\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Polar_code.cpp", "new_path": "src/Tools/Code/Polar/Polar_code.cpp", "diff": "@@ -383,10 +383,14 @@ void Polar_code\n}\n}\n-bool Polar_code\n+size_t Polar_code\n::is_mono_kernel() const\n{\n- return true;\n+ auto type = stages[0];\n+ for (size_t s = 1; s < stages.size(); s++)\n+ if (stages[s] != type)\n+ return 0;\n+ return this->get_kernel_matrices()[0].size();\n}\nint Polar_code\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Polar_code.hpp", "new_path": "src/Tools/Code/Polar/Polar_code.hpp", "diff": "@@ -29,7 +29,7 @@ public:\nvirtual ~Polar_code() = default;\n- bool is_mono_kernel() const;\n+ size_t is_mono_kernel() const;\nint get_codeword_size() const;\nconst std::vector<std::vector<std::vector<bool>>>& get_kernel_matrices() const;\nconst std::vector<uint32_t>& get_stages() const;\n" } ]
C++
MIT License
aff3ct/aff3ct
Add a generic GA frozen bits generator for mono/multi-kernel polar codes.
8,490
18.04.2019 16:17:41
-7,200
72de27c2e9edb4296ab2ca0671a53d552ff60132
Regen headers.
[ { "change_type": "MODIFY", "old_path": "src/aff3ct.hpp", "new_path": "src/aff3ct.hpp", "diff": "#ifndef FROZENBITS_GENERATOR_FILE_HPP_\n#include <Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_file.hpp>\n#endif\n+#ifndef FROZENBITS_GENERATOR_GA_ARIKAN_HPP_\n+#include <Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA_Arikan.hpp>\n+#endif\n#ifndef FROZENBITS_GENERATOR_GA_HPP_\n#include <Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp>\n#endif\n" } ]
C++
MIT License
aff3ct/aff3ct
Regen headers.
8,490
18.04.2019 16:29:43
-7,200
f5c010e47b95f55d115d33f86da72ca8051fa740
Fix some MSVC warnings.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA.hpp", "new_path": "src/Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA.hpp", "diff": "@@ -30,7 +30,6 @@ public:\nvirtual void notify_frozenbits_update();\nprotected:\n- void _decode (const R *Y_N, B *V_K, const int frame_id);\nvoid _decode_siho (const R *Y_N, B *V_K, const int frame_id);\nvoid _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\n};\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA_sys.hpp", "new_path": "src/Module/Decoder/Polar_MK/ASCL/Decoder_polar_MK_ASCL_naive_CA_sys.hpp", "diff": "@@ -30,7 +30,6 @@ public:\nvirtual void notify_frozenbits_update();\nprotected:\n- void _decode (const R *Y_N, B *V_K, const int frame_id);\nvoid _decode_siho (const R *Y_N, B *V_K, const int frame_id);\nvoid _decode_siho_cw(const R *Y_N, B *V_N, const int frame_id);\n};\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "diff": "@@ -490,7 +490,7 @@ R Polar_lambdas_bis<B,R,X,P>\n{\nbool switch_sign = false;\nfor (size_t i = 0; i < m.size(); i++)\n- switch_sign ^= m[i] & u[i];\n+ switch_sign ^= m[i] & (bool)u[i];\nreturn switch_sign ? -L : L;\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix some MSVC warnings.
8,490
18.04.2019 17:11:03
-7,200
bb3757ececeff3f62f16bf83994f2f661b91e472
Fix MSVC namespace error.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "diff": "#include \"Frozenbits_generator_GA.hpp\"\n+using namespace aff3ct;\nusing namespace aff3ct::tools;\nstd::vector<bool> init_fb(const int K, const int N)\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix MSVC namespace error.
8,490
18.04.2019 21:36:09
-7,200
dba6e879a1a43b44233b46b254b467e343aff2f8
Fix the polar MK SCL decoder.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "diff": "@@ -407,8 +407,13 @@ void Decoder_polar_MK_SCL_naive<B,R>\ntools::Generic_node<Contents_MK_SCL<B,R>>* node_b,\ntools::Generic_node<Contents_MK_SCL<B,R>>* node_caller)\n{\n- if (!node_a->is_leaf() && node_a->get_children()[0] != node_caller)\n- node_b->get_children()[0]->get_c()->s = node_a->get_children()[0]->get_c()->s;\n+ if (!node_a->is_leaf())\n+ for (size_t c = 0; c < node_a->get_children().size()-1; c++)\n+ {\n+ auto child_a = node_a->get_children()[c];\n+ if (child_a != node_caller)\n+ node_b->get_children()[c]->get_c()->s = child_a->get_c()->s;\n+ }\nif (!node_a->is_root())\nthis->recursive_duplicate_tree_sums(node_a->get_father(), node_b->get_father(), node_a);\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix the polar MK SCL decoder.
8,490
18.04.2019 23:20:25
-7,200
e6b23267c0253cab2a7ff3b8cad95a76703507bc
Fix 4x4 polar kernel lambda function.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "diff": "@@ -572,7 +572,7 @@ Polar_lambdas_bis<B,R,X,P>::functions = {\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(X(h(L[0],u,{1}), L[2]), X(L[1], L[2]));\n+ return P(X(h(L[0],u,{1}), L[2]), X(L[1], L[3]));\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix 4x4 polar kernel lambda function.
8,490
19.04.2019 10:46:40
-7,200
116c5f236e30a75038cde4c0f1500eefe30def96
Simplify the GA code.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "diff": "@@ -50,8 +50,7 @@ void Frozenbits_generator_GA\n{\nthis->check_noise();\n- for (auto i = 0; i < this->N; i++)\n- z[i] = 2.0 / std::pow((double)this->n->get_noise(), 2.0);\n+ std::fill(z.begin(), z.end(), 2.0 / std::pow((double)this->n->get_noise(), 2.0));\nthis->decoder_sc._load(z.data());\nthis->decoder_sc.recursive_decode(this->decoder_sc.polar_tree.get_root());\n" } ]
C++
MIT License
aff3ct/aff3ct
Simplify the GA code.
8,490
19.04.2019 10:47:30
-7,200
6bd7f8ff7c50c159cbfaf41c27f52f8ebd6291d5
Add the 'to_file' method for polar code path.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.cpp", "new_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.cpp", "diff": "@@ -46,7 +46,7 @@ void Frozenbits_generator_MK::parameters\ntools::Text(tools::Including_set(\"FILE\", \"GA\", \"GAA\")));\ntools::add_arg(args, p, class_name+\"p+awgn-path\",\n- tools::Path(tools::openmode::read));\n+ tools::File(tools::openmode::read));\n}\nvoid Frozenbits_generator_MK::parameters\n@@ -57,7 +57,7 @@ void Frozenbits_generator_MK::parameters\nif(vals.exist({p+\"-info-bits\", \"K\"})) this->K = vals.to_int ({p+\"-info-bits\", \"K\"});\nif(vals.exist({p+\"-cw-size\", \"N\"})) this->N_cw = vals.to_int ({p+\"-cw-size\", \"N\"});\nif(vals.exist({p+\"-noise\" })) this->noise = vals.to_float({p+\"-noise\" });\n- if(vals.exist({p+\"-awgn-path\" })) this->path_fb = vals.at ({p+\"-awgn-path\" });\n+ if(vals.exist({p+\"-awgn-path\" })) this->path_fb = vals.to_file ({p+\"-awgn-path\" });\nif(vals.exist({p+\"-gen-method\" })) this->type = vals.at ({p+\"-gen-method\" });\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar_MK/Polar_code.cpp", "new_path": "src/Factory/Tools/Code/Polar_MK/Polar_code.cpp", "diff": "@@ -61,7 +61,7 @@ void Polar_code::parameters\nif(vals.exist({p+\"-cw-size\", \"N\"})) this->N_cw = vals.to_int ({p+\"-cw-size\", \"N\"});\nif(vals.exist({p+\"-kernel\" })) this->kernel_matrix = vals.to_list<std::vector<bool>>({p+\"-kernel\" });\n- if(vals.exist({p+\"-path\" })) this->code_path = vals.at ({p+\"-path\" });\n+ if(vals.exist({p+\"-path\" })) this->code_path = vals.to_file ({p+\"-path\" });\n}\nvoid Polar_code::parameters\n" } ]
C++
MIT License
aff3ct/aff3ct
Add the 'to_file' method for polar code path.
8,490
19.04.2019 14:11:11
-7,200
4a545489e7bb95cecc2b7f8d856af8d5352939c5
Add polar multi-kernel reference curves.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -624,6 +624,60 @@ test-regression-polar:\n# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_POLAR\n# - ./ci/test-regression.py --refs-path refs/POLAR --results-path test-regression-results-polar --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+test-regression-polar-mk:\n+ stage: test\n+ variables:\n+ GIT_SUBMODULE_STRATEGY: recursive\n+ retry: 1\n+ except:\n+ - schedules\n+ dependencies:\n+ - build-linux-gcc-x64-sse4.2\n+ tags:\n+ - linux\n+ - x86\n+ - 64-bit\n+ - sse4.2\n+ - powerful\n+ - python3.4\n+ artifacts:\n+ name: test-regression-results-polar-mk\n+ when: always\n+ paths:\n+ - test-regression-results-polar-mk/\n+ script:\n+ - source ./ci/tools/threads.sh\n+ - source ./ci/tools/git-version.sh\n+ - export TIME_SEC=\"5\"\n+ - ./ci/test-regression.py --refs-path refs/POLAR_MK --results-path test-regression-results-polar-mk --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\n+# test-regression-polar-mk-long:\n+# stage: test\n+# variables:\n+# GIT_SUBMODULE_STRATEGY: recursive\n+# only:\n+# - schedules\n+# dependencies:\n+# - build-linux-gcc-x64-avx2\n+# tags:\n+# - linux\n+# - x86\n+# - 64-bit\n+# - avx2\n+# - powerful\n+# - schedules\n+# - python3.4\n+# artifacts:\n+# name: test-regression-results-polar-mk\n+# when: always\n+# paths:\n+# - test-regression-results-polar-mk/\n+# script:\n+# - source ./ci/tools/threads.sh\n+# - source ./ci/tools/git-version.sh\n+# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_POLAR\n+# - ./ci/test-regression.py --refs-path refs/POLAR_MK --results-path test-regression-results-polar-mk --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n+\ntest-regression-ra:\nstage: test\nvariables:\n" }, { "change_type": "MODIFY", "old_path": "conf", "new_path": "conf", "diff": "-Subproject commit 868a3f749d9aa30d6a87de33d8285a6c5302dec3\n+Subproject commit 659b60cb8162c5ebbadbaa506a97d607f02b3cb8\n" }, { "change_type": "MODIFY", "old_path": "refs", "new_path": "refs", "diff": "-Subproject commit 0f45bb28d276d6b2030b5fb2dd078d0a5dc1677c\n+Subproject commit 5125c4b48180ba402ab657fb8cf2bd8b71229d55\n" } ]
C++
MIT License
aff3ct/aff3ct
Add polar multi-kernel reference curves.
8,490
19.04.2019 16:54:13
-7,200
b4baa8a648b3e5f2c1a3d8b6e5faf97406e82844
Check if a polar code can be systematic or not.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive_sys.cpp", "diff": "@@ -15,6 +15,13 @@ Decoder_polar_MK_SC_naive_sys<B,R>\n{\nconst std::string name = \"Decoder_polar_MK_SC_sys_naive\";\nthis->set_name(name);\n+\n+ if (!this->code.can_be_systematic())\n+ {\n+ std::stringstream message;\n+ message << \"This polar code does not support systematic encoding.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n}\ntemplate <typename B, typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive_sys.cpp", "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive_sys.cpp", "diff": "@@ -23,6 +23,13 @@ Decoder_polar_MK_SCL_naive_sys<B,R>\n{\nconst std::string name = \"Decoder_polar_MK_SCL_naive_sys\";\nthis->set_name(name);\n+\n+ if (!this->code.can_be_systematic())\n+ {\n+ std::stringstream message;\n+ message << \"This polar code does not support systematic encoding.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n}\ntemplate <typename B, typename R>\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK_sys.cpp", "new_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK_sys.cpp", "diff": "using namespace aff3ct;\nusing namespace aff3ct::module;\n-template <typename T = int32_t>\n-void kronecker_product(const std::vector<std::vector<T>>& A,\n- const std::vector<std::vector<T>>& B,\n- std::vector<std::vector<T>>& C)\n-{\n- for (auto row_A = 0; row_A < (int)A.size(); row_A++)\n- for (auto col_A = 0; col_A < (int)A[0].size(); col_A++)\n- for (auto row_B = 0; row_B < (int)B.size(); row_B++)\n- for (auto col_B = 0; col_B < (int)B[0].size(); col_B++)\n- C[row_A * B.size() + row_B][col_A * B[0].size() + col_B] = A[row_A][col_A] * B[row_B][col_B];\n-}\n+// template <typename T = int32_t>\n+// void kronecker_product(const std::vector<std::vector<T>>& A,\n+// const std::vector<std::vector<T>>& B,\n+// std::vector<std::vector<T>>& C)\n+// {\n+// for (auto row_A = 0; row_A < (int)A.size(); row_A++)\n+// for (auto col_A = 0; col_A < (int)A[0].size(); col_A++)\n+// for (auto row_B = 0; row_B < (int)B.size(); row_B++)\n+// for (auto col_B = 0; col_B < (int)B[0].size(); col_B++)\n+// C[row_A * B.size() + row_B][col_A * B[0].size() + col_B] = A[row_A][col_A] * B[row_B][col_B];\n+// }\n-void kronecker_product(const std::vector<std::vector<bool>>& A,\n- const std::vector<std::vector<bool>>& B,\n- std::vector<std::vector<bool>>& C)\n-{\n- for (auto row_A = 0; row_A < (int)A.size(); row_A++)\n- for (auto col_A = 0; col_A < (int)A[0].size(); col_A++)\n- for (auto row_B = 0; row_B < (int)B.size(); row_B++)\n- for (auto col_B = 0; col_B < (int)B[0].size(); col_B++)\n- C[row_A * B.size() + row_B][col_A * B[0].size() + col_B] = A[row_A][col_A] && B[row_B][col_B];\n-}\n+// void kronecker_product(const std::vector<std::vector<bool>>& A,\n+// const std::vector<std::vector<bool>>& B,\n+// std::vector<std::vector<bool>>& C)\n+// {\n+// for (auto row_A = 0; row_A < (int)A.size(); row_A++)\n+// for (auto col_A = 0; col_A < (int)A[0].size(); col_A++)\n+// for (auto row_B = 0; row_B < (int)B.size(); row_B++)\n+// for (auto col_B = 0; col_B < (int)B[0].size(); col_B++)\n+// C[row_A * B.size() + row_B][col_A * B[0].size() + col_B] = A[row_A][col_A] && B[row_B][col_B];\n+// }\n-template <typename T = int32_t>\n-std::vector<std::vector<T>> kronecker_product(const std::vector<std::vector<T>>& A,\n- const std::vector<std::vector<T>>& B)\n-{\n- // verifications --------------------------------------------------------------------------------------------------\n- if (A.size() == 0)\n- {\n- std::stringstream message;\n- message << \"'A.size()' should be higher than 0 ('A.size()' = \" << A.size() << \").\";\n- throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n- }\n+// template <typename T = int32_t>\n+// std::vector<std::vector<T>> kronecker_product(const std::vector<std::vector<T>>& A,\n+// const std::vector<std::vector<T>>& B)\n+// {\n+// // verifications --------------------------------------------------------------------------------------------------\n+// if (A.size() == 0)\n+// {\n+// std::stringstream message;\n+// message << \"'A.size()' should be higher than 0 ('A.size()' = \" << A.size() << \").\";\n+// throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n+// }\n- if (B.size() == 0)\n- {\n- std::stringstream message;\n- message << \"'B.size()' should be higher than 0 ('B.size()' = \" << B.size() << \").\";\n- throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n- }\n+// if (B.size() == 0)\n+// {\n+// std::stringstream message;\n+// message << \"'B.size()' should be higher than 0 ('B.size()' = \" << B.size() << \").\";\n+// throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n+// }\n- for (auto l = 0; l < (int)A.size(); l++)\n- {\n- if (A[l].size() != A.size())\n- {\n- std::stringstream message;\n- message << \"'A[l].size()' has to be equal to 'A.size()' ('l' = \" << l\n- << \", 'A[l].size()' = \" << A[l].size()\n- << \", 'A.size()' = \" << A.size() << \").\";\n- throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- }\n+// for (auto l = 0; l < (int)A.size(); l++)\n+// {\n+// if (A[l].size() != A.size())\n+// {\n+// std::stringstream message;\n+// message << \"'A[l].size()' has to be equal to 'A.size()' ('l' = \" << l\n+// << \", 'A[l].size()' = \" << A[l].size()\n+// << \", 'A.size()' = \" << A.size() << \").\";\n+// throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n+// }\n+// }\n- for (auto l = 0; l < (int)B.size(); l++)\n- {\n- if (B[l].size() != B.size())\n- {\n- std::stringstream message;\n- message << \"'B[l].size()' has to be equal to 'B.size()' ('l' = \" << l\n- << \", 'B[l].size()' = \" << B[l].size()\n- << \", 'B.size()' = \" << B.size() << \").\";\n- throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- }\n- // ----------------------------------------------------------------------------------------------------------------\n+// for (auto l = 0; l < (int)B.size(); l++)\n+// {\n+// if (B[l].size() != B.size())\n+// {\n+// std::stringstream message;\n+// message << \"'B[l].size()' has to be equal to 'B.size()' ('l' = \" << l\n+// << \", 'B[l].size()' = \" << B[l].size()\n+// << \", 'B.size()' = \" << B.size() << \").\";\n+// throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n+// }\n+// }\n+// // ----------------------------------------------------------------------------------------------------------------\n- std::vector<std::vector<T>> C(A.size() * B.size(), std::vector<T>(A[0].size() * B[0].size()));\n- kronecker_product(A, B, C);\n- return C;\n-}\n+// std::vector<std::vector<T>> C(A.size() * B.size(), std::vector<T>(A[0].size() * B[0].size()));\n+// kronecker_product(A, B, C);\n+// return C;\n+// }\ntemplate <typename B>\nEncoder_polar_MK_sys<B>\n@@ -136,6 +136,13 @@ Encoder_polar_MK_sys<B>\n// << \"'G_x_G[i][j]' = \" << G_x_G[i][j] << \").\";\n// throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n// }\n+\n+ if (!this->code.can_be_systematic())\n+ {\n+ std::stringstream message;\n+ message << \"This polar code does not support systematic encoding.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n}\ntemplate <typename B>\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Polar_code.cpp", "new_path": "src/Tools/Code/Polar/Polar_code.cpp", "diff": "@@ -383,6 +383,65 @@ void Polar_code\n}\n}\n+bool Polar_code\n+::can_be_systematic() const\n+{\n+ if (!this->is_mono_kernel())\n+ {\n+ const auto n_stages_2 = this->get_stages().size() / 2;\n+ for (size_t sl = 0; sl < n_stages_2; sl++)\n+ if (this->get_stages()[sl] != this->get_stages()[this->get_stages().size() -1 -sl])\n+ {\n+ // std::stringstream message;\n+ // message << \"The stages are not symetric.\";\n+ // throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ return false;\n+ }\n+ }\n+\n+ for (auto &kernel : this->get_kernel_matrices())\n+ {\n+ // compute the \"K x K\" product\n+ auto k_x_k = kernel;\n+ for (auto i = 0; i < (int)kernel.size(); i++)\n+ for (auto j = 0; j < (int)kernel.size(); j++)\n+ {\n+ uint32_t sum_r = 0;\n+ for (auto k = 0; k < (int)kernel.size(); k++)\n+ sum_r += (uint32_t)(kernel[i][k] & kernel[k][j]);\n+ k_x_k[i][j] = (bool)(sum_r & (uint32_t)1);\n+ }\n+\n+ // check if \"kernel x kernel\" is the identity matrix\n+ for (auto i = 0; i < (int)k_x_k.size(); i++)\n+ for (auto j = 0; j < (int)k_x_k.size(); j++)\n+ if (i == j && k_x_k[i][j] != true)\n+ {\n+ // std::stringstream message;\n+ // message << \"'k_x_k' has to be the identity matrix (\"\n+ // << \"'i' = \" << i << \", \"\n+ // << \"'j' = \" << j << \", \"\n+ // << \"'k_x_k[i][j]' = \" << k_x_k[i][j] << \"), the '\"\n+ // << tools::display_kernel(kernel) << \"' kernel is incompatible.\";\n+ // throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ return false;\n+ }\n+ else if (i != j && k_x_k[i][j] != false)\n+ {\n+ // std::stringstream message;\n+ // message << \"'k_x_k' has to be the identity matrix (\"\n+ // << \"'i' = \" << i << \", \"\n+ // << \"'j' = \" << j << \", \"\n+ // << \"'k_x_k[i][j]' = \" << k_x_k[i][j] << \"), the '\"\n+ // << tools::display_kernel(kernel) << \"' kernel is incompatible.\";\n+ // throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ return false;\n+ }\n+ }\n+\n+ return true;\n+}\n+\nsize_t Polar_code\n::is_mono_kernel() const\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Polar_code.hpp", "new_path": "src/Tools/Code/Polar/Polar_code.hpp", "diff": "@@ -29,6 +29,7 @@ public:\nvirtual ~Polar_code() = default;\n+ bool can_be_systematic() const;\nsize_t is_mono_kernel() const;\nint get_codeword_size() const;\nconst std::vector<std::vector<std::vector<bool>>>& get_kernel_matrices() const;\n" } ]
C++
MIT License
aff3ct/aff3ct
Check if a polar code can be systematic or not.
8,490
19.04.2019 22:50:50
-7,200
e6c1703c7c4f70e56593e7b92737c6ce1c81bdbc
Fix MSVC link errors.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "diff": "@@ -141,16 +141,14 @@ __forceinline R square_plus(const R& ll, const R& lr);\ntemplate <typename R>\n__forceinline R plus(const R& ll, const R& lr);\n-template <typename B, typename R, proto_xor <R> X = square_plus,\n- proto_plus<R> P = plus>\n+template <typename B, typename R, proto_xor <R> X = square_plus<R>,\n+ proto_plus<R> P = plus<R>>\nstruct Polar_lambdas_bis\n{\n-private:\n- static R h(const R &L, const std::vector<B> &u, const std::vector<bool> &m);\n-\npublic:\nstatic std::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>> functions;\n+ static R h(const R &L, const std::vector<B> &u, const std::vector<bool> &m);\n};\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix MSVC link errors.
8,490
23.04.2019 16:14:22
-7,200
813769319aa968fa0cdfdc985c095327c8592777
Fix noise management in Polar MK codec when working on 64-bit floats.
[ { "change_type": "MODIFY", "old_path": "src/Module/Codec/Codec.hpp", "new_path": "src/Module/Codec/Codec.hpp", "diff": "@@ -70,7 +70,7 @@ public:\nconst tools::Noise<float>& current_noise() const;\nvirtual void set_noise(const tools::Noise<float>& noise);\n- void set_noise(const tools::Noise<double>& noise);\n+ virtual void set_noise(const tools::Noise<double>& noise);\ntemplate <class A = std::allocator<Q>>\nvoid extract_sys_llr(const std::vector<Q,A> &Y_N, std::vector<Q,A> &Y_K, const int frame_id = -1);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.cpp", "new_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.cpp", "diff": "@@ -116,6 +116,22 @@ void Codec_polar_MK<B,Q>\n}\n}\n+template <typename B, typename Q>\n+void Codec_polar_MK<B,Q>\n+::set_noise(const tools::Noise<double>& noise)\n+{\n+ Codec_SIHO<B,Q>::set_noise(noise);\n+\n+ // adaptive frozen bits generation\n+ if (adaptive_fb)\n+ {\n+ fb_generator->set_noise(noise);\n+ fb_generator->generate(frozen_bits);\n+\n+ this->notify_frozenbits_update();\n+ }\n+}\n+\ntemplate <typename B, typename Q>\nstd::vector<bool>& Codec_polar_MK<B,Q>\n::get_frozen_bits()\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.hpp", "new_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.hpp", "diff": "@@ -38,6 +38,7 @@ public:\nvirtual ~Codec_polar_MK() = default;\nvirtual void set_noise(const tools::Noise<float>& noise);\n+ virtual void set_noise(const tools::Noise<double>& noise);\nstd::vector<bool>& get_frozen_bits();\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix noise management in Polar MK codec when working on 64-bit floats.
8,490
23.04.2019 16:16:58
-7,200
fe8434a0dc5143e3222bce8c8c7daeef08657db4
Fix noise management in Polar codec when working on 64-bit floats.
[ { "change_type": "MODIFY", "old_path": "src/Module/Codec/Codec.hpp", "new_path": "src/Module/Codec/Codec.hpp", "diff": "@@ -70,7 +70,7 @@ public:\nconst tools::Noise<float>& current_noise() const;\nvirtual void set_noise(const tools::Noise<float>& noise);\n- void set_noise(const tools::Noise<double>& noise);\n+ virtual void set_noise(const tools::Noise<double>& noise);\ntemplate <class A = std::allocator<Q>>\nvoid extract_sys_llr(const std::vector<Q,A> &Y_N, std::vector<Q,A> &Y_K, const int frame_id = -1);\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Codec/Polar/Codec_polar.cpp", "new_path": "src/Module/Codec/Polar/Codec_polar.cpp", "diff": "@@ -180,6 +180,22 @@ void Codec_polar<B,Q>\n}\n}\n+template <typename B, typename Q>\n+void Codec_polar<B,Q>\n+::set_noise(const tools::Noise<double>& noise)\n+{\n+ Codec_SISO_SIHO<B,Q>::set_noise(noise);\n+\n+ // adaptive frozen bits generation\n+ if (adaptive_fb && !generated_decoder)\n+ {\n+ fb_generator->set_noise(noise);\n+ fb_generator->generate(frozen_bits);\n+\n+ this->notify_frozenbits_update();\n+ }\n+}\n+\ntemplate <typename B, typename Q>\nstd::vector<bool>& Codec_polar<B,Q>\n::get_frozen_bits()\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Codec/Polar/Codec_polar.hpp", "new_path": "src/Module/Codec/Polar/Codec_polar.hpp", "diff": "@@ -40,6 +40,7 @@ public:\nvirtual ~Codec_polar() = default;\nvirtual void set_noise(const tools::Noise<float>& noise);\n+ virtual void set_noise(const tools::Noise<double>& noise);\nstd::vector<bool>& get_frozen_bits();\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix noise management in Polar codec when working on 64-bit floats.
8,490
23.04.2019 16:31:16
-7,200
aaa6ba8ae0d6cda1c24c0c6973ef02ac878897ab
Fix Sphinx compilation error.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/decoder.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/decoder.rst", "diff": "@@ -90,8 +90,8 @@ Description of the allowed values:\n+-----------+-----------------------+\n.. |dec-node-type_ms| replace::\n- :math:`\\DeclareMathOperator{\\sign}{sign} L_a \\boxplus L_b \\simeq\n- \\sign(L_a).\\sign(L_b).\\min(|L_a|,|L_b|)`.\n+ :math:`L_a \\boxplus L_b \\simeq\n+ \\text{sign}(L_a).\\text{sign}(L_b).\\min(|L_a|,|L_b|)`.\n.. |dec-node-type_spa| replace::\n:math:`L_a \\boxplus L_b =\n2\\tanh^{-1}(\\tanh(\\frac{L_a}{2}).\\tanh(\\frac{L_b}{2}))`.\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix Sphinx compilation error.
8,490
24.04.2019 10:50:20
-7,200
98547f2f38d47061d72e638d5204346cd66b7656
Fix non-adaptive frozen bits generation in polar MK.
[ { "change_type": "MODIFY", "old_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.cpp", "new_path": "src/Module/Codec/Polar_MK/Codec_polar_MK.cpp", "diff": "@@ -87,6 +87,17 @@ Codec_polar_MK<B,Q>\n// ------------------------------------------------------------------------------------------------- frozen bit gen\nif (!adaptive_fb)\n{\n+ if (fb_params.type == \"BEC\")\n+ {\n+ auto ep = tools::Event_probability<float>(fb_params.noise);\n+ fb_generator->set_noise(ep);\n+ }\n+ else /* type = GA, TV or FILE */\n+ {\n+ auto sigma = tools::Sigma<float>(fb_params.noise);\n+ fb_generator->set_noise(sigma);\n+ }\n+\nfb_generator->generate(frozen_bits);\nthis->notify_frozenbits_update();\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix non-adaptive frozen bits generation in polar MK.
8,490
24.04.2019 10:58:11
-7,200
7f9a92fe0c08aa7ccd08fd33d2957cc3553acda0
Simplify the GA generator.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "diff": "@@ -40,7 +40,7 @@ Frozenbits_generator_GA\nPolar_lambdas_bis<int64_t,double>::functions.end())\nthrow runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\ndecoder_sc.lambdas[l] =\n- Polar_lambdas_bis<int64_t,double,square_plus_DE,plus_DE>::functions[code.get_kernel_matrices()[l]];\n+ Polar_lambdas_bis<int64_t,double,square_plus_DE>::functions[code.get_kernel_matrices()[l]];\n}\n}\n@@ -112,9 +112,3 @@ double Frozenbits_generator_GA\nreturn (z == HUGE_VAL) ? zl + M_LN2 / (alpha * gamma) : z;\n// return z;\n}\n\\ No newline at end of file\n-\n-double Frozenbits_generator_GA\n-::plus_DE(const double& zl, const double& zr)\n-{\n- return zl + zr;\n-}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp", "diff": "@@ -50,7 +50,6 @@ protected:\nvoid recursive_store_DE(const Generic_node<module::Contents_MK_SC<int64_t, double>>* node_curr, double *z) const;\nstatic double square_plus_DE(const double& ll, const double& lr);\n- static double plus_DE (const double& ll, const double& lr);\n};\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Simplify the GA generator.
8,490
24.04.2019 15:20:49
-7,200
f2d3cae3871ff31427287fd8c8aa9fbd41e61918
Add the possibility to dump the best channels of the polar codes.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/polar/encoder.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/polar/encoder.rst", "diff": "@@ -123,6 +123,19 @@ positions in the codeword. The strategy is to freeze the less reliable channels.\nconfiguration files are a set of best channels pre-generated with the |TV|\nmethod (see ``conf/cde/awgn_polar_codes/TV/``).\n+.. _enc-polar-enc-fb-dump-path:\n+\n+``--enc-fb-dump-path``\n+\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n+\n+ :Type: folder\n+ :Rights: write only\n+ :Examples: ``--enc-fb-dump-path example/path/to/the/right/place/``\n+\n+|factory::Frozenbits_generator::parameters::p+dump-path|\n+\n+.. note:: Works only for the ``GA`` and ``BEC`` frozen bits generation methods.\n+\n.. _enc-polar-enc-fb-noise:\n``--enc-fb-noise``\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/strings.rst", "new_path": "doc/sphinx/strings.rst", "diff": "Set the path to a file or a directory containing the best channels to select\nthe frozen bits.\n+.. |factory::Frozenbits_generator::parameters::p+dump-path| replace::\n+ Set the path to store the best channels.\n+\n.. |factory::Frozenbits_generator::parameters::p+pb-path| replace::\nSet the path of the polar bounds code generator (generates best channels to\nuse).\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar/Frozenbits_generator.cpp", "new_path": "src/Factory/Tools/Code/Polar/Frozenbits_generator.cpp", "diff": "@@ -56,6 +56,9 @@ void Frozenbits_generator::parameters\ntools::add_arg(args, p, class_name+\"p+awgn-path\",\ntools::Path(tools::openmode::read));\n+ tools::add_arg(args, p, class_name+\"p+dump-path\",\n+ tools::Folder(tools::openmode::write));\n+\n#ifdef AFF3CT_POLAR_BOUNDS\ntools::add_arg(args, p, class_name+\"p+pb-path\",\ntools::File(tools::openmode::read));\n@@ -72,6 +75,7 @@ void Frozenbits_generator::parameters\nif(vals.exist({p+\"-noise\" })) this->noise = vals.to_float ({p+\"-noise\" });\nif(vals.exist({p+\"-awgn-path\" })) this->path_fb = vals.to_path ({p+\"-awgn-path\" });\nif(vals.exist({p+\"-gen-method\" })) this->type = vals.at ({p+\"-gen-method\" });\n+ if(vals.exist({p+\"-dump-path\" })) this->dump_channels_path = vals.to_folder({p+\"-dump-path\" });\n#ifdef AFF3CT_POLAR_BOUNDS\nif(vals.exist({p+\"-pb-path\"})) this->path_pb = vals.to_file({p+\"-pb-path\"});\n@@ -93,16 +97,18 @@ void Frozenbits_generator::parameters\n#endif\nif (this->type == \"TV\" || this->type == \"FILE\")\nheaders[p].push_back(std::make_pair(\"Path\", this->path_fb));\n+ if (!this->dump_channels_path.empty() && (this->type == \"GA\" || this->type == \"BEC\"))\n+ headers[p].push_back(std::make_pair(\"Dump channels path\", this->dump_channels_path));\n}\ntools::Frozenbits_generator* Frozenbits_generator::parameters\n::build() const\n{\n- if (this->type == \"GA\" ) return new tools::Frozenbits_generator_GA (this->K, this->N_cw );\n+ if (this->type == \"GA\" ) return new tools::Frozenbits_generator_GA (this->K, this->N_cw, this->dump_channels_path );\nif (this->type == \"TV\" ) return new tools::Frozenbits_generator_TV (this->K, this->N_cw, this->path_fb, this->path_pb);\nif (this->type == \"FILE\") return new tools::Frozenbits_generator_file(this->K, this->N_cw, this->path_fb );\nif (this->type == \"5G\") return new tools::Frozenbits_generator_5G (this->K, this->N_cw );\n- if (this->type == \"BEC\") return new tools::Frozenbits_generator_BEC (this->K, this->N_cw );\n+ if (this->type == \"BEC\") return new tools::Frozenbits_generator_BEC (this->K, this->N_cw, this->dump_channels_path );\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar/Frozenbits_generator.hpp", "new_path": "src/Factory/Tools/Code/Polar/Frozenbits_generator.hpp", "diff": "@@ -25,6 +25,7 @@ struct Frozenbits_generator : public Factory\nstd::string type = \"GA\";\nstd::string path_fb = \"conf/cde/awgn_polar_codes/TV\";\nstd::string path_pb = \"../lib/polar_bounds/bin/polar_bounds\";\n+ std::string dump_channels_path = \"\";\nfloat noise = -1.f;\n// ---------------------------------------------------------------------------------------------------- METHODS\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator.cpp", "diff": "+#include <sstream>\n+#include <fstream>\n+#include <numeric>\n+\n+#include \"Tools/Noise/noise_utils.h\"\n+#include \"Tools/Exception/exception.hpp\"\n+\n+#include \"Frozenbits_generator.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::tools;\n+\n+std::thread::id Frozenbits_generator::master_thread_id = std::this_thread::get_id();\n+\n+Frozenbits_generator\n+::Frozenbits_generator(const int K, const int N, const std::string &dump_channels_path, const bool dump_channels_single_thread)\n+: dump_channels_path(dump_channels_path),\n+ dump_channels_single_thread(dump_channels_single_thread),\n+ K(K),\n+ N(N),\n+ best_channels(N)\n+{\n+ std::iota(this->best_channels.begin(), this->best_channels.end(), 0);\n+}\n+\n+int Frozenbits_generator\n+::get_K() const\n+{\n+ return this->K;\n+}\n+\n+int Frozenbits_generator\n+::get_N() const\n+{\n+ return this->N;\n+}\n+\n+void Frozenbits_generator\n+::set_noise(const tools::Noise<float>& noise)\n+{\n+ this->n.reset(tools::cast<float>(noise));\n+}\n+\n+void Frozenbits_generator\n+::set_noise(const tools::Noise<double>& noise)\n+{\n+ this->n.reset(tools::cast<float>(noise));\n+}\n+\n+void Frozenbits_generator\n+::generate(std::vector<bool> &frozen_bits)\n+{\n+ if (frozen_bits.size() != (unsigned)N)\n+ {\n+ std::stringstream message;\n+ message << \"'frozen_bits.size()' has to be equal to 'N' ('frozen_bits.size()' = \" << frozen_bits.size()\n+ << \", 'N' = \" << N << \").\";\n+ throw length_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ this->evaluate();\n+\n+ // init frozen_bits vector, true means frozen bits, false means information bits\n+ std::fill(frozen_bits.begin(), frozen_bits.end(), true);\n+ for (auto i = 0; i < K; i++)\n+ frozen_bits[best_channels[i]] = false;\n+\n+ if (!dump_channels_path.empty() && (!dump_channels_single_thread || this->master_thread_id == std::this_thread::get_id()))\n+ {\n+ std::string noise_type = \"unkn\";\n+ switch (this->n->get_type())\n+ {\n+ case tools::Noise_type::SIGMA:\n+ noise_type = \"awgn\";\n+ break;\n+ case tools::Noise_type::EP:\n+ noise_type = \"bec\";\n+ break;\n+ default:\n+ break;\n+ };\n+\n+ std::stringstream noise;\n+ noise << std::fixed << std::setprecision(3) << this->n->get_noise();\n+\n+ std::string dump_channels_full_path = dump_channels_path + \"/N\" + std::to_string(this->N) + \"_\"\n+ + noise_type + \"_s\" + noise.str() + \".pc\";\n+ this->dump_best_channels(dump_channels_full_path);\n+ }\n+}\n+\n+const std::vector<uint32_t>& Frozenbits_generator\n+::get_best_channels() const\n+{\n+ return best_channels;\n+}\n+\n+void Frozenbits_generator\n+::check_noise()\n+{\n+ if (this->n == nullptr)\n+ {\n+ std::stringstream message;\n+ message << \"No noise has been set.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+}\n+\n+void Frozenbits_generator\n+::dump_best_channels(const std::string& dump_channels_full_path) const\n+{\n+ std::string noise_type = \"unkn\";\n+ switch (this->n->get_type())\n+ {\n+ case tools::Noise_type::SIGMA:\n+ noise_type = \"awgn\";\n+ break;\n+ case tools::Noise_type::EP:\n+ noise_type = \"bec\";\n+ break;\n+ default:\n+ break;\n+ };\n+\n+ std::ofstream file(dump_channels_full_path);\n+\n+ file << this->N << std::endl;\n+ file << noise_type << std::endl;\n+ file << std::fixed << std::setprecision(3) << this->n->get_noise() << std::endl;\n+\n+ for (auto c : this->best_channels)\n+ file << c << \" \";\n+ file << std::endl;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator.hpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator.hpp", "diff": "#ifndef FROZENBITS_GENERATOR_HPP_\n#define FROZENBITS_GENERATOR_HPP_\n-#include <sstream>\n+#include <thread>\n#include <vector>\n#include <memory>\n#include <Tools/Noise/Noise.hpp>\n-#include <Tools/Noise/noise_utils.h>\n-\n-#include \"Tools/Exception/exception.hpp\"\nnamespace aff3ct\n{\n@@ -26,6 +23,11 @@ namespace tools\n*/\nclass Frozenbits_generator\n{\n+private:\n+ static std::thread::id master_thread_id;\n+ const std::string dump_channels_path;\n+ const bool dump_channels_single_thread;\n+\nprotected:\nconst int K; /*!< Number of information bits in the frame. */\nconst int N; /*!< Codeword size (or frame size). */\n@@ -40,76 +42,47 @@ public:\n* \\param K: number of information bits in the frame.\n* \\param N: codeword size (or frame size).\n*/\n- Frozenbits_generator(const int K, const int N)\n- : K(K), N(N), best_channels(N) {}\n+ Frozenbits_generator(const int K, const int N, const std::string &dump_channels_path = \"\",\n+ const bool dump_channels_single_thread = true);\n/*!\n* \\brief Destructor.\n*/\nvirtual ~Frozenbits_generator() = default;\n- int get_K() const\n- {\n- return this->K;\n- }\n+ int get_K() const;\n- int get_N() const\n- {\n- return this->N;\n- }\n+ int get_N() const;\n/*!\n* \\brief Sets the current noise to apply to the input signal\n*\n* \\param sigma: the current noise to apply to the input signal\n*/\n- void set_noise(const tools::Noise<float>& noise)\n- {\n- this->n.reset(tools::cast<float>(noise));\n- }\n+ void set_noise(const tools::Noise<float>& noise);\n/*!\n* \\brief Sets the current noise to apply to the input signal\n*\n* \\param sigma: the current noise to apply to the input signal\n*/\n- void set_noise(const tools::Noise<double>& noise)\n- {\n- this->n.reset(tools::cast<float>(noise));\n- }\n+ void set_noise(const tools::Noise<double>& noise);\n/*!\n* \\brief Generates the frozen bits vector.\n*\n* \\param frozen_bits: output vector of frozen bits.\n*/\n- void generate(std::vector<bool> &frozen_bits)\n- {\n- if (frozen_bits.size() != (unsigned)N)\n- {\n- std::stringstream message;\n- message << \"'frozen_bits.size()' has to be equal to 'N' ('frozen_bits.size()' = \" << frozen_bits.size()\n- << \", 'N' = \" << N << \").\";\n- throw length_error(__FILE__, __LINE__, __func__, message.str());\n- }\n-\n- this->evaluate();\n-\n- // init frozen_bits vector, true means frozen bits, false means information bits\n- std::fill(frozen_bits.begin(), frozen_bits.end(), true);\n- for (auto i = 0; i < K; i++)\n- frozen_bits[best_channels[i]] = false;\n- }\n+ void generate(std::vector<bool> &frozen_bits);\n/*!\n* \\brief Gets the best channels (the most secured bits sorted by descending order).\n*\n* \\return a vector of the best channels.\n*/\n- const std::vector<uint32_t>& get_best_channels() const\n- {\n- return best_channels;\n- }\n+ const std::vector<uint32_t>& get_best_channels() const;\n+\n+ void dump_best_channels(const std::string& dump_channels_full_path) const;\nprotected:\n@@ -124,15 +97,7 @@ protected:\n/*!\n* \\brief Check that the noise has the expected type\n*/\n- virtual void check_noise()\n- {\n- if (this->n == nullptr)\n- {\n- std::stringstream message;\n- message << \"No noise has been set.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- }\n+ virtual void check_noise();\n};\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_BEC.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_BEC.cpp", "diff": "using namespace aff3ct::tools;\nFrozenbits_generator_BEC\n-::Frozenbits_generator_BEC(const int K, const int N)\n-: Frozenbits_generator(K, N), m((int)std::log2(N)), z((int)std::exp2(m), 0)\n+::Frozenbits_generator_BEC(const int K, const int N, const std::string &dump_channels_path, const bool dump_channels_single_thread)\n+: Frozenbits_generator(K, N, dump_channels_path, dump_channels_single_thread),\n+ m((int)std::log2(N)),\n+ z((int)std::exp2(m), 0)\n{\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_BEC.hpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_BEC.hpp", "diff": "@@ -17,7 +17,8 @@ private:\nstd::vector<double> z;\npublic:\n- Frozenbits_generator_BEC(const int K, const int N);\n+ Frozenbits_generator_BEC(const int K, const int N, const std::string &dump_channels_path = \"\",\n+ const bool dump_channels_single_thread = true);\n~Frozenbits_generator_BEC();\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "diff": "using namespace aff3ct::tools;\nFrozenbits_generator_GA\n-::Frozenbits_generator_GA(const int K, const int N)\n-: Frozenbits_generator(K, N), m((int)std::log2(N)), z((int)std::exp2(m), 0)\n+::Frozenbits_generator_GA(const int K, const int N, const std::string &dump_channels_path,\n+ const bool dump_channels_single_thread)\n+: Frozenbits_generator(K, N, dump_channels_path, dump_channels_single_thread),\n+ m((int)std::log2(N)),\n+ z((int)std::exp2(m), 0)\n{\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp", "diff": "@@ -30,7 +30,8 @@ private:\nconst double bisection_max = std::numeric_limits<double>::max();\npublic:\n- Frozenbits_generator_GA(const int K, const int N);\n+ Frozenbits_generator_GA(const int K, const int N, const std::string &dump_channels_path = \"\",\n+ const bool dump_channels_single_thread = true);\nvirtual ~Frozenbits_generator_GA() = default;\n" } ]
C++
MIT License
aff3ct/aff3ct
Add the possibility to dump the best channels of the polar codes.
8,490
24.04.2019 16:26:22
-7,200
943a89e877ca42780af4c7212ffeb5c032dfd2dc
Add the possibility to dump the best channels of the polar MK codes.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/encoder.rst", "new_path": "doc/sphinx/source/user/simulation/parameters/codec/polar_mk/encoder.rst", "diff": "@@ -165,6 +165,19 @@ positions in the codeword. The strategy is to freeze the less reliable channels.\n.. warning:: The ``FILE`` frozen bits generator expects a file and not a\ndirectory.\n+.. _enc-polar_mk-enc-fb-dump-path:\n+\n+``--enc-fb-dump-path``\n+\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n+\n+ :Type: folder\n+ :Rights: write only\n+ :Examples: ``--enc-fb-dump-path example/path/to/the/right/place/``\n+\n+|factory::Frozenbits_generator_MK::parameters::p+dump-path|\n+\n+.. note:: Works only for the ``GA`` and ``GAA`` frozen bits generation methods.\n+\n.. _enc-polar_mk-enc-fb-noise:\n``--enc-fb-noise``\n" }, { "change_type": "MODIFY", "old_path": "doc/sphinx/strings.rst", "new_path": "doc/sphinx/strings.rst", "diff": "Set the path to a file or a directory containing the best channels to select\nthe frozen bits.\n+.. |factory::Frozenbits_generator_MK::parameters::p+dump-path| replace::\n+ Set the path to store the best channels.\n+\n.. ---------------------------------------------- factory Polar_code parameters\n.. |factory::Polar_code::parameters::p+kernel| replace::\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.cpp", "new_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.cpp", "diff": "@@ -47,6 +47,9 @@ void Frozenbits_generator_MK::parameters\ntools::add_arg(args, p, class_name+\"p+awgn-path\",\ntools::File(tools::openmode::read));\n+\n+ tools::add_arg(args, p, class_name+\"p+dump-path\",\n+ tools::Folder(tools::openmode::write));\n}\nvoid Frozenbits_generator_MK::parameters\n@@ -59,6 +62,7 @@ void Frozenbits_generator_MK::parameters\nif(vals.exist({p+\"-noise\" })) this->noise = vals.to_float ({p+\"-noise\" });\nif(vals.exist({p+\"-awgn-path\" })) this->path_fb = vals.to_file ({p+\"-awgn-path\" });\nif(vals.exist({p+\"-gen-method\" })) this->type = vals.at ({p+\"-gen-method\" });\n+ if(vals.exist({p+\"-dump-path\" })) this->dump_channels_path = vals.to_folder({p+\"-dump-path\" });\n}\nvoid Frozenbits_generator_MK::parameters\n@@ -72,13 +76,15 @@ void Frozenbits_generator_MK::parameters\nheaders[p].push_back(std::make_pair(\"Noise\", this->noise == -1.0f ? \"adaptive\" : std::to_string(this->noise)));\nif (this->type == \"FILE\")\nheaders[p].push_back(std::make_pair(\"Path\", this->path_fb));\n+ if (!this->dump_channels_path.empty() && (this->type == \"GA\" || this->type == \"GAA\" || this->type == \"BEC\"))\n+ headers[p].push_back(std::make_pair(\"Dump channels path\", this->dump_channels_path));\n}\ntools::Frozenbits_generator* Frozenbits_generator_MK::parameters\n::build(const tools::Polar_code &pc) const\n{\n- if (this->type == \"GAA\" && pc.is_mono_kernel() == 2) return new tools::Frozenbits_generator_GA_Arikan(this->K, this->N_cw );\n- if (this->type == \"GA\" ) return new tools::Frozenbits_generator_GA (this->K, this->N_cw, pc );\n+ if (this->type == \"GAA\" && pc.is_mono_kernel() == 2) return new tools::Frozenbits_generator_GA_Arikan(this->K, this->N_cw, this->dump_channels_path);\n+ if (this->type == \"GA\" ) return new tools::Frozenbits_generator_GA (this->K, this->N_cw, pc, this->dump_channels_path);\nif (this->type == \"FILE\" ) return new tools::Frozenbits_generator_file (this->K, this->N_cw, this->path_fb );\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.hpp", "new_path": "src/Factory/Tools/Code/Polar_MK/Frozenbits_generator_MK.hpp", "diff": "@@ -25,6 +25,7 @@ struct Frozenbits_generator_MK : public Factory\n// optional parameters\nstd::string type = \"GA\";\nstd::string path_fb = \"../conf/cde/awgn_polar_codes/TV\";\n+ std::string dump_channels_path = \"\";\nfloat noise = -1.f;\n// ---------------------------------------------------------------------------------------------------- METHODS\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "diff": "@@ -26,8 +26,9 @@ std::vector<bool> init_fb(const int K, const int N)\n}\nFrozenbits_generator_GA\n-::Frozenbits_generator_GA(const int K, const int N, const Polar_code& code)\n-: Frozenbits_generator(K, N),\n+::Frozenbits_generator_GA(const int K, const int N, const Polar_code& code, const std::string &dump_channels_path,\n+ const bool dump_channels_single_thread)\n+: Frozenbits_generator(K, N, dump_channels_path, dump_channels_single_thread),\nz(code.get_codeword_size()),\nfake_frozen_bits(init_fb(K, code.get_codeword_size())),\ndecoder_sc(K, code.get_codeword_size(), code, fake_frozen_bits)\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.hpp", "diff": "@@ -36,7 +36,8 @@ private:\nmodule::Decoder_polar_MK_SC_naive<int64_t, double> decoder_sc;\npublic:\n- Frozenbits_generator_GA(const int K, const int N, const Polar_code& code);\n+ Frozenbits_generator_GA(const int K, const int N, const Polar_code& code,\n+ const std::string &dump_channels_path = \"\", const bool dump_channels_single_thread = true);\nvirtual ~Frozenbits_generator_GA() = default;\n" } ]
C++
MIT License
aff3ct/aff3ct
Add the possibility to dump the best channels of the polar MK codes.
8,490
25.04.2019 12:07:47
-7,200
35c546196514dacb0c9e79ac30a6e4959951b7fd
Fix 5x5 polar kernel.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "diff": "@@ -621,7 +621,7 @@ Polar_lambdas_bis<B,R,X,P>::functions = {\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(L[3], (X(h(L[0],u,{1,1,1}), P(P(h(L[1],u,{0,1,0}), h(L[2],u,{0,0,1})), L[3]))));\n+ return P(L[3], (X(h(L[0],u,{1,1,1}), P(P(h(L[1],u,{0,1,0}), h(L[2],u,{0,0,1})), L[4]))));\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix 5x5 polar kernel.
8,490
25.04.2019 17:13:51
-7,200
c524d66ca8e7efe9f6d58e26e12172636241734f
Add 6x6 polar kernel without LSE.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "diff": "@@ -534,7 +534,9 @@ Polar_lambdas_bis<B,R,X,P>::functions = {\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(h(L[0],u,{1}), L[1]);\n+ auto hL0 = h(L[0], u, {1});\n+\n+ return P(hL0, L[1]);\n}\n}\n},\n@@ -549,11 +551,16 @@ Polar_lambdas_bis<B,R,X,P>::functions = {\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(h(L[0],u,{1}), X(L[1], L[2]));\n+ auto hL0 = h(L[0], u, {1});\n+\n+ return P(hL0, X(L[1], L[2]));\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(h(L[1],u,{1,0}), h(L[2],u,{1,1}));\n+ auto hL1 = h(L[1], u, {1,0});\n+ auto hL2 = h(L[2], u, {1,1});\n+\n+ return P(hL1, hL2);\n}\n}\n},\n@@ -568,11 +575,15 @@ Polar_lambdas_bis<B,R,X,P>::functions = {\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(X(h(L[0],u,{1}), L[2]), L[1]);\n+ auto hL0 = h(L[0], u, {1});\n+\n+ return P(X(hL0, L[2]), L[1]);\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(h(L[0],u,{1,1}), L[2]);\n+ auto hL0 = h(L[0], u, {1,1});\n+\n+ return P(hL0, L[2]);\n}\n}\n},\n@@ -588,15 +599,24 @@ Polar_lambdas_bis<B,R,X,P>::functions = {\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(X(h(L[0],u,{1}), L[2]), X(L[1], L[3]));\n+ auto hL0 = h(L[0], u, {1});\n+\n+ return P(X(hL0, L[2]), X(L[1], L[3]));\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return X(P(h(L[0],u,{1,1}), L[2]), P(h(L[1],u,{0,1}), L[3]));\n+ auto hL0 = h(L[0], u, {1,1});\n+ auto hL1 = h(L[1], u, {0,1});\n+\n+ return X(P(hL0, L[2]), P(hL1, L[3]));\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(P(P(h(L[0],u,{1,1,1}), h(L[1],u,{0,1,0})), h(L[2],u,{0,0,1})), L[3]);\n+ auto hL0 = h(L[0], u, {1,1,1});\n+ auto hL1 = h(L[1], u, {0,1,0});\n+ auto hL2 = h(L[2], u, {0,0,1});\n+\n+ return P(P(P(hL0, hL1), hL2), L[3]);\n}\n}\n},\n@@ -613,19 +633,85 @@ Polar_lambdas_bis<B,R,X,P>::functions = {\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(X(X(h(L[0],u,{1}), L[2]), L[3]), X(L[1], L[4]));\n+ auto hL0 = h(L[0], u, {1});\n+\n+ return P(X(X(hL0, L[2]), L[3]), X(L[1], L[4]));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ auto hL0 = h(L[0], u, {1,1});\n+ auto hL1 = h(L[1], u, {0,1});\n+\n+ return X(P(hL1, L[4]), P(L[2], X(hL0, L[3])));\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return X(P(h(L[1],u,{0,1}), L[4]), P(L[2], X(h(L[0],u,{1,1}), L[3])));\n+ auto hL0 = h(L[0], u, {1,1,1});\n+ auto hL1 = h(L[1], u, {0,1,0});\n+ auto hL2 = h(L[2], u, {0,0,1});\n+\n+ return P(L[3], (X(hL0, P(P(hL1, hL2), L[4]))));\n},\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(L[3], (X(h(L[0],u,{1,1,1}), P(P(h(L[1],u,{0,1,0}), h(L[2],u,{0,0,1})), L[4]))));\n+ auto hL0 = h(L[0], u, {1,1,1,1});\n+ auto hL1 = h(L[1], u, {0,1,0,0});\n+ auto hL2 = h(L[2], u, {0,0,1,0});\n+\n+ return P(P(P(hL0, hL1), hL2), L[4]);\n+ }\n+ }\n},\n+{\n+ {{1,0,0,0,0,0},\n+ {1,1,0,0,0,0},\n+ {1,0,1,0,0,0},\n+ {1,0,0,1,0,0},\n+ {1,1,1,0,1,0},\n+ {1,1,0,1,0,1}},\n+ {\n[](const std::vector<R> &L, const std::vector<B> &u) -> R\n{\n- return P(P(P(h(L[0],u,{1,1,1,1}), h(L[1],u,{0,1,0,0})), h(L[2],u,{0,0,1,0})), L[4]);\n+ return X(X(X(X(X(L[0], L[1]), L[2]), L[3]), L[4]), L[5]);\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ auto hL0 = h(L[0], u, {1});\n+\n+ return P(X(X(hL0, L[2]), L[3]), X(X(L[1], L[4]), L[5]));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ auto hL0 = h(L[0], u, {1,1});\n+ auto hL1 = h(L[1], u, {0,1});\n+\n+ return X(P(L[2], X(hL0, L[3])), P(L[4], X(hL1, L[5])));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ auto hL0 = h(L[0], u, {1,1,1});\n+ auto hL1 = h(L[1], u, {0,1,0});\n+ auto hL2 = h(L[2], u, {0,0,1});\n+\n+ // need LSE :-(\n+ return P(X(hL0, P(hL1, X(L[5], P(hL2, L[4])))), X(L[3], P(X(hL1, L[4]), L[5])));\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ auto hL0 = h(L[0], u, {1,1,1,1});\n+ auto hL1 = h(L[1], u, {0,1,0,0});\n+ auto hL2 = h(L[2], u, {0,0,1,0});\n+ auto hL3 = h(L[3], u, {0,0,0,1});\n+\n+ return P(P(X(P(hL3, L[5]), P(hL0, hL1)), hL2), L[4]);\n+ },\n+ [](const std::vector<R> &L, const std::vector<B> &u) -> R\n+ {\n+ auto hL0 = h(L[0], u, {1,1,1,1,1});\n+ auto hL1 = h(L[1], u, {0,1,0,0,1});\n+ auto hL3 = h(L[3], u, {0,0,0,1,0});\n+\n+ return P(P(P(hL0, hL1), hL3), L[5]);\n}\n}\n}};\n" } ]
C++
MIT License
aff3ct/aff3ct
Add 6x6 polar kernel without LSE.
8,490
25.04.2019 17:23:15
-7,200
66fc7df5919c5fe7f8442eaf6f9ba0ceb52502e4
Rename 'Polar_lambdas_bis' in 'Polar_lambdas'.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "new_path": "src/Factory/Module/Decoder/Polar_MK/Decoder_polar_MK.cpp", "diff": "@@ -99,14 +99,14 @@ module::Decoder_SIHO<B,Q>* Decoder_polar_MK::parameters\nfor (size_t l = 0; l < lambdas.size(); l++)\n{\n- if (tools::Polar_lambdas_bis<B,Q>::functions.find(code.get_kernel_matrices()[l]) ==\n- tools::Polar_lambdas_bis<B,Q>::functions.end())\n+ if (tools::Polar_lambdas<B,Q>::functions.find(code.get_kernel_matrices()[l]) ==\n+ tools::Polar_lambdas<B,Q>::functions.end())\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\nif (this->node_type == \"MS\")\n- lambdas[l] = tools::Polar_lambdas_bis<B,Q,tools::square_plus_MS<Q>>::functions[code.get_kernel_matrices()[l]];\n+ lambdas[l] = tools::Polar_lambdas<B,Q,tools::square_plus_MS<Q>>::functions[code.get_kernel_matrices()[l]];\nelse if (this->node_type == \"SPA\")\n- lambdas[l] = tools::Polar_lambdas_bis<B,Q,tools::square_plus_SPA<Q>>::functions[code.get_kernel_matrices()[l]];\n+ lambdas[l] = tools::Polar_lambdas<B,Q,tools::square_plus_SPA<Q>>::functions[code.get_kernel_matrices()[l]];\n}\nif (!this->systematic) // non-systematic encoding\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp", "diff": "@@ -86,10 +86,10 @@ Decoder_polar_MK_SC_naive<B,R>\n{\nfor (size_t l = 0; l < this->lambdas.size(); l++)\n{\n- if (tools::Polar_lambdas_bis<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n- tools::Polar_lambdas_bis<B,R>::functions.end())\n+ if (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n+ tools::Polar_lambdas<B,R>::functions.end())\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\n- this->lambdas[l] = tools::Polar_lambdas_bis<B,R>::functions[code.get_kernel_matrices()[l]];\n+ this->lambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n}\nelse\n" }, { "change_type": "MODIFY", "old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp", "diff": "@@ -103,10 +103,10 @@ Decoder_polar_MK_SCL_naive<B,R>\n{\nfor (size_t l = 0; l < this->lambdas.size(); l++)\n{\n- if (tools::Polar_lambdas_bis<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n- tools::Polar_lambdas_bis<B,R>::functions.end())\n+ if (tools::Polar_lambdas<B,R>::functions.find(code.get_kernel_matrices()[l]) ==\n+ tools::Polar_lambdas<B,R>::functions.end())\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\n- this->lambdas[l] = tools::Polar_lambdas_bis<B,R>::functions[code.get_kernel_matrices()[l]];\n+ this->lambdas[l] = tools::Polar_lambdas<B,R>::functions[code.get_kernel_matrices()[l]];\n}\n}\nelse\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "new_path": "src/Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_GA.cpp", "diff": "@@ -37,11 +37,11 @@ Frozenbits_generator_GA\nfor (size_t l = 0; l < decoder_sc.lambdas.size(); l++)\n{\n- if (Polar_lambdas_bis<int64_t,double>::functions.find(code.get_kernel_matrices()[l]) ==\n- Polar_lambdas_bis<int64_t,double>::functions.end())\n+ if (Polar_lambdas<int64_t,double>::functions.find(code.get_kernel_matrices()[l]) ==\n+ Polar_lambdas<int64_t,double>::functions.end())\nthrow runtime_error(__FILE__, __LINE__, __func__, \"Unsupported polar kernel.\");\ndecoder_sc.lambdas[l] =\n- Polar_lambdas_bis<int64_t,double,square_plus_DE>::functions[code.get_kernel_matrices()[l]];\n+ Polar_lambdas<int64_t,double,square_plus_DE>::functions[code.get_kernel_matrices()[l]];\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.h", "diff": "@@ -123,7 +123,7 @@ __forceinline R phi(const R& mu, const R& lambda, const B& u);\n__forceinline int compute_depth(int index, int tree_depth);\ntemplate <typename B, typename R>\n-struct Polar_lambdas\n+struct Polar_lambdas_legacy\n{\nstatic std::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>> functions;\n@@ -146,7 +146,7 @@ __forceinline R plus(const R& ll, const R& lr);\ntemplate <typename B, typename R, proto_xor <R> X = square_plus_MS<R>,\nproto_plus<R> P = plus<R>>\n-struct Polar_lambdas_bis\n+struct Polar_lambdas\n{\npublic:\nstatic std::map<std::vector<std::vector<bool>>,\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "new_path": "src/Tools/Code/Polar/decoder_polar_functions.hxx", "diff": "@@ -306,7 +306,7 @@ inline int compute_depth(int index, int tree_depth)\ntemplate <typename B, typename R>\nstd::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n-Polar_lambdas<B,R>::functions = {\n+Polar_lambdas_legacy<B,R>::functions = {\n{\n{{1}},\n{\n@@ -501,7 +501,7 @@ R plus(const R& ll, const R& lr)\n}\ntemplate <typename B, typename R, proto_xor<R> X, proto_plus<R> P>\n-R Polar_lambdas_bis<B,R,X,P>\n+R Polar_lambdas<B,R,X,P>\n::h(const R &L, const std::vector<B> &u, const std::vector<bool> &m)\n{\nbool switch_sign = false;\n@@ -514,7 +514,7 @@ R Polar_lambdas_bis<B,R,X,P>\ntemplate <typename B, typename R, proto_xor<R> X, proto_plus<R> P>\nstd::map<std::vector<std::vector<bool>>,\nstd::vector<std::function<R(const std::vector<R> &LLRs, const std::vector<B> &bits)>>>\n-Polar_lambdas_bis<B,R,X,P>::functions = {\n+Polar_lambdas<B,R,X,P>::functions = {\n{\n{{1}},\n{\n" } ]
C++
MIT License
aff3ct/aff3ct
Rename 'Polar_lambdas_bis' in 'Polar_lambdas'.
8,490
14.06.2019 20:55:13
-7,200
3f75e8ba486408e8554bc49b0285fa017421883d
Fix missing ML decoder for BCH codes.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/BCH/Decoder_BCH.cpp", "new_path": "src/Factory/Module/Decoder/BCH/Decoder_BCH.cpp", "diff": "@@ -112,6 +112,12 @@ module::Decoder_SIHO<B,Q>* Decoder_BCH\ntemplate <typename B, typename Q>\nmodule::Decoder_SIHO_HIHO<B,Q>* Decoder_BCH::parameters\n::build_hiho(const tools::BCH_polynomial_generator<B> &GF, const std::unique_ptr<module::Encoder<B>>& encoder) const\n+{\n+ try\n+ {\n+ return Decoder::parameters::build_hiho<B,Q>(encoder);\n+ }\n+ catch (tools::cannot_allocate const&)\n{\nif (this->type == \"ALGEBRAIC\")\n{\n@@ -123,7 +129,7 @@ module::Decoder_SIHO_HIHO<B,Q>* Decoder_BCH::parameters\nif (this->implem == \"GENIUS\") return new module::Decoder_BCH_genius<B,Q>(this->K, this->N_cw, this->t, *encoder, this->n_frames);\n}\n}\n-\n+ }\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Decoder.cpp", "new_path": "src/Factory/Module/Decoder/Decoder.cpp", "diff": "@@ -115,6 +115,22 @@ module::Decoder_SIHO<B,Q>* Decoder::parameters\nthrow tools::cannot_allocate(__FILE__, __LINE__, __func__);\n}\n+template <typename B, typename Q>\n+module::Decoder_SIHO_HIHO<B,Q>* Decoder::parameters\n+::build_hiho(const std::unique_ptr<module::Encoder<B>>& encoder) const\n+{\n+ if (encoder)\n+ {\n+ if (this->type == \"ML\")\n+ {\n+ if (this->implem == \"STD\" ) return new module::Decoder_ML_std <B,Q>(this->K, this->N_cw, *encoder, this->hamming, this->n_frames);\n+ if (this->implem == \"NAIVE\") return new module::Decoder_ML_naive<B,Q>(this->K, this->N_cw, *encoder, this->hamming, this->n_frames);\n+ }\n+ }\n+\n+ throw tools::cannot_allocate(__FILE__, __LINE__, __func__);\n+}\n+\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef AFF3CT_MULTI_PREC\n@@ -122,7 +138,12 @@ template aff3ct::module::Decoder_SIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder::para\ntemplate aff3ct::module::Decoder_SIHO<B_16,Q_16>* aff3ct::factory::Decoder::parameters::build<B_16,Q_16>(const std::unique_ptr<module::Encoder<B_16>>&) const;\ntemplate aff3ct::module::Decoder_SIHO<B_32,Q_32>* aff3ct::factory::Decoder::parameters::build<B_32,Q_32>(const std::unique_ptr<module::Encoder<B_32>>&) const;\ntemplate aff3ct::module::Decoder_SIHO<B_64,Q_64>* aff3ct::factory::Decoder::parameters::build<B_64,Q_64>(const std::unique_ptr<module::Encoder<B_64>>&) const;\n+template aff3ct::module::Decoder_SIHO_HIHO<B_8 ,Q_8 >* aff3ct::factory::Decoder::parameters::build_hiho<B_8 ,Q_8 >(const std::unique_ptr<module::Encoder<B_8 >>&) const;\n+template aff3ct::module::Decoder_SIHO_HIHO<B_16,Q_16>* aff3ct::factory::Decoder::parameters::build_hiho<B_16,Q_16>(const std::unique_ptr<module::Encoder<B_16>>&) const;\n+template aff3ct::module::Decoder_SIHO_HIHO<B_32,Q_32>* aff3ct::factory::Decoder::parameters::build_hiho<B_32,Q_32>(const std::unique_ptr<module::Encoder<B_32>>&) const;\n+template aff3ct::module::Decoder_SIHO_HIHO<B_64,Q_64>* aff3ct::factory::Decoder::parameters::build_hiho<B_64,Q_64>(const std::unique_ptr<module::Encoder<B_64>>&) const;\n#else\ntemplate aff3ct::module::Decoder_SIHO<B,Q>* aff3ct::factory::Decoder::parameters::build<B,Q>(const std::unique_ptr<module::Encoder<B>>&) const;\n+template aff3ct::module::Decoder_SIHO_HIHO<B,Q>* aff3ct::factory::Decoder::parameters::build_hiho<B,Q>(const std::unique_ptr<module::Encoder<B>>&) const;\n#endif\n// ==================================================================================== explicit template instantiation\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Decoder/Decoder.hpp", "new_path": "src/Factory/Module/Decoder/Decoder.hpp", "diff": "#include <string>\n#include <memory>\n-#include \"Module/Decoder/Decoder_SIHO.hpp\"\n+#include \"Module/Decoder/Decoder_SIHO_HIHO.hpp\"\n#include \"Module/Encoder/Encoder.hpp\"\n#include \"../../Factory.hpp\"\n@@ -52,6 +52,9 @@ struct Decoder : Factory\ntemplate <typename B = int, typename Q = float>\nmodule::Decoder_SIHO<B,Q>* build(const std::unique_ptr<module::Encoder<B>>& encoder = nullptr) const;\n+\n+ template <typename B = int, typename Q = float>\n+ module::Decoder_SIHO_HIHO<B,Q>* build_hiho(const std::unique_ptr<module::Encoder<B>>& encoder = nullptr) const;\n};\n};\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix missing ML decoder for BCH codes.
8,488
05.06.2019 11:09:36
-7,200
93c0d3de11c1d17332d19b5f860fdafbff5addf9
Extend constructors of Galois and BCH_polynomial_generator.
[ { "change_type": "MODIFY", "old_path": "src/Tools/Code/BCH/BCH_polynomial_generator.cpp", "new_path": "src/Tools/Code/BCH/BCH_polynomial_generator.cpp", "diff": "@@ -8,8 +8,8 @@ using namespace aff3ct::tools;\ntemplate <typename I>\nBCH_polynomial_generator<I>\n-::BCH_polynomial_generator(const int& N, const int& t)\n- : Galois<I>(N), t(t), d(2 * t + 1)\n+::BCH_polynomial_generator(const int& N, const int& t, const std::vector<I> p)\n+ : Galois<I>(N, p), t(t), d(2 * t + 1)\n{\nif (t < 1)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Code/BCH/BCH_polynomial_generator.hpp", "new_path": "src/Tools/Code/BCH/BCH_polynomial_generator.hpp", "diff": "@@ -19,7 +19,7 @@ protected:\nstd::vector<I> g; // coefficients of the generator polynomial, g(x)\npublic:\n- BCH_polynomial_generator(const int& N, const int& t);\n+ BCH_polynomial_generator(const int& N, const int& t, const std::vector<I> p = {});\nvirtual ~BCH_polynomial_generator() = default;\nint get_d () const;\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Math/Galois.cpp", "new_path": "src/Tools/Math/Galois.cpp", "diff": "@@ -11,7 +11,7 @@ using namespace aff3ct::tools;\ntemplate <typename I>\nGalois<I>\n-::Galois(const int& N)\n+::Galois(const int& N, const std::vector<I> p)\n: N(N), m((int)std::ceil(std::log2(N))), alpha_to(N +1), index_of(N +1), p(m +1, 0)\n{\nif (N <= 0)\n@@ -49,7 +49,18 @@ Galois<I>\nthrow invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n+ if (!p.empty() && (p.size() != static_cast<size_t>(m +1)))\n+ {\n+ std::stringstream message;\n+ message << \"The order of the Galois primitive polynomial (p) must be m + 1 (= \" << m +1 << \") .\";\n+ throw invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (p.empty())\nselect_polynomial();\n+ else\n+ this->p = p;\n+\ngenerate_gf();\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Tools/Math/Galois.hpp", "new_path": "src/Tools/Math/Galois.hpp", "diff": "@@ -23,7 +23,7 @@ protected:\nstd::vector<I> p; // coefficients of a primitive polynomial used to generate GF(2**m)\npublic:\n- explicit Galois(const int& N);\n+ explicit Galois(const int& N, const std::vector<I> p = {});\nvirtual ~Galois() = default;\nint get_N() const;\n" } ]
C++
MIT License
aff3ct/aff3ct
Extend constructors of Galois and BCH_polynomial_generator.
8,488
05.06.2019 14:21:51
-7,200
5390064b09e979776f27d48067f696fbc0b4902d
Throw exception for non primitive BCH polynomial.
[ { "change_type": "MODIFY", "old_path": "src/Module/Decoder/BCH/Standard/Decoder_BCH_std.cpp", "new_path": "src/Module/Decoder/BCH/Standard/Decoder_BCH_std.cpp", "diff": "@@ -177,8 +177,13 @@ void Decoder_BCH_std<B, R>\nif (!q)\n{ /* store root and error\n* location number indices */\n- loc[count] = this->N_p2_1 - i;\n- count++;\n+ if(static_cast<size_t>(count) >= loc.size())\n+ {\n+ std::stringstream message;\n+ message << \"The polynomial seems not to be primitive.\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+ loc[count++] = this->N_p2_1 - i;\n}\n}\n" } ]
C++
MIT License
aff3ct/aff3ct
Throw exception for non primitive BCH polynomial.
8,490
20.06.2019 14:50:24
-7,200
21abf821ab0bab5855ad190b6ee6dda9ae607c98
Udate SonarQube URL.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "# AFF3CT: A Fast Forward Error Correction Toolbox!\n[![GitLab Pipeline Status](https://img.shields.io/gitlab/pipeline/aff3ct/aff3ct.svg)](https://gitlab.com/aff3ct/aff3ct/pipelines)\n-[![SonarQube Code Coverage](https://gitlab.com/aff3ct/aff3ct/badges/master/coverage.svg)](https://sonarqube.bordeaux.inria.fr/sonarqube/dashboard?id=storm%3Aaff3ct%3Agitlab%3Amaster)\n+[![SonarQube Code Coverage](https://gitlab.com/aff3ct/aff3ct/badges/master/coverage.svg)](https://sonarqube.inria.fr/sonarqube/dashboard?id=storm%3Aaff3ct%3Agitlab%3Amaster)\n[![Documentation Build Status](https://img.shields.io/readthedocs/aff3ct.svg)](https://readthedocs.org/projects/aff3ct/)\n[![Latest Release](https://img.shields.io/github/release/aff3ct/aff3ct.svg)](https://github.com/aff3ct/aff3ct/releases)\n[![DOI](https://zenodo.org/badge/60615913.svg)](https://zenodo.org/badge/latestdoi/60615913)\n" } ]
C++
MIT License
aff3ct/aff3ct
Udate SonarQube URL.
8,490
28.06.2019 11:13:32
-7,200
8c4b63366eb52e63d5bad234eb38e382d0b0fa51
Add chain and BFER pics.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "# AFF3CT: A Fast Forward Error Correction Toolbox!\n[![GitLab Pipeline Status](https://img.shields.io/gitlab/pipeline/aff3ct/aff3ct.svg)](https://gitlab.com/aff3ct/aff3ct/pipelines)\n-[![SonarQube Code Coverage](https://gitlab.com/aff3ct/aff3ct/badges/master/coverage.svg)](https://sonarqube.inria.fr/sonarqube/dashboard?id=storm%3Aaff3ct%3Agitlab%3Amaster)\n+[![SonarQube Code Coverage](https://gitlab.com/aff3ct/aff3ct/badges/master/coverage.svg)](https://sonarqube.bordeaux.inria.fr/sonarqube/dashboard?id=storm%3Aaff3ct%3Agitlab%3Amaster)\n[![Documentation Build Status](https://img.shields.io/readthedocs/aff3ct.svg)](https://readthedocs.org/projects/aff3ct/)\n[![Latest Release](https://img.shields.io/github/release/aff3ct/aff3ct.svg)](https://github.com/aff3ct/aff3ct/releases)\n[![DOI](https://zenodo.org/badge/60615913.svg)](https://zenodo.org/badge/latestdoi/60615913)\n@@ -14,6 +14,8 @@ including the **Low-Density Parity-Check (LDPC) codes**. **AFF3CT** is a command\nline program and it simulates communication chains based on a Monte Carlo\nmethod.\n+![Communication Chain](https://aff3ct.github.io/images/chain.svg)\n+\nIt is very easy to use, for instance, to estimate the BER/FER decoding\nperformances of the (2048,1723) Polar code from 1.0 to 4.0 dB:\n@@ -59,6 +61,8 @@ Below, a list of the features that motivated the creation of the simulator:\n4. **reuse tried and tested modules** and add yours,\n5. **alternative to MATLAB**, if you seek to reduce simulations time.\n+![BER/FER Performances](https://aff3ct.github.io/images/bfer/bfer_polar_turbo_ldpc_bch_rs.svg)\n+\n## Installation\nFirst make sure to have installed a C++11 compiler, CMake and Git. Then install\n" } ]
C++
MIT License
aff3ct/aff3ct
Add chain and BFER pics.
8,488
02.07.2019 09:26:39
-7,200
34ff7babd5d6189ae436abe92b39c2be5f023d8f
Add aff3ct-dev package.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -60,8 +60,23 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n\"Architecture: ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}\\n\"\n\"Depends: ${bin_depends}, \\${shlibs:Depends}, \\${misc:Depends}\\n\"\n\"Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\\n\"\n+ \"${DEBIAN_LONG_DESCRIPTION}\\n\"\n+ \"\\n\"\n+ \"Package: ${CPACK_DEBIAN_PACKAGE_NAME}-dev\\n\"\n+ \"Architecture: ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}\\n\"\n+ \"Depends: ${bin_depends}, \\${shlibs:Depends}, \\${misc:Depends}\\n\"\n+ \"Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\\n\"\n\"${DEBIAN_LONG_DESCRIPTION}\\n\")\n+ file(WRITE \"${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}.install\"\n+ \"usr/bin/*\\n\"\n+ \"usr/share/*/conf/*\\n\"\n+ \"usr/share/*/refs/*\\n\")\n+\n+ file(WRITE \"${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}-dev.install\"\n+ \"usr/lib/*\\n\"\n+ \"usr/include/*\\n\")\n+\n##############################################################################\n# debian/copyright\nconfigure_file(${CPACK_RESOURCE_FILE_LICENSE} ${DEBIAN_COPYRIGHT} COPYONLY)\n" } ]
C++
MIT License
aff3ct/aff3ct
Add aff3ct-dev package.
8,490
02.07.2019 09:09:39
-7,200
37a1220b54be5a9b26bf0112a0ed27cdba357396
Fix Clang link errors on Visual Studio 2019.
[ { "change_type": "MODIFY", "old_path": "src/Factory/Module/Codec/Codec_SIHO.hpp", "new_path": "src/Factory/Module/Codec/Codec_SIHO.hpp", "diff": "@@ -24,7 +24,7 @@ struct Codec_SIHO : Codec\n// ---------------------------------------------------------------------------------------------------- METHODS\nexplicit parameters(const std::string &p = Codec_SIHO_prefix);\n- virtual ~parameters() = default;\n+ virtual ~parameters() {}\n// The following line is commented to prevent Visual C++ to incorrectly report ambiguity when covariance is\n// used with virtual inheritance.\n// See more about this MSVC bug:\n" }, { "change_type": "MODIFY", "old_path": "src/Factory/Module/Codec/Codec_SISO.hpp", "new_path": "src/Factory/Module/Codec/Codec_SISO.hpp", "diff": "@@ -24,7 +24,7 @@ struct Codec_SISO : Codec\n// ---------------------------------------------------------------------------------------------------- METHODS\nexplicit parameters(const std::string &p = Codec_SISO_prefix);\n- virtual ~parameters() = default;\n+ virtual ~parameters() {}\n// The following line is commented to prevent Visual C++ to incorrectly report ambiguity when covariance is\n// used with virtual inheritance.\n// See more about this MSVC bug:\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix Clang link errors on Visual Studio 2019.
8,490
02.07.2019 13:47:07
-7,200
ebd6735a49d5c57a10ae13f1e2d48bcfb20146cc
Doc: improve Visual Studio info.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/installation/compilation/compilation.rst", "new_path": "doc/sphinx/source/user/installation/compilation/compilation.rst", "diff": "@@ -215,7 +215,12 @@ Once |AFF3CT| is compiled you can browse the build by right clicking on\n.. warning:: The Visual Studio default compiler (MSVC) is known to generate\nsignificantly slower |AFF3CT| executable than the GNU compiler.\n**If you target an high speed executable it is recommended to use\n- the GNU compiler.**\n+ the GNU or Clang compilers.**\n+\n+.. danger:: When compiling AFF3CT in debug mode, the\n+ ``src\\Factory\\Module\\Decoder\\Polar\\Decoder_polar.cpp`` file\n+ generates the following error: ``fatal error C1128``.\n+ To fix this, you need to compile with the ``/bigobj`` parameter.\nThe compilation can also be started from the command line after calling the\n``%VS_PATH%\\VC\\Auxiliary\\Build\\vcvars64.bat`` batch script (where ``%VS_PATH%``\n@@ -225,6 +230,16 @@ is the location of Visual Studio on your system):\ndevenv /build Release aff3ct.sln\n+.. _compilation-visual_studio_2019_project:\n+\n+Compilation with a Visual Studio 2019 Solution\n+----------------------------------------------\n+\n+The compilation process on Visual Studio 2019 is almost the same than on Visual\n+Studio 2017. Note that many improvements have been made on the |MSVC| compiler\n+on Visual Studio 2019 and now the produced binaries are competitive with other\n+standard compilers like GNU and Clang.\n+\n.. _compilation_cmake_options:\nCMake Options\n" } ]
C++
MIT License
aff3ct/aff3ct
Doc: improve Visual Studio info.
8,488
02.07.2019 14:43:16
-7,200
2b7f5fda6019998dbd3ee61885d0c6417d6591be
Try to fix ppa debuild.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -70,12 +70,12 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nfile(WRITE \"${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}.install\"\n\"usr/bin/*\\n\"\n- \"usr/share/*/conf/*\\n\"\n- \"usr/share/*/refs/*\\n\")\n+ \"usr/share/aff3ct-${AFF3CT_VERSION_FULL}/conf/*\\n\"\n+ \"usr/share/aff3ct-${AFF3CT_VERSION_FULL}/refs/*\\n\")\nfile(WRITE \"${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}-dev.install\"\n- \"usr/lib/*\\n\"\n- \"usr/include/*\\n\")\n+ \"usr/lib/x86_64-linux-gnu/*\\n\"\n+ \"usr/include/aff3ct-${AFF3CT_VERSION_FULL}/*\\n\")\n##############################################################################\n# debian/copyright\n@@ -89,11 +89,11 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n\"\\n\\n%:\\n\"\n\"\\tdh $@ --buildsystem=cmake\\n\"\n\"\\noverride_dh_auto_configure:\\n\"\n- \"\\tDESTDIR=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" dh_auto_configure\"\n+ \"\\tDESTDIR=\\\"$(CURDIR)\\\" dh_auto_configure\"\n\" -- -DCMAKE_BUILD_TYPE=Release -DAFF3CT_COMPILE_SHARED_LIB=ON -DPACKAGE_TGZ=OFF \"\n\"-DAFF3CT_OVERRIDE_VERSION=${GIT_VERSION} -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'\"\n\"\\n\\noverride_dh_auto_install:\\n\"\n- \"\\tdh_auto_install --destdir=\\\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\\\" --buildsystem=cmake\"\n+ \"\\tdh_auto_install --destdir=\\\"$(CURDIR)\\\" --buildsystem=cmake\"\n\"\\n\\noverride_dh_strip:\\n\")\nexecute_process(COMMAND chmod +x ${DEBIAN_RULES})\n" } ]
C++
MIT License
aff3ct/aff3ct
Try to fix ppa debuild.
8,490
02.07.2019 22:17:22
-7,200
c7decf771e3ebc454bd550e6f11c9fd32185c9e0
Update 'conf' and 'refs' submodules.
[ { "change_type": "MODIFY", "old_path": "conf", "new_path": "conf", "diff": "-Subproject commit 868a3f749d9aa30d6a87de33d8285a6c5302dec3\n+Subproject commit ccc3111fba49e48fca67a19caf347148e1139ddf\n" }, { "change_type": "MODIFY", "old_path": "refs", "new_path": "refs", "diff": "-Subproject commit 0f45bb28d276d6b2030b5fb2dd078d0a5dc1677c\n+Subproject commit 1d8ba69eae32f73923b025de175f6bd4392ac9e9\n" } ]
C++
MIT License
aff3ct/aff3ct
Update 'conf' and 'refs' submodules.
8,488
04.07.2019 12:02:59
-7,200
5090a1fde603c27fbaab9d5de0bb1d5ac8fa57fc
Fix doc package.
[ { "change_type": "MODIFY", "old_path": "ci/deploy-upload-ppa.sh", "new_path": "ci/deploy-upload-ppa.sh", "diff": "@@ -3,7 +3,7 @@ set -x\ncmake --version\nmkdir build\n-mv documentation-sphinx build\n+mv doc/sphinx/build doc/sphinx/built\ncd build\nif [ -z \"DISTRIBS\" ]\n" }, { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -84,7 +84,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n\"usr/include/aff3ct-${AFF3CT_VERSION_FULL}/*\\n\")\nfile(WRITE \"${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}-doc.install\"\n- \"documentation-sphinx/doc/sphinx/build/* usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc\\n\")\n+ \"doc/sphinx/built/html/* usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc/html\\n\")\n##############################################################################\n# debian/copyright\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix doc package.
8,488
04.07.2019 14:37:18
-7,200
e9ad73c301ac9d442abd6cb13cb88485a6ae44db
Add pdf in aff3ct-doc package.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -84,7 +84,8 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n\"usr/include/aff3ct-${AFF3CT_VERSION_FULL}/*\\n\")\nfile(WRITE \"${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}-doc.install\"\n- \"doc/sphinx/built/html/* usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc/html\\n\")\n+ \"doc/sphinx/built/html/* usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc/html\\n\"\n+ \"doc/sphinx/built/latex/AFF3CT.pdf usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc/pdf/\\n\")\n##############################################################################\n# debian/copyright\n@@ -99,7 +100,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n\"\\tdh $@ --buildsystem=cmake\\n\"\n\"\\noverride_dh_auto_configure:\\n\"\n\"\\tDESTDIR=\\\"$(CURDIR)\\\" dh_auto_configure\"\n- \" -- -DCMAKE_BUILD_TYPE=Release -DAFF3CT_COMPILE_SHARED_LIB=ON -DPACKAGE_TGZ=OFF \"\n+ \" -- -DCMAKE_BUILD_TYPE=Release -DAFF3CT_COMPILE_SHARED_LIB=ON \"\n\"-DAFF3CT_OVERRIDE_VERSION=${GIT_VERSION} -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'\"\n\"\\n\\noverride_dh_auto_install:\\n\"\n\"\\tdh_auto_install --destdir=\\\"$(CURDIR)\\\" --buildsystem=cmake\"\n" } ]
C++
MIT License
aff3ct/aff3ct
Add pdf in aff3ct-doc package.
8,488
08.07.2019 11:39:14
-7,200
caed778cd41d1f313ece02b1f4b962a0192421e1
CI: Give dput host as input in CI scripts.
[ { "change_type": "MODIFY", "old_path": ".gitlab-ci.yml", "new_path": ".gitlab-ci.yml", "diff": "@@ -1239,6 +1239,10 @@ deploy-upload-ppa:\n- x86\n- 64-bit\n- ppa\n+ only:\n+ - master\n+ - development\n+ - ppa_upload\nartifacts:\nname: ppa_files\nwhen: always\n@@ -1248,6 +1252,8 @@ deploy-upload-ppa:\n- build/Debian/xenial/*.dsc\n- build/Debian/xenial/*.build\nscript:\n+ - source ./ci/tools/git-branch.sh\n+ - source ./ci/tools/threads.sh\n- export DISTRIBS=\"xenial;bionic\"\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n@@ -1255,7 +1261,6 @@ deploy-upload-ppa:\n- export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=OFF -DAFF3CT_COMPILE_STATIC_LIB=OFF -DAFF3CT_COMPILE_SHARED_LIB=OFF -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build\"\n- - source ./ci/tools/threads.sh\n- ./ci/deploy-upload-ppa.sh\npages:\n" }, { "change_type": "MODIFY", "old_path": "ci/deploy-upload-ppa.sh", "new_path": "ci/deploy-upload-ppa.sh", "diff": "@@ -19,6 +19,12 @@ then\nexit 1\nfi\n+if [ -z \"$GIT_BRANCH\" ]\n+then\n+ echo \"Please define the 'GIT_BRANCH' environment variable.\"\n+ exit 1\n+fi\n+\nif [ -z \"$THREADS\" ]\nthen\necho \"The 'THREADS' environment variable is not set, default value = 1.\"\n@@ -31,12 +37,26 @@ then\nNAME=\"build_deploy_upload_ppa\"\nfi\n+if [ \"$GIT_BRANCH\" = \"development\"]\n+then\n+ DPUT_HOST=\"ppa:aff3ct/aff3ct-dev\"\n+elif [ \"$GIT_BRANCH\" = \"master\"]\n+then\n+ DPUT_HOST=\"ppa:aff3ct/aff3ct-stable\"\n+elif [ \"$GIT_BRANCH\" = \"ppa_upload\"]\n+then\n+ DPUT_HOST=\"ppa:aff3ct/aff3ct\"\n+else\n+ echo \"Deploy upload ppa must be run only on master or development branch.\"\n+ exit 1\n+fi\n+\nif [ -z \"$LFLAGS\" ]\nthen\ncmake .. -G\"Unix Makefiles\" -DCMAKE_CXX_COMPILER=$CXX \\\n-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"$CFLAGS\" \\\n$CMAKE_OPT -DCMAKE_INSTALL_PREFIX=\"$NAME\" \\\n- -DAFF3CT_UPLOAD_PPA=\"ON\" \\\n+ -DAFF3CT_UPLOAD_PPA=\"ON\" -DAFF3CT_DPUT_HOST=\"$DPUT_HOST\" \\\n-DAFF3CT_PPA_DISTRIB=\"$DISTRIBS\"\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nelse\n@@ -44,7 +64,7 @@ else\n-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"$CFLAGS\" \\\n-DCMAKE_EXE_LINKER_FLAGS=\"$LFLAGS\" \\\n$CMAKE_OPT -DCMAKE_INSTALL_PREFIX=\"$NAME\" \\\n- -DAFF3CT_UPLOAD_PPA=\"ON\"\\\n+ -DAFF3CT_UPLOAD_PPA=\"ON\" -DAFF3CT_DPUT_HOST=\"$DPUT_HOST\" \\\n-DAFF3CT_PPA_DISTRIB=\"$DISTRIBS\"\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\nfi\n" }, { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -6,6 +6,11 @@ if(NOT DEBUILD_EXECUTABLE OR NOT DPUT_EXECUTABLE)\nreturn()\nendif(NOT DEBUILD_EXECUTABLE OR NOT DPUT_EXECUTABLE)\n+if(NOT AFF3CT_DPUT_HOST)\n+ message(WARNING \"AFF3CT_DPUT_HOST varibale note set. Please give the ppa host name.\")\n+ return()\n+endif(NOT AFF3CT_DPUT_HOST)\n+\nexecute_process(COMMAND git tag -n20 --points-at v${AFF3CT_VERSION}\nOUTPUT_VARIABLE CHANGELOG\n@@ -19,6 +24,8 @@ execute_process(COMMAND lsb_release -cs\nset(AFF3CT_PPA_DISTRIB ${DISTRI})\nendif()\n+\n+\nforeach(DISTRI ${AFF3CT_PPA_DISTRIB})\nstring(REPLACE \"\\n\" \"\\n \" DEBIAN_LONG_DESCRIPTION \" ${CPACK_PACKAGE_DESCRIPTION}\")\nset(DEBIAN_PACKAGE_FILE_NAME \"aff3ct-${AFF3CT_VERSION_FULL}-${DISTRI}.orig\")\n@@ -30,8 +37,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\nset(DEBIAN_CHANGELOG ${DEBIAN_SOURCE_DIR}/debian/changelog)\nset(DEBIAN_SOURCE_CHANGES ${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}-${DISTRI}_source.changes)\nset(ORIG_FILE \"${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEBIAN_PACKAGE_FILE_NAME}.tar.gz\")\n- set(DPUT_HOST \"ppa:aff3ct/aff3ct\")\n- if(CHANGELOG_MESSAGE) # TODO get it from git\n+ if(CHANGELOG_MESSAGE)\nset(output_changelog_msg ${CHANGELOG_MESSAGE})\nelse()\nset(output_changelog_msg \"* Package created with CMake\")\n" } ]
C++
MIT License
aff3ct/aff3ct
CI: Give dput host as input in CI scripts.
8,488
08.07.2019 11:39:32
-7,200
fab6fbcfbe1658b2c49ec9264f79b51fbb7f07f2
Update doc with ppa repo.
[ { "change_type": "MODIFY", "old_path": "doc/sphinx/source/user/installation/installation/installation.rst", "new_path": "doc/sphinx/source/user/installation/installation/installation.rst", "diff": "Installation\n============\n-.. important:: If you do not plan to modify the |AFF3CT| source code and you\n- want to use the simulator/library as is, you can **download one\n- of the latest builds** from the\n- `download page of the AFF3CT website <http://aff3ct.github.io/download.html>`_\n- and skip this section.\n+In order to be installed on a system, AFF3CT can either be compiled locally\n+ and installed (see `From Source`_), or remotely precompiled versions\n+ can be downloaded and installed (see `Precompiled Versions`_.)\n+\n+From Source\n+-----------\nOnce |AFF3CT| has been compiled, it is possible (not mandatory) to install it on\nyour system. On Unix-like systems, traditionally, the fresh build is installed\n@@ -24,7 +25,7 @@ This command do not install |AFF3CT|. It only prepares the project to be\ninstalled in the selected location.\nMakefile Project\n-----------------\n+\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nTo install |AFF3CT|, call the `install` target on the current Makefile:\n@@ -37,7 +38,7 @@ To install |AFF3CT|, call the `install` target on the current Makefile:\nVisual Studio Solution\n-----------------------\n+\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nIn case of a Visual Studio Solution, an `INSTALL` project is defined and ensures\nthe installation when triggered. This can be done from the Visual Studio IDE\n@@ -49,7 +50,33 @@ is the location of Visual Studio on your system):\ndevenv /build Release aff3ct.sln /project INSTALL\n-Details\n+Precompiled Versions\n+--------------------\n+\n+From |AFF3CT| website\n+\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n+If you do not plan to modify the |AFF3CT| source code and you\n+want to use the simulator/library as is, you can **download one\n+of the latest builds** from the\n+`download page of the AFF3CT website <http://aff3ct.github.io/download.html>`_\n+and skip this section.\n+\n+\n+On Debian / Ubuntu\n+\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n+Each new version of |AFF3CT| is deployed on a ppa.\n+It can be installed on Debian / Ubuntu systems with the following commands:\n+\n+.. code-block:: bash\n+\n+ sudo add-apt-repository ppa:aff3ct/aff3ct\n+ sudo apt-get update\n+ sudo apt-get install aff3ct # contains ``bin/``, ``conf/`` and ``refs/`` folders\n+ sudo apt-get install aff3ct-dev # contains ``include/`` and ``lib/`` folders\n+ sudo apt-get install aff3ct-doc # contains ``doc/``\n+\n+\n+Contents\n-------\nThe installed package is organized as follow:\n" } ]
C++
MIT License
aff3ct/aff3ct
Update doc with ppa repo.
8,488
08.07.2019 14:05:55
-7,200
ac037fa3870bbb59f94d923ec109850e94426f22
Fix deploy_upload_ppa script.
[ { "change_type": "MODIFY", "old_path": "cmake/Modules/UploadPPA.cmake", "new_path": "cmake/Modules/UploadPPA.cmake", "diff": "@@ -11,7 +11,6 @@ if(NOT AFF3CT_DPUT_HOST)\nreturn()\nendif(NOT AFF3CT_DPUT_HOST)\n-\nexecute_process(COMMAND git tag -n20 --points-at v${AFF3CT_VERSION}\nOUTPUT_VARIABLE CHANGELOG\nOUTPUT_STRIP_TRAILING_WHITESPACE)\n@@ -24,8 +23,6 @@ execute_process(COMMAND lsb_release -cs\nset(AFF3CT_PPA_DISTRIB ${DISTRI})\nendif()\n-\n-\nforeach(DISTRI ${AFF3CT_PPA_DISTRIB})\nstring(REPLACE \"\\n\" \"\\n \" DEBIAN_LONG_DESCRIPTION \" ${CPACK_PACKAGE_DESCRIPTION}\")\nset(DEBIAN_PACKAGE_FILE_NAME \"aff3ct-${AFF3CT_VERSION_FULL}-${DISTRI}.orig\")\n@@ -177,7 +174,7 @@ foreach(DISTRI ${AFF3CT_PPA_DISTRIB})\n# dput ppa:your-lp-id/ppa <source.changes>\n# TODO : Add possibility to use .dc file\nadd_custom_target(dput_${DISTRI} ALL\n- COMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEBIAN_SOURCE_CHANGES}\n+ COMMAND ${DPUT_EXECUTABLE} ${AFF3CT_DPUT_HOST} ${DEBIAN_SOURCE_CHANGES}\nDEPENDS debuild_${DISTRI}\nWORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Debian/${DISTRI})\n" } ]
C++
MIT License
aff3ct/aff3ct
Fix deploy_upload_ppa script.