Go to the documentation of this file.00001
00002
00003 #include <itpp/itcomm.h>
00004
00005 using namespace itpp;
00006 using namespace std;
00007
00008 extern int main(int argc, char **argv)
00009 {
00010 {
00011 cout << "========= RANDOM (3,6) CODE ==========" << endl;
00012 LDPC_Parity_Matrix H;
00013 H.generate_regular_ldpc(500,3,6,
00014 "rand",
00015 "500 10");
00016 H.display_stats();
00017 LDPC_Code C1(H);
00018 C1.save_to_file("random_3_6_code.it");
00019 }
00020
00021 {
00022
00023
00024
00025 cout << "========= MACKAY CODE ==========" << endl;
00026 LDPC_Parity_Matrix H("204.33.484","alist");
00027 H.display_stats();
00028 LDPC_Generator_Matrix G(H);
00029 LDPC_Code C(H,G);
00030 C.save_to_file("mackay_204.33.484.it");
00031
00032
00033
00034 H.cycle_removal_MGW(12);
00035 LDPC_Generator_Matrix G1(H);
00036 LDPC_Code C1(H,G1);
00037 C1.save_to_file("mackay_204.33.484_opt.it");
00038 }
00039
00040
00041
00042
00043
00044 {
00045 cout << "========= IRREGULAR CODE 1000 BITS ==========" << endl;
00046 LDPC_Parity_Matrix H;
00047 H.generate_irregular_ldpc(1000,
00048 "0 0.27684 0.28342 0 0 0 0 0 0.43974",
00049 "0 0 0 0 0 0.01568 0.85244 0.13188",
00050 "rand",
00051 "500 8");
00052 LDPC_Code C(H);
00053 C.save_to_file("RU_1000.it");
00054 }
00055
00056 {
00057 cout << "========= IRREGULAR CODE 10000 BITS ==========" << endl;
00058 LDPC_Parity_Matrix H;
00059 H.generate_irregular_ldpc(10000,"0 0.21991 0.23328 0.02058 0 0.08543 0.06540 0.04767 \
00060 0.01912 0 0 0 0 0 0 0 0 0 0.08064 0.22798",
00061 "0 0 0 0 0 0 0 0.64854 0.34747 0.00399",
00062 "rand",
00063 "150 8");
00064 LDPC_Code C(H);
00065 C.save_to_file("RU_10000.it");
00066 }
00067
00068 {
00069 cout << "========= IRREGULAR CODE 100000 BITS ==========" << endl;
00070 LDPC_Parity_Matrix H;
00071 H.generate_irregular_ldpc(100000,"0 0.1712 0.21053 0.00273 0 0 0.00009 0.15269 0.09227 \
00072 0.02802 0 0 0 0 0.01206 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07212 0 0 0 0 \
00073 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25830",
00074 "0 0 0 0 0 0 0 0 0.33620 0.08883 0.57497",
00075 "rand",
00076 "40 4");
00077 LDPC_Code C(H);
00078 C.save_to_file("RU_100000.it");
00079 }
00080
00081 exit(0);
00082
00083 {
00084
00085 cout << "========= IRREGULAR CODE 1000000 BITS ==========" << endl;
00086 LDPC_Parity_Matrix H;
00087 H.generate_irregular_ldpc(1000000,"0 0.1712 0.21053 0.00273 0 0 0.00009 0.15269 0.09227 \
00088 0.02802 0 0 0 0 0.01206 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07212 0 0 0 0 \
00089 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25830",
00090 "0 0 0 0 0 0 0 0 0.33620 0.08883 0.57497",
00091 "rand",
00092 "0 0");
00093 LDPC_Code C(H);
00094 C.save_to_file("RU_1000000.it");
00095 }
00096
00097 }