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

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

?? dec.c

?? LDPC 編碼 解碼仿真程序 包括編碼解碼 矩陣生成
?? C
字號:
/* DEC.C - Decoding procedures. *//* Copyright (c) 2000, 2001 by Radford M. Neal  * * Permission is granted for anyone to copy, use, or modify this program  * for purposes of research or education, provided this copyright notice  * is retained, and note is made of any changes that have been made.  * * This program is distributed without any warranty, express or implied. * As this program was written for research purposes only, it has not been * tested to the degree that would be advisable in any important application. * All use of this program is entirely at the user's own risk. *//* NOTE:  See decoding.html for general documentation on the decoding methods */#include <stdio.h>#include <stdlib.h>#include <math.h>#include "alloc.h"#include "mod2sparse.h"#include "mod2dense.h"#include "mod2convert.h"#include "rand.h"#include "rcode.h"#include "check.h"#include "dec.h"#include "enc.h"/* GLOBAL VARIABLES.  Declared in dec.h. */decoding_method dec_method;	/* Decoding method to use */int table;	/* Trace option, 2 for a table of decoding details */int block_no;	/* Number of current block, from zero */int max_iter;	/* Maximum number of iteratons of decoding to do */char *gen_file;	/* Generator file for Enum_block and Enum_bit *//* DECODE BY EXHAUSTIVE ENUMERATION.  Decodes by trying all possible source   messages (and hence all possible codewords, unless the parity check matrix   was redundant).  If the last argument is 1, it sets dblk to the most likely   entire block; if this argument is 0, each bit of dblk is set to the most   likely value for that bit.  The marginal probabilities of each bit being 1   are returned in bitpr.   The function value returned is the total number of codewords tried (which    will be the same for all blocks).  The return valued is "unsigned" because   it might conceivably be as big as 2^31.   The parity check matrix and other data are taken from the global variables   declared in rcode.h.   The number of message bits should not be greater than 31 for this procedure.   The setup procedure immediately below checks this, reads the generator file,   and outputs headers for the detailed trace file, if required. */void enum_decode_setup(void){  read_gen(gen_file,0,0);  if (N-M>31)  { fprintf(stderr,"Trying to decode messages with %d bits by exhaustive enumeration is absurd!\n",      N-M);    exit(1);    }  if (table==2)  { printf("  block   decoding  likelihood\n");  }}unsigned enum_decode( double *lratio,	/* Likelihood ratios for bits */  char *dblk, 		/* Place to stored decoded message */  double *bitpr,	/* Place to store marginal bit probabilities */  int max_block		/* Maximize probability of whole block being correct? */){  mod2dense *u, *v;  double lk, maxlk, tpr;  double *bpr, *lk0, *lk1;  char sblk[31];  char *cblk;  unsigned d;  int i, j;  if (N-M>31) abort();  /* Allocate needed space. */  bpr = bitpr;  if (bpr==0 && max_block==0)  { bpr = chk_alloc (N, sizeof *bpr);  }  cblk = chk_alloc (N, sizeof *cblk);  if (type=='d')  { u = mod2dense_allocate(N-M,1);    v = mod2dense_allocate(M,1);  }  if (type=='m')  { u = mod2dense_allocate(M,1);    v = mod2dense_allocate(M,1);  }  lk0 = chk_alloc (N, sizeof *lk0);  lk1 = chk_alloc (N, sizeof *lk1);  /* Pre-compute likelihoods for bits. */  for (j = 0; j<N; j++)  { 
	lk0[j] = 1/(1+lratio[j]);    lk1[j] = 1 - lk0[j];  }  /* Initialize marginal bit probabilities. */  if (bpr)  { for (j = 0; j<N; j++) bpr[j] = 0.0;  }  /* Exhaustively try all possible decoded messages. */  tpr = 0.0;  for (d = 0; d<=(1<<(N-M))-1; d++)  {    /* Unpack message into source block. */    for (i = N-M-1; i>=0; i--)    { sblk[i] = (d>>i)&1;    }    /* Find full codeword for this message. */    switch (type)    { case 's':      { sparse_encode (sblk, cblk);        break;      }      case 'd':      { dense_encode (sblk, cblk, u, v);        break;      }      case 'm':      { mixed_encode (sblk, cblk, u, v);        break;      }    }    /* Compute likelihood for this decoding. */    lk = 1;    for (j = 0; j<N; j++)    { lk *= cblk[j]==0 ? lk0[j] : lk1[j];    }    /* Update maximum likelihood decoding. */    if (max_block)    { if (d==0 || lk>maxlk)      { for (j = 0; j<N; j++)        { dblk[j] = cblk[j];        }        maxlk = lk;      }    }    /* Update bit probabilities. */     if (bpr)    { for (j = 0; j<N; j++)       { if (cblk[j]==1)         { bpr[j] += lk;        }      }      tpr += lk;    }    /* Output data to trace file. */    if (table==2)    { printf("%7d %10x  %10.4e\n",block_no,d,lk);    }  }  /* Normalize bit probabilities. */  if (bpr)  { for (j = 0; j<N; j++) bpr[j] /= tpr;  }  /* Decoding to maximize bit-by-bit success, if that's what's wanted.      In case of a tie, decode to a 1. */  if (!max_block)  { for (j = 0; j<N; j++)     { dblk[j] = bpr[j]>=0.5;    }  }  /* Free space. */  if (bpr!=0 && bpr!=bitpr) free(bpr);  free(cblk);  free(lk0);  free(lk1);  return 1<<(N-M);}/* DECODE USING PROBABILITY PROPAGATION.  Tries to find the most probable    values for the bits of the codeword, given a parity check matrix (H), and   likelihood ratios (lratio) for each bit.  If max_iter is positive, up to    that many iterations of probability propagation are done, stopping before    then if the tentative decoding is a valid codeword.  If max_iter is    negative, abs(max_iter) iterations are done, regardless of whether a    codeword was found earlier.   Returns the number of iterations done (as an "unsigned" for consistency   with enum_decode).  Regardless of whether or not a valid codeword was    reached, the bit vector from thresholding the bit-by-bit probabilities is    stored in dblk, and the resulting parity checks are stored in pchk (all    will be zero if the codeword is valid).  The final probabilities for each    bit being a 1 are stored in bprb.   The setup procedure immediately below outputs headers for the detailed trace   file, if required.*/void prprp_decode_setup (void){  if (table==2)  { printf(     "  block  iter  changed  perrs    loglik   Eperrs   Eloglik  entropy\n");  }}unsigned prprp_decode( mod2sparse *H,	/* Parity check matrix */  double *lratio,	/* Likelihood ratios for bits */  char *dblk,		/* Place to store decoding */  char *pchk,		/* Place to store parity checks */  double *bprb		/* Place to store bit probabilities */){   int N, n, c;  N = mod2sparse_cols(H);  /* Initialize probability and likelihood ratios, and find initial guess. */  initprp(H,lratio,dblk,bprb);  /* Do up to abs(max_iter) iterations of probability propagation, stopping     early if a codeword is found, unless max_iter is negative. */
  //如果加了負號,則必須達到次數,沒有加的話是碼子就可以了!  for (n = 0; ; n++)  {     c = check(H,dblk,pchk);    if (table==2)    { printf("%7d %5d %8.1f %6d %+9.2f %8.1f %+9.2f  %7.1f\n", block_no, n, changed(lratio,dblk,N), c, loglikelihood(lratio,dblk,N),        expected_parity_errors(H,bprb), expected_loglikelihood(lratio,bprb,N), entropy(bprb,N));    }       if (n==max_iter || n==-max_iter || (max_iter>0 && c==0))    {
	  break;     }    iterprp(H,lratio,dblk,bprb);  }  return n;}/* INITIALIZE PROBABILITY PROPAGATION.  Stores initial ratios, probabilities,   and guess at decoding. */void initprp( mod2sparse *H,	/* Parity check matrix */  double *lratio,	/* Likelihood ratios for bits */  char *dblk,		/* Place to store decoding */  double *bprb		/* Place to store bit probabilities, 0 if not wanted */){   mod2entry *e;
  /*typedef struct mod2entry /* Structure representing a non-zero entry, or
			      //the header for a row or column               
 {
  int row, col;		  /* Row and column indexes of this entry, starting
                             //at 0, and with -1 for a row or column header  

  struct mod2entry *left, *right,  /* Pointers to entries adjacent in row  
                   *up, *down;     /*   and column, or to headers.  Free   
                                   /*   entries are linked by 'left'.

  double pr, lr;	  /* Probability and likelihood ratios - not used by the mod2sparse module itself             
} mod2entry;*/  int N;  int j;  N = mod2sparse_cols(H);  for (j = 0; j<N; j++)  { 
	for (e = mod2sparse_first_in_col(H,j); !mod2sparse_at_end(e);  e = mod2sparse_next_in_col(e))    { 
	  e->pr = lratio[j];      e->lr = 1;    }    if (bprb) bprb[j] = 1 - 1/(1+lratio[j]);//如何解讀該行語法??    dblk[j] = (lratio[j]>=1);  }}/* DO ONE ITERATION OF PROBABILITY PROPAGATION. *///一次概率傳播過程。void iterprp( mod2sparse *H,	/* Parity check matrix */  double *lratio,	/* Likelihood ratios for bits */  char *dblk,		/* Place to store decoding */  double *bprb		/* Place to store bit probabilities, 0 if not wanted */){  double pr, dl, t;  mod2entry *e;  int N, M;  int i, j;  M = mod2sparse_rows(H);  N = mod2sparse_cols(H);  /* Recompute likelihood ratios. */  for (i = 0; i<M; i++)  { 
	dl = 1;    for (e = mod2sparse_first_in_row(H,i); !mod2sparse_at_end(e);  e = mod2sparse_next_in_row(e))    { 
	  e->lr = dl;      dl *= 2/(1+e->pr) - 1;    }    dl = 1;    for (e = mod2sparse_last_in_row(H,i); !mod2sparse_at_end(e); e = mod2sparse_prev_in_row(e))    { 
	  t = e->lr * dl;      e->lr = (1-t)/(1+t);      dl *= 2/(1+e->pr) - 1;    }  }  /* Recompute probability ratios.  Also find the next guess based on the     individually most likely values. */  for (j = 0; j<N; j++)  { 
	pr = lratio[j];    for (e = mod2sparse_first_in_col(H,j); !mod2sparse_at_end(e);e = mod2sparse_next_in_col(e))    { 
	  e->pr = pr;      pr *= e->lr;    }    /*
	if (isnan(pr))    { 
		pr = 1;    }
    */    if (bprb) bprb[j] = 1 - 1/(1+pr);    dblk[j] = pr>=1;    pr = 1;    for (e = mod2sparse_last_in_col(H,j); !mod2sparse_at_end(e); e = mod2sparse_prev_in_col(e))    { 
	  e->pr *= pr;      /* 
	  if (isnan(e->pr))       { 
		  e->pr = 1;      }
	  */      pr *= e->lr;    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品黑人一区二区三区久久| 久久久久9999亚洲精品| 国产一区视频在线看| 亚洲欧洲日韩综合一区二区| 欧美日韩国产高清一区| 国产91在线观看| 日韩av高清在线观看| 亚洲丝袜制服诱惑| 久久久精品天堂| 91麻豆精品国产无毒不卡在线观看 | 91小宝寻花一区二区三区| 精品制服美女丁香| 午夜精品久久久久久久久久 | 久久综合九色综合久久久精品综合| 日本久久电影网| 国产精品亚洲а∨天堂免在线| 亚洲成人自拍偷拍| 亚洲免费av网站| 日本一区二区成人| 欧美精品一区二区三区蜜桃| 911精品产国品一二三产区| 91丨porny丨最新| 成人爱爱电影网址| 高清不卡在线观看| 国产一区二区在线看| 美腿丝袜在线亚洲一区| 日韩高清不卡在线| 亚洲一区免费在线观看| 一区二区三区四区五区视频在线观看| 国产女同互慰高潮91漫画| 欧美精品一区二区蜜臀亚洲| 欧美成人a∨高清免费观看| 日韩三级视频在线观看| 7777精品伊人久久久大香线蕉超级流畅 | 久久理论电影网| 337p日本欧洲亚洲大胆色噜噜| 91精品国产综合久久精品麻豆| 欧美日韩免费在线视频| 欧美日本韩国一区二区三区视频| 在线免费观看日韩欧美| 在线亚洲人成电影网站色www| 99精品久久99久久久久| 色综合天天综合| 91精彩视频在线| 欧美日韩一区高清| 91精品国产乱| 精品国产一二三| 欧美国产精品劲爆| 亚洲视频你懂的| 亚洲在线一区二区三区| 天天av天天翘天天综合网色鬼国产| 水野朝阳av一区二区三区| 日韩中文字幕不卡| 极品少妇xxxx精品少妇偷拍| 国产黄色精品网站| 91免费看`日韩一区二区| 欧洲av一区二区嗯嗯嗯啊| 欧美日韩的一区二区| 欧美一区二区日韩一区二区| 精品久久久久久综合日本欧美| 久久久久国产精品麻豆| 国产精品国产三级国产有无不卡| 亚洲精品免费一二三区| 午夜成人在线视频| 韩国av一区二区| 99r国产精品| 欧美视频日韩视频在线观看| 日韩视频一区在线观看| 国产精品久久久久婷婷| 亚洲国产日韩一区二区| 狠狠色丁香久久婷婷综合丁香| 高清国产一区二区三区| 欧美视频一区二区| 久久久精品欧美丰满| 亚洲三级在线播放| 美国三级日本三级久久99| 成人黄色在线网站| 欧美精品一卡两卡| 国产精品全国免费观看高清| 亚洲一区二区三区中文字幕| 精品在线亚洲视频| 在线视频欧美区| 久久综合久久综合久久| 亚洲精品国产成人久久av盗摄| 免费观看日韩电影| av在线不卡免费看| 日韩欧美一区电影| 一卡二卡欧美日韩| 国产高清亚洲一区| 欧美精品自拍偷拍动漫精品| 欧美极品美女视频| 日韩av一区二区三区四区| 99久久精品国产一区二区三区| 51精品久久久久久久蜜臀| 国产精品久久毛片a| 麻豆久久久久久| 欧美日韩一区小说| 国产精品久线观看视频| 激情综合网av| 欧美精品日韩精品| 一区二区三区在线看| 国产精品77777| 欧美大片免费久久精品三p| 亚洲一线二线三线视频| 国产精品白丝av| 日韩精品一区二区三区视频| 亚洲一本大道在线| 91丨porny丨最新| 国产精品伦一区| 狠狠色丁香婷婷综合久久片| 337p亚洲精品色噜噜| 亚洲国产综合视频在线观看| 成人国产精品视频| 久久久精品国产免费观看同学| 美国十次了思思久久精品导航| 欧美日韩小视频| 一区二区三区国产豹纹内裤在线| 成人精品gif动图一区| 久久久蜜臀国产一区二区| 香蕉加勒比综合久久| 在线精品亚洲一区二区不卡| 亚洲欧洲精品一区二区三区| 成人免费高清视频| 欧美极品美女视频| 懂色一区二区三区免费观看| 久久亚洲捆绑美女| 黄色日韩网站视频| 日韩精品一区二区三区在线 | 亚洲精品你懂的| 91在线观看高清| 综合电影一区二区三区| 波多野结衣中文字幕一区| 国产精品久久毛片av大全日韩| 国模冰冰炮一区二区| 亚洲精品在线免费播放| 国产在线精品国自产拍免费| 久久久亚洲国产美女国产盗摄| 韩国在线一区二区| 国产欧美一区二区三区在线看蜜臀 | 精品污污网站免费看| 亚洲成av人片一区二区梦乃 | 色偷偷久久一区二区三区| 日韩va欧美va亚洲va久久| 91精品综合久久久久久| 免费成人av在线播放| 精品久久久久久无| 国产成人精品综合在线观看| 中文成人综合网| 色中色一区二区| 亚洲综合小说图片| 欧美精品三级在线观看| 美国一区二区三区在线播放| 久久久久久久性| 91小视频免费看| 午夜精品视频一区| 欧美精品一区二区精品网| 国产成人av影院| 亚洲欧美区自拍先锋| 欧美浪妇xxxx高跟鞋交| 国产在线国偷精品免费看| 亚洲欧洲在线观看av| 欧美日韩美少妇| 国产美女精品在线| 中文字幕色av一区二区三区| 色婷婷激情久久| 麻豆精品一区二区综合av| 国产精品欧美久久久久一区二区| 在线中文字幕一区二区| 肉丝袜脚交视频一区二区| 精品国产电影一区二区| 色综合色狠狠天天综合色| 奇米色777欧美一区二区| 国产精品视频看| 欧美日韩一区高清| 国产高清成人在线| 亚洲最新视频在线观看| 日韩一级二级三级精品视频| www.亚洲人| 裸体一区二区三区| 亚洲欧美在线aaa| 日韩欧美国产综合| 97久久久精品综合88久久| 另类欧美日韩国产在线| 亚洲人成网站影音先锋播放| 日韩欧美在线一区二区三区| 91免费观看国产| 国产老肥熟一区二区三区| 亚洲国产综合91精品麻豆| 亚洲国产激情av| 日韩精品中午字幕| 欧美性受xxxx| 国产成人亚洲综合色影视| 舔着乳尖日韩一区| 18欧美乱大交hd1984| 精品国精品自拍自在线| 欧美色电影在线| 一本大道综合伊人精品热热| 国产精品一区免费视频| 欧美aaaaaa午夜精品| 亚洲一区二区在线免费看|