IT++
4.3.1
Toggle main menu visibility
itpp
comm
crc.h
Go to the documentation of this file.
1
28
29
#ifndef CRC_H
30
#define CRC_H
31
32
#include <
itpp/base/vec.h
>
33
#include <
itpp/base/mat.h
>
34
#include <itpp/itexports.h>
35
36
namespace
itpp
37
{
38
64
class
ITPP_EXPORT
CRC_Code
65
{
66
public
:
67
69
CRC_Code
() { reverse_parity =
false
; }
70
78
CRC_Code
(
const
std::string &code) { reverse_parity =
false
;
set_code
(code); }
79
81
void
set_generator(
const
bvec &
poly
);
82
84
void
set_code(
const
std::string &code);
85
87
void
parity(
const
bvec &in_bits, bvec &out)
const
;
88
90
bool
check_parity(
const
bvec &coded_bits)
const
;
91
93
void
encode(
const
bvec &in_bits, bvec &out)
const
;
94
96
bvec encode(
const
bvec &in_bits)
const
;
97
99
bool
decode(
const
bvec &coded_bits, bvec &out)
const
;
100
102
bool
decode(bvec &bits)
const
;
103
104
private
:
105
bool
reverse_parity;
106
bvec polynomial;
107
int
no_parity;
108
};
109
110
}
// namespace itpp
111
112
#endif
// #ifndef CRC_H
itpp::CRC_Code::set_code
void set_code(const std::string &code)
Set CRC code to one of the standardpolynomials using the string value.
Definition
crc.cpp:70
itpp::CRC_Code::CRC_Code
CRC_Code(const std::string &code)
Set CRC code to one of the standardpolynomials using the string value.
Definition
crc.h:78
itpp::CRC_Code::CRC_Code
CRC_Code()
Default Constructor.
Definition
crc.h:69
itpp::poly
void poly(const vec &r, vec &p)
Create a polynomial of the given roots.
Definition
poly.cpp:40
mat.h
Matrix Class Definitions.
itpp
itpp namespace
Definition
itmex.h:37
vec.h
Templated Vector Class Definitions.
Generated by
1.17.0