📄 initialization.cpp
字号:
#include "parameter.h"
#include "head.h"
int **initialized(){
int **Hb,i,j;
int HI[M][N]={
{-1,94,73,-1,-1,-1,-1,-1,55,83,-1,-1, 7, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,27,-1,-1,-1,22,79, 9,-1,-1,-1,12,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,24,22,81,-1,33,-1,-1,-1, 0,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1},
{61,-1,47,-1,-1,-1,-1,-1,65,25,-1,-1,-1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,39,-1,-1,-1,84,-1,-1,41,72,-1,-1,-1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1,46,40,-1,82,-1,-1,-1,79, 0,-1,-1,-1,-1, 0, 0,-1,-1,-1,-1,-1},
{-1,-1,95,53,-1,-1,-1,-1,-1,14,18,-1,-1,-1,-1,-1,-1,-1, 0, 0,-1,-1,-1,-1},
{-1,11,73,-1,-1,-1, 2,-1,-1,51,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0,-1,-1,-1},
{12,-1,-1,-1,83,24,-1,43,-1,-1,-1,51,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0,-1,-1},
{-1,-1,-1,-1,-1,94,-1,59,-1,-1,70,72,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0,-1},
{-1,-1, 7,65,-1,-1,-1,-1,39,49,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0},
{43,-1,-1,-1,-1,66,-1,41,-1,-1,-1,26, 7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0}
};
/*
*rate 2/3 A code
*/
/*{
{ 3, 0,-1,-1, 2, 0,-1, 3, 7,-1, 1, 1,-1,-1,-1,-1, 1, 0,-1,-1,-1,-1,-1,-1},
{-1,-1, 1,-1,36,-1,-1,34,10,-1,-1,18, 2,-1, 3, 0,-1, 0, 0,-1,-1,-1,-1,-1},
{-1,-1,12, 2,-1,15,-1,40,-1, 3,-1,15,-1, 2,13,-1,-1,-1, 0, 0,-1,-1,-1,-1},
{-1,-1,19,24,-1, 3, 0,-1, 6,-1,17,-1,-1,-1, 8,39,-1,-1,-1, 0, 0,-1,-1,-1},
{20,-1, 6,-1,-1,10,29,-1,-1,28,-1,14,-1,38,-1,-1, 0,-1,-1,-1, 0, 0,-1,-1},
{-1,-1,10,-1,28,20,-1,-1, 8,-1,36,-1, 9,-1,21,45,-1,-1,-1,-1,-1, 0, 0,-1},
{35,25,-1,37,-1,21,-1,-1, 5,-1,-1, 0,-1, 4,20,-1,-1,-1,-1,-1,-1,-1, 0, 0},
{-1, 6, 6,-1,-1,-1, 4,-1,14,30,-1, 3,36,-1,14,-1, 1,-1,-1,-1,-1,-1,-1, 0}
}
*/
/*
*rate 2/3 B code
*/
/*{
{ 2,-1,19,-1,47,-1,48,-1,36,-1,82,-1,47,-1,15,-1,95, 0,-1,-1,-1,-1,-1,-1},
{-1,69,-1,88,-1,33,-1, 3,-1,16,-1,37,-1,40,-1,48,-1, 0, 0,-1,-1,-1,-1,-1},
{10,-1,86,-1,62,-1,28,-1,85,-1,16,-1,34,-1,73,-1,-1,-1, 0, 0,-1,-1,-1,-1},
{-1,28,-1,32,-1,81,-1,27,-1,88,-1, 5,-1,56,-1,37,-1,-1,-1, 0, 0,-1,-1,-1},
{23,-1,29,-1,15,-1,30,-1,66,-1,24,-1,50,-1,62,-1,-1,-1,-1,-1, 0, 0,-1,-1},
{-1,30,-1,65,-1,54,-1,14,-1, 0,-1,30,-1,74,-1, 0,-1,-1,-1,-1,-1, 0, 0,-1},
{32,-1, 0,-1,15,-1,56,-1,85,-1, 5,-1, 6,-1,52,-1, 0,-1,-1,-1,-1,-1, 0, 0},
{-1, 0,-1,47,-1,13,-1,61,-1,84,-1,55,-1,78,-1,41,95,-1,-1,-1,-1,-1,-1, 0}
}*/
/*
*rate 3/4 A code
*/
/*{
{ 6,38, 3,93,-1,-1,-1,30,70,-1,86,-1,37,38, 4,11,-1,46,48, 0,-1,-1,-1,-1},
{61,94,19,84,-1,92,78,-1,15,-1,-1,92,-1,45,24,32,30,-1,-1, 0, 0,-1,-1,-1},
{71,-1,55,-1,12,66,45,79,-1,78,-1,-1,10,-1,22,55,70,82,-1,-1, 0, 0,-1,-1},
{38,61,-1,66, 9,73,47,64,-1,39,61,43,-1,-1,-1,-1,95,32, 0,-1,-1, 0, 0,-1},
{-1,-1,-1,-1,32,52,55,80,95,22, 6,51,24,90,44,20,-1,-1,-1,-1,-1,-1, 0, 0},
{-1,63,31,88,20,-1,-1,-1, 6,40,56,16,71,53,-1,-1,27,26,48,-1,-1,-1,-1, 0}
}*/
/*
rate 3/4 B code
*/
/*{
{-1,81,-1,28,-1,-1,14,25,17,-1,-1,85,29,52,78,95,22,92, 0, 0,-1,-1,-1,-1},
{42,-1,14,68,32,-1,-1,-1,-1,70,43,11,36,40,33,57,38,24,-1, 0, 0,-1,-1,-1},
{-1,-1,20,-1,-1,63,39,-1,70,67,-1,38, 4,72,47,29,60, 5,80,-1, 0, 0,-1,-1},
{64, 2,-1,-1,63,-1,-1, 3,51,-1,81,15,94, 9,85,36,14,19,-1,-1,-1, 0, 0,-1},
{-1,53,60,80,-1,26,75,-1,-1,-1,-1,86,77, 1, 3,72,60,25,-1,-1,-1,-1, 0, 0},
{77,-1,-1,-1,15,28,-1,35,-1,72,30,68,85,84,26,64,11,89, 0,-1,-1,-1,-1, 0}
}*/
if ((Hb=(int **)calloc(M,sizeof(int *)))==NULL) {
printf("can not calloc the address\n");
exit(5);
}
for(i=0;i<M;i++)
if ((Hb[i]=(int *)calloc(N,sizeof(int *)))==NULL) {
printf("can not calloc the address\n");
exit(5);
}
for(i=0;i<M;i++){
for(j=0;j<N;j++){
Hb[i][j]=HI[i][j];
}
}
return Hb;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -