亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? make-ldpc.c

?? LINUX環(huán)境下的LDPC代碼; 有獨立的編碼
?? C
字號:
/* MAKE-LDPC.C - Make a Low Density Parity Check code's parity check matrix. *//* Copyright (c) 2000, 2001, 2006 by Radford M. Neal and Peter Junteng Liu * * Permission is granted for anyone to copy, use, modify, or distribute this * program and accompanying programs and documents for any purpose, provided  * this copyright notice is retained and prominently displayed, along with * a note saying that the original programs are available from Radford Neal's * web page, and note is made of any changes made to the programs.  The * programs and documents are distributed without any warranty, express or * implied.  As the programs were written for research purposes only, they have * not been tested to the degree that would be advisable in any important * application.  All use of these programs is entirely at the user's own risk. */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include "rand.h"#include "alloc.h"#include "intio.h"#include "open.h"#include "mod2sparse.h"#include "mod2dense.h"#include "mod2convert.h"#include "rcode.h"#include "distrib.h"/* METHODS FOR CONSTRUCTING CODES. */typedef enum { Evencol, 	/* Uniform number of bits per column, with number specified */  Evenboth 	/* Uniform (as possible) over both columns and rows */} make_method; void make_ldpc (int, make_method, distrib *, int);int *column_partition (distrib *, int);void usage (void);/* MAIN PROGRAM. */int main( int argc,  char **argv){  make_method method;  char *file, **meth;  int seed, no4cycle;  distrib *d;  char junk;  FILE *f;    /* Look at initial arguments. */  if (!(file = argv[1])   || !argv[2] || sscanf(argv[2],"%d%c",&M,&junk)!=1 || M<=0   || !argv[3] || sscanf(argv[3],"%d%c",&N,&junk)!=1 || N<=0   || !argv[4] || sscanf(argv[4],"%d%c",&seed,&junk)!=1)  { usage();  }  /* Look at the arguments specifying the method for producing the code. */  meth = argv+5;  if (!meth[0]) usage();  no4cycle = 0;  if (strcmp(meth[0],"evencol")==0 || strcmp(meth[0],"evenboth")==0)  { method = strcmp(meth[0],"evencol")==0 ? Evencol : Evenboth;    if (!meth[1])    { usage();    }    d = distrib_create(meth[1]);    if (d==0)    { usage();    }    if (meth[2])    { if (strcmp(meth[2],"no4cycle")==0)      { no4cycle = 1;        if (meth[3])        { usage();        }      }      else      { usage();      }    }  }  else  { usage();  }  /* Check for some problems. */  if (distrib_max(d)>M)  { fprintf(stderr,      "At least one checks per bit (%d) is greater than total checks (%d)\n",      distrib_max(d), M);    exit(1);  }  if (distrib_max(d)==M && N>1 && no4cycle)  { fprintf(stderr,      "Can't eliminate cycles of length four with this many checks per bit\n");    exit(1);  }   /* Make the parity check matrix. */  make_ldpc(seed,method,d,no4cycle);  /* Write out the parity check matrix. */  f = open_file_std(file,"wb");  if (f==NULL)   { fprintf(stderr,"Can't create parity check file: %s\n",file);    exit(1);  }  intio_write(f,('P'<<8)+0x80);    if (ferror(f) || !mod2sparse_write(f,H) || fclose(f)!=0)  { fprintf(stderr,"Error writing to parity check file %s\n",file);    exit(1);  }  return 0;}/* PRINT USAGE MESSAGE AND EXIT. */void usage(void){ fprintf(stderr,"Usage:  make-ldpc pchk-file n-checks n-bits seed method\n");  fprintf(stderr,"Method: evencol  checks-per-col [ \"no4cycle\" ]\n");  fprintf(stderr,"    or: evencol  checks-distribution [ \"no4cycle\" ]\n");  fprintf(stderr,"    or: evenboth checks-per-col [ \"no4cycle\" ]\n");  fprintf(stderr,"    or: evenboth checks-distribution [ \"no4cycle\" ]\n");  exit(1);}/* CREATE A SPARSE PARITY-CHECK MATRIX.  Of size M by N, stored in H. */void make_ldpc( int seed,		/* Random number seed */  make_method method,	/* How to make it */  distrib *d,		/* Distribution list specified */  int no4cycle		/* Eliminate cycles of length four? */){  mod2entry *e, *f, *g, *h;  int added, uneven, elim4, all_even, n_full, left;  int i, j, k, t, z, cb_N;  int *part, *u;  rand_seed(10*seed+1);  H = mod2sparse_allocate(M,N);  part = column_partition(d,N);  /* Create the initial version of the parity check matrix. */  switch (method)  {     case Evencol:    {       z = 0;      left = part[z];      for (j = 0; j<N; j++)      { while (left==0)        { z += 1;          if (z>distrib_size(d))          { abort();          }          left = part[z];        }        for (k = 0; k<distrib_num(d,z); k++)        { do          { i = rand_int(M);          } while (mod2sparse_find(H,i,j));          mod2sparse_insert(H,i,j);        }        left -= 1;      }      break;    }    case Evenboth:    {      cb_N = 0;      for (z = 0; z<distrib_size(d); z++)      { cb_N += distrib_num(d,z) * part[z];      }            u = chk_alloc (cb_N, sizeof *u);      for (k = cb_N-1; k>=0; k--)      { u[k] = k%M;      }        uneven = 0;      t = 0;      z = 0;      left = part[z];      for (j = 0; j<N; j++)      {         while (left==0)        { z += 1;          if (z>distrib_size(d))          { abort();          }          left = part[z];        }	for (k = 0; k<distrib_num(d,z); k++)        {           for (i = t; i<cb_N && mod2sparse_find(H,u[i],j); i++) ;          if (i==cb_N)          { uneven += 1;            do            { i = rand_int(M);            } while (mod2sparse_find(H,i,j));            mod2sparse_insert(H,i,j);          }          else          { do            { i = t + rand_int(cb_N-t);            } while (mod2sparse_find(H,u[i],j));            mod2sparse_insert(H,u[i],j);            u[i] = u[t];            t += 1;          }        }        left -= 1;      }      if (uneven>0)      { fprintf(stderr,"Had to place %d checks in rows unevenly\n",uneven);      }      break;    }    default: abort();  }  /* Add extra bits to avoid rows with less than two checks. */  added = 0;  for (i = 0; i<M; i++)  { e = mod2sparse_first_in_row(H,i);    if (mod2sparse_at_end(e))    { j = rand_int(N);      e = mod2sparse_insert(H,i,j);      added += 1;    }    e = mod2sparse_first_in_row(H,i);    if (mod2sparse_at_end(mod2sparse_next_in_row(e)) && N>1)    { do       { j = rand_int(N);       } while (j==mod2sparse_col(e));      mod2sparse_insert(H,i,j);      added += 1;    }  }  if (added>0)  { fprintf(stderr,           "Added %d extra bit-checks to make row counts at least two\n",           added);  }  /* Add extra bits to try to avoid problems with even column counts. */  n_full = 0;  all_even = 1;  for (z = 0; z<distrib_size(d); z++)  { if (distrib_num(d,z)==M)     { n_full += part[z];    }    if (distrib_num(d,z)%2==1)    { all_even = 0;    }  }  if (all_even && N-n_full>1 && added<2)  { int a;    for (a = 0; added+a<2; a++)    { do      { i = rand_int(M);        j = rand_int(N);      } while (mod2sparse_find(H,i,j));      mod2sparse_insert(H,i,j);    }    fprintf(stderr, "Added %d extra bit-checks to try to avoid problems from even column counts\n",      a);  }  /* Eliminate cycles of length four, if asked, and if possible. */  if (no4cycle)  {     elim4 = 0;    for (t = 0; t<10; t++)     { k = 0;      for (j = 0; j<N; j++)      { for (e = mod2sparse_first_in_col(H,j);             !mod2sparse_at_end(e);             e = mod2sparse_next_in_col(e))        { for (f = mod2sparse_first_in_row(H,mod2sparse_row(e));               !mod2sparse_at_end(f);               f = mod2sparse_next_in_row(f))          { if (f==e) continue;            for (g = mod2sparse_first_in_col(H,mod2sparse_col(f));                 !mod2sparse_at_end(g);                 g = mod2sparse_next_in_col(g))            { if (g==f) continue;              for (h = mod2sparse_first_in_row(H,mod2sparse_row(g));                   !mod2sparse_at_end(h);                   h = mod2sparse_next_in_row(h))              { if (mod2sparse_col(h)==j)                { do                  { i = rand_int(M);                  } while (mod2sparse_find(H,i,j));                  mod2sparse_delete(H,e);                  mod2sparse_insert(H,i,j);                  elim4 += 1;                  k += 1;                  goto nextj;                }              }            }          }        }      nextj: ;      }      if (k==0) break;    }    if (elim4>0)    { fprintf(stderr,        "Eliminated %d cycles of length four by moving checks within column\n",         elim4);    }    if (t==10)     { fprintf(stderr,        "Couldn't eliminate all cycles of length four in 10 passes\n");    }  }}/* PARTITION THE COLUMNS ACCORDING TO THE SPECIFIED PROPORTIONS.  It   may not be possible to do this exactly.  Returns a pointer to an   array of integers containing the numbers of columns corresponding    to the entries in the distribution passed. */int *column_partition( distrib *d,		/* List of proportions and number of check-bits */  int n			/* Total number of columns to partition */){  double *trunc;  int *part;  int cur, used;  int i, j;  trunc = chk_alloc (distrib_size(d), sizeof(double));  part = chk_alloc (distrib_size(d), sizeof(int));  used = 0;  for (i = 0; i<distrib_size(d); i++)  { cur = floor(distrib_prop(d,i)*n);    part[i] = cur;     trunc[i] = distrib_prop(d,i)*n - cur;     used += cur;   }  if (used>n)   { abort();  }    while (used<n)  { cur = 0;    for (j = 1; j<distrib_size(d); j++)     { if (trunc[j]>trunc[cur])      { cur = j;      }    }    part[cur] += 1;    used += 1;    trunc[cur] = -1;  }  free(trunc);  return part;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久日韩精品一区二区五区| 91麻豆精品国产91久久久久久久久| 91免费版在线看| 国产精品18久久久久久久久久久久 | 欧美一级久久久久久久大片| 在线影院国内精品| 成人做爰69片免费看网站| av中文字幕不卡| 欧美日韩另类一区| 国产三级精品视频| 亚洲国产日韩在线一区模特| 首页亚洲欧美制服丝腿| 丁香六月久久综合狠狠色| 在线播放欧美女士性生活| 欧美在线免费观看视频| 欧美日韩高清一区二区| 久久人人97超碰com| 亚洲第一久久影院| av福利精品导航| 日韩精品一区二区三区四区视频| 一区二区中文视频| 国产福利一区二区三区视频 | 国产成人aaa| 在线精品视频一区二区三四| 91精品国产aⅴ一区二区| 亚洲视频免费在线观看| 国产不卡高清在线观看视频| 欧美大片在线观看| 美国毛片一区二区| 日韩一级二级三级| 午夜激情一区二区| 日韩欧美资源站| 日韩中文字幕av电影| 色老汉av一区二区三区| 国产精品丝袜一区| 国产一区二区精品久久99| 久久蜜桃av一区二区天堂| 国产日韩一级二级三级| 日韩亚洲欧美一区二区三区| 欧美一区二区三区不卡| 一区二区三区视频在线看| 99久久99久久综合| 一区二区三区精品在线观看| 欧美精品 国产精品| 看电视剧不卡顿的网站| 久久精品在线免费观看| 欧美女孩性生活视频| 日本韩国一区二区三区| 欧美制服丝袜第一页| 亚洲午夜羞羞片| 久久久久久久久免费| 91色婷婷久久久久合中文| 天堂久久一区二区三区| 欧美国产一区视频在线观看| 色婷婷久久久综合中文字幕| 国产精品麻豆一区二区| 欧美精品第一页| 另类小说综合欧美亚洲| 亚洲免费观看高清完整版在线观看| 一本色道久久综合亚洲精品按摩| 麻豆精品新av中文字幕| 亚洲精品国产成人久久av盗摄| 精品福利一二区| 99re热这里只有精品免费视频 | 一个色在线综合| 欧美精品一区二区精品网| 在线观看免费成人| 免费成人av在线播放| 一区二区欧美精品| 亚洲欧美在线观看| 亚洲欧美电影一区二区| 日韩一级成人av| 精品综合久久久久久8888| 国产精品久久毛片| 中文字幕免费一区| 国产精品私人影院| 国产精品毛片无遮挡高清| 久久综合久久综合久久综合| 91麻豆精品国产自产在线 | 亚洲网友自拍偷拍| 久久精品一级爱片| 欧美激情中文字幕| 中文字幕精品综合| 一区二区三区美女视频| 亚洲国产另类av| 久久精品国产第一区二区三区| 麻豆精品一区二区综合av| 国产成人一区在线| 亚洲综合成人在线视频| 天天色图综合网| 亚洲自拍欧美精品| 久久成人综合网| 99国产一区二区三精品乱码| 色欧美片视频在线观看| 色菇凉天天综合网| 91精品国产综合久久久久久| 国产色产综合色产在线视频| 国产三级欧美三级| 欧美色国产精品| 在线观看日韩国产| 精品国产伦一区二区三区观看方式| 日韩欧美在线1卡| 日韩美女视频一区| 性做久久久久久免费观看| 国产伦精品一区二区三区视频青涩| 夜色激情一区二区| 欧美精品一区二区高清在线观看| 亚洲精品欧美在线| 亚洲麻豆国产自偷在线| 日韩国产在线一| 国产成人亚洲综合色影视| 国产成人午夜视频| 欧美高清性hdvideosex| 国产欧美一区二区精品秋霞影院 | 国产mv日韩mv欧美| 1区2区3区国产精品| 欧美日韩一区三区四区| 亚洲欧美日韩国产中文在线| 91色视频在线| 麻豆国产精品一区二区三区| 精品久久久久久久一区二区蜜臀| 国产中文一区二区三区| 国产精品久久网站| 欧美人伦禁忌dvd放荡欲情| 日韩高清不卡一区二区三区| 久久久美女艺术照精彩视频福利播放| 国产曰批免费观看久久久| 国产精品免费视频一区| 在线欧美日韩精品| 美女视频一区在线观看| 亚洲一区二区三区中文字幕| 91福利社在线观看| 国产乱码精品一区二区三区忘忧草 | 国产精品久久免费看| 91精品国产品国语在线不卡| 国产成人午夜精品影院观看视频| 洋洋av久久久久久久一区| 久久久777精品电影网影网 | 久久先锋影音av鲁色资源网| 99久久er热在这里只有精品15| 免费黄网站欧美| 亚洲一区在线电影| 亚洲精品美腿丝袜| 国产精品电影一区二区| 中文字幕一区二区在线播放| 91丨九色丨黑人外教| 日本伊人精品一区二区三区观看方式| 国产精品久久久久久久岛一牛影视 | 男女激情视频一区| 欧美一区二区三区日韩视频| 国产精品影视在线观看| 国产精品不卡在线| 欧美日韩亚洲丝袜制服| 九色综合狠狠综合久久| 国产精品麻豆视频| 欧美一区二区免费| 69av一区二区三区| 日韩亚洲电影在线| 日本一区二区免费在线观看视频| 国产精品美女久久久久aⅴ| 综合自拍亚洲综合图不卡区| 亚洲成av人在线观看| 麻豆精品在线视频| 91在线你懂得| 日韩一区二区麻豆国产| 国产精品午夜在线| 亚洲第一久久影院| 亚洲伊人色欲综合网| 亚洲美女屁股眼交| 亚洲欧美激情插| 亚洲蜜臀av乱码久久精品| 亚洲人成影院在线观看| 中文字幕一区二区三区不卡| 国产精品不卡在线观看| 亚洲人成网站精品片在线观看| 一区二区三区成人| 天天亚洲美女在线视频| 国产美女精品人人做人人爽| 国产精品综合一区二区| av日韩在线网站| 欧美影院一区二区三区| 精品毛片乱码1区2区3区| 久久嫩草精品久久久久| 亚洲欧美激情在线| 精品一区二区综合| 色偷偷88欧美精品久久久| 欧美人妇做爰xxxⅹ性高电影| 26uuu色噜噜精品一区二区| 国产精品久久久久影院| 日韩精品亚洲专区| 成人动漫中文字幕| 欧美一区在线视频| 亚洲靠逼com| 激情成人综合网| 欧美三级中文字幕| 亚洲欧美区自拍先锋| 国产在线观看一区二区| 欧美日韩国产在线观看| 一卡二卡三卡日韩欧美| 成人h动漫精品|