📄 rm.h
字号:
typedef struct { int N ; /* The length of the code is its chief defining property from which we deduce K,M, assuming it is a Hamming or RM code */ int M ; int K ; int I ; /* number of conceivable states 2^M-1 */ int *pint ; /* the parity matrix pint[1]..pint[N] expressed using integers */ /* for H systematic, pint[1]...[15] = 3,5,6,7,9,10,11,12,13,14,15,1,2,4,8 */ /* for H, pint[1]...[15] = 1,2,3,..13,14,15 */ /* for RM, pint[1]...[16] = 16+0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 */ unsigned char **p ; /* this is a place to write the bits explicitly if required */ int **v ; /* whether a state v[l][i] is a valid part of the trellis, and if so, which transitions it can make forward and backward (stored as f0 + 8f1 + 64b0 + 8^3 b1 ) */ int **nexti ; /* nexti[l][i] points to the next i in this column which is a valid trellis state; or zero when done */ double **q ; /* incoming likelihoods for each bit q[l][0/1] */ double **f ; double **b ; /* forward and backward probs f[l][i] */ double **r ; /* outgoing likelihoods */ double **po ; /* outgoing posteriors (added Tue 24/4/01) */ /* Wed 25/4/01 : */ /* in the KIKUCHI approach, we view the trellis state as a function of the imposed MARGINALS, which are the posterior probabilities */ /* we must adjust the q's so as to match these */ double *lq ; /* lagrange multipliers that define the incoming likelihoods */ double *pob ; /* required values for the posterior probabilities */ double *lpob ; /* required values for the logits */ double *lpo ; /* logit of outgoing posteriors */ unsigned char *xo ; /* a tentative codeword for testing against the trellis */ int computeS ; /* compute the entropy when running forward backward */ /* Mon 23/4/01 */ double S ; double ML ; /* marginal likelihood, also computed when we find the entropy */ double **Ef ; double **Eb ; /* forward and backward energies Ef[l][i] */ double **Sc ; /* entropy of rest of trellis conditional on being in this state */ double **Ec ; double **Scbit ; double **Sf ; double **Sb ; double *Srest ; /* entropy of rest of states */ double *dSdl ; /* derviative of entropy wrt lagrange multipliers */ double *dSdpo ; /* derviative of entropy wrt "posterior" */ double S1 ; /* special treatment for the very first bit: we note the entropy associated with its left-right transition for debugging purposes */ double fudge[10] ; /* used in the match routine */ /* idea: alternate between two reasonable values, rather than faffing about with adaptation! */ int fudgeperiod ; int T ;/* number of match iterations */ int verbose ; } linear_trellis ;void zero_linear_trellis ( linear_trellis *h ) ;void free_linear_trellis ( linear_trellis *h ) ;void make_linear_trellis ( linear_trellis *h , int NH , int type , int verbose ) ;void zero_energy_trellis ( linear_trellis *h ) ;void free_energy_trellis ( linear_trellis *h ) ;void make_energy_trellis ( linear_trellis *h ) ; void lt_zero_r ( linear_trellis *h ) ;void lt_fb ( linear_trellis *h ) ;void lt_match ( linear_trellis *h ) ;/* void lt_fbS ( linear_trellis *h ) ; Mon 23/4/01 */void lt_gnu ( linear_trellis *h, const char path[] ) ;int lt_syndrome ( linear_trellis *h ) ;double H2 ( double x ) ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -