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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? make-ldpc.c

?? 這是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;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲永久免费视频| 精久久久久久久久久久| 免费人成精品欧美精品 | 国产一区二区三区四区五区入口| 成人动漫精品一区二区| 欧美高清www午色夜在线视频| 国产欧美一区在线| 美女被吸乳得到大胸91| 色婷婷激情综合| 国产精品嫩草99a| 精品无人码麻豆乱码1区2区 | 成人深夜视频在线观看| 6080yy午夜一二三区久久| 国产精品拍天天在线| 美女一区二区久久| 欧美视频一区在线| 亚洲乱码国产乱码精品精98午夜| 国产乱码字幕精品高清av| 欧美日韩另类国产亚洲欧美一级| 亚洲色图欧美偷拍| 成人97人人超碰人人99| 国产女同性恋一区二区| 精品亚洲欧美一区| 欧美一区二区三级| 日韩av电影天堂| 欧美日韩专区在线| 一区二区三区影院| 91蜜桃传媒精品久久久一区二区| 欧美国产一区二区在线观看| 久久国产乱子精品免费女| 欧美夫妻性生活| 日欧美一区二区| 日韩一区二区视频| 麻豆成人av在线| 日韩欧美一级在线播放| 日韩激情一二三区| 欧美v国产在线一区二区三区| 日韩高清一区二区| 欧美变态凌虐bdsm| 国产在线播放一区二区三区| 久久久久88色偷偷免费| 成人听书哪个软件好| 国产精品免费丝袜| 色综合一个色综合| 亚洲电影一区二区| 69久久99精品久久久久婷婷 | 日韩视频123| 日本欧美韩国一区三区| 欧美mv和日韩mv的网站| 国内精品嫩模私拍在线| 国产精品久久久久久亚洲伦| 91在线观看美女| 亚洲gay无套男同| 日韩精品一区二区三区swag | 日韩精品亚洲一区二区三区免费| 正在播放一区二区| 国产福利一区二区三区在线视频| 中文字幕不卡在线| 91豆麻精品91久久久久久| 午夜精品久久久久久久久久| 精品国产一区二区精华| 成人福利视频在线看| 夜夜精品视频一区二区| 日韩欧美一区二区免费| www.日本不卡| 午夜精品福利一区二区蜜股av| 精品欧美乱码久久久久久1区2区| 国产传媒一区在线| 亚洲成人自拍一区| 精品成人免费观看| 色噜噜夜夜夜综合网| 全国精品久久少妇| 亚洲欧美视频在线观看视频| 日韩欧美aaaaaa| 一本大道综合伊人精品热热| 蜜桃视频在线一区| 亚洲免费成人av| 久久久亚洲精品一区二区三区 | 欧美一区二区在线免费播放| 成人国产精品视频| 美女一区二区久久| 亚洲一区日韩精品中文字幕| 久久午夜电影网| 精品视频在线免费| caoporen国产精品视频| 蜜桃视频在线观看一区二区| 中文字幕在线不卡一区 | 欧美激情一区二区在线| 欧美日韩电影在线| caoporen国产精品视频| 国产乱码精品1区2区3区| 香蕉成人啪国产精品视频综合网 | 精品国产一区二区三区久久影院 | 久久精品亚洲国产奇米99| 在线观看日韩av先锋影音电影院| 国产中文字幕一区| 日韩av中文字幕一区二区三区| 亚洲黄色av一区| 中文字幕在线观看不卡视频| 久久夜色精品国产欧美乱极品| 欧美一区二区大片| 欧美日韩不卡一区| 欧美性一二三区| 欧洲一区二区三区在线| 色欧美日韩亚洲| 99精品热视频| hitomi一区二区三区精品| 国产激情视频一区二区三区欧美 | 美女视频第一区二区三区免费观看网站| 国产精品国产三级国产有无不卡| 日韩欧美成人午夜| 日韩西西人体444www| 欧美日韩国产高清一区二区三区 | 欧美日韩精品一区二区三区四区| 91啪在线观看| 色婷婷综合久久久久中文| 波多野结衣在线一区| 懂色中文一区二区在线播放| 国产乱对白刺激视频不卡| 极品少妇xxxx偷拍精品少妇| 经典三级在线一区| 国产成人综合精品三级| 成人性视频网站| 99精品视频在线观看| 欧美做爰猛烈大尺度电影无法无天| 色网综合在线观看| 欧美性xxxxxxxx| 欧美一区二区三区系列电影| 日韩欧美国产一区二区三区| 久久综合色婷婷| 亚洲国产高清aⅴ视频| 国产精品伦理一区二区| 亚洲伦在线观看| 天堂一区二区在线| 久久66热偷产精品| caoporn国产一区二区| 欧美日韩在线播| 欧美精品一区二区高清在线观看| 国产亚洲一二三区| 亚洲欧美日韩中文播放| 丝袜脚交一区二区| 国产精品亚洲一区二区三区在线| 丁香一区二区三区| 在线看日韩精品电影| 欧美一级夜夜爽| 中文字幕精品一区二区三区精品| 亚洲天堂久久久久久久| 亚洲成av人片www| 韩国成人福利片在线播放| 99在线精品观看| 91麻豆精品国产自产在线观看一区 | 91精品婷婷国产综合久久性色| 精品国产乱码久久久久久久| 亚洲欧美一区二区在线观看| 午夜精品成人在线视频| 国产suv精品一区二区三区| 色88888久久久久久影院按摩 | 日韩高清在线不卡| www.欧美.com| 欧美一级二级三级蜜桃| 欧美经典一区二区三区| 午夜伊人狠狠久久| 成人一区二区三区在线观看 | 一本色道久久加勒比精品 | 在线观看成人免费视频| 欧美一区在线视频| 亚洲精品久久嫩草网站秘色| 美国精品在线观看| 欧美视频一区在线观看| 亚洲欧洲99久久| 麻豆久久久久久久| 88在线观看91蜜桃国自产| 中文字幕一区二区三中文字幕| 青青草国产精品亚洲专区无| 91浏览器在线视频| 国产色91在线| 激情久久久久久久久久久久久久久久| 日本高清成人免费播放| 中文字幕第一区第二区| 精品亚洲成a人| 91精品国产综合久久福利软件| 亚洲欧美电影一区二区| 床上的激情91.| 国产亚洲一区二区在线观看| 久久99久久精品欧美| 欧美日韩一级黄| 一区二区三区日韩精品视频| 99久久免费视频.com| 中日韩免费视频中文字幕| 激情综合色播激情啊| 精品少妇一区二区三区在线播放 | 天堂精品中文字幕在线| 91视频在线看| 亚洲同性gay激情无套| 99在线精品视频| 亚洲色图色小说| 色婷婷狠狠综合| 一区二区在线观看不卡| 色婷婷综合久色| 性做久久久久久免费观看 |