summaryrefslogtreecommitdiff
path: root/gr-fec/lib/scl_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'gr-fec/lib/scl_list.h')
-rw-r--r--gr-fec/lib/scl_list.h96
1 files changed, 49 insertions, 47 deletions
diff --git a/gr-fec/lib/scl_list.h b/gr-fec/lib/scl_list.h
index 60e5cae8cd..9d014cc33c 100644
--- a/gr-fec/lib/scl_list.h
+++ b/gr-fec/lib/scl_list.h
@@ -26,60 +26,62 @@
#include <vector>
namespace gr {
- namespace fec {
- namespace code {
- namespace polar {
+namespace fec {
+namespace code {
+namespace polar {
- struct path {
- path();
- ~path();
- float path_metric;
- bool owns_vectors;
- bool is_active;
- float* llr_vec;
- unsigned char* u_vec;
- };
+struct path {
+ path();
+ ~path();
+ float path_metric;
+ bool owns_vectors;
+ bool is_active;
+ float* llr_vec;
+ unsigned char* u_vec;
+};
- /*!
- * \brief List implementation for Successive Cancellation List decoders
- *
- */
- class scl_list{
- const unsigned int d_list_size;
- const unsigned int d_num_buff_elements;
- std::vector<path*> d_path_list;
- unsigned int d_active_path_counter;
- unsigned int d_active_pos;
+/*!
+ * \brief List implementation for Successive Cancellation List decoders
+ *
+ */
+class scl_list
+{
+ const unsigned int d_list_size;
+ const unsigned int d_num_buff_elements;
+ std::vector<path*> d_path_list;
+ unsigned int d_active_path_counter;
+ unsigned int d_active_pos;
- float update_path_metric(const float last_pm, const float llr, const float ui) const;
- void duplicate_path(path* target, const path* original);
- void branch_paths(path* target, path* original, const float llr);
- void steal_vector_ownership(path* target, path* original);
- void reset();
+ float update_path_metric(const float last_pm, const float llr, const float ui) const;
+ void duplicate_path(path* target, const path* original);
+ void branch_paths(path* target, path* original, const float llr);
+ void steal_vector_ownership(path* target, path* original);
+ void reset();
- // comparator for std::sort
- static bool path_compare(path* first, path* second) {
- return first->path_metric < second->path_metric;
- };
+ // comparator for std::sort
+ static bool path_compare(path* first, path* second)
+ {
+ return first->path_metric < second->path_metric;
+ };
- public:
- scl_list(const unsigned int list_size, const unsigned int block_size,
- const unsigned int block_power);
- virtual
- ~scl_list();
- const unsigned int size() const {return d_list_size;};
- const unsigned int active_size() const {return d_active_path_counter;};
+public:
+ scl_list(const unsigned int list_size,
+ const unsigned int block_size,
+ const unsigned int block_power);
+ virtual ~scl_list();
+ const unsigned int size() const { return d_list_size; };
+ const unsigned int active_size() const { return d_active_path_counter; };
- path* initial_path() const {return d_path_list[0];};
- path* next_active_path(){return d_path_list[d_active_pos++];};
- void set_frozen_bit(const unsigned char frozen_bit, const int bit_pos);
- void set_info_bit(const int bit_pos);
- const path* optimal_path();
- };
+ path* initial_path() const { return d_path_list[0]; };
+ path* next_active_path() { return d_path_list[d_active_pos++]; };
+ void set_frozen_bit(const unsigned char frozen_bit, const int bit_pos);
+ void set_info_bit(const int bit_pos);
+ const path* optimal_path();
+};
- } /* namespace polar */
- } /* namespace code */
- } /* namespace fec */
+} /* namespace polar */
+} /* namespace code */
+} /* namespace fec */
} /* namespace gr */
#endif /* INCLUDED_FEC_SCL_LIST_H */