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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? compression11.cpp

?? 對(duì)流數(shù)據(jù)的壓縮
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
	    t1=0;
	    for ( j=0;j<number;j++ )
		{
		    if ( rcomp[j]==i )
			{
			    for ( k=0;k<width;k++ )
				{
				    temp1[t]=patterns[j*width+k];
				    t++;
				}
			    temp2[t1]=j;
			    t1++;   //the size of the clique
		   }
	   }

	   for ( j=0;j<width;j++ )
	   {
		   k=0;
		   while ( k<t1 )
		   {
			   if( temp1[k*width+j]=='-') k++;
			   else
			   {
				   temp1[j]=temp1[k*width+j];
				   break;
			   }
		   }
	   }

	   t=temp2[0];
	   for ( j=0;j<width;j++ )
	   {
		   patterns[t*width+j]=temp1[j];
	   }
	   for ( j=1;j<t1;j++ )
	   {
		   t=temp2[j];
		   patterns[t*width]='2';
	   }
   }
 
   i=1;
   for ( j=1;j<number;j++ )
   {
	   if( patterns[j*width]!='2' ) 
	   {
		   for ( k=0;k<width;k++ )
			   patterns[i*width+k]=patterns[j*width+k];
		   i++;
	   }
   }

   delete[]temp1;
   delete[]temp2;

   return i;
}




//*******************function rowcompalg***********************


//this function transfer allocate three functions above to complete the first compression.
//the meaning of the function's parameters as follows:
//      f--the point of the file to output the information
//      patterns--the test patterns will be compressed
//      width,number--the width and the number of the patterns
//this function will return the number of patterns after compatible processing


int rowcompalg(FILE *f,char *patterns,int width,int number)
{
    int *graphg=new int[number*number];    //the graph G for the compatible matrix 
    int *rcomp=new int[number];            //show the compatible relationship 
    int tm;                                //the number of the vectors in the array in which the compatible vectors have been deleted
    int temp=0;

	if(graphg==NULL)   cout<<"allocate error0"<<endl;

	temp=compgraphset(patterns,graphg,width,number);
    temp=maxcliquegreedy(f,graphg,rcomp,number,temp);//greedy algorithm.
    tm=comppatdelete(patterns,rcomp,width,number,temp);
/*	fprintf(f,"%s\n","the fmatpat after compatible processing: ");
	matrixoutput(f,patterns,width,tm);*/

	delete[]graphg;
    delete[]rcomp; 
	return tm;
}





//*******************function matrixoutput***********************


//this function will output a heap(array) in form of matrix
//the meaning of the function's parameters as follows:
//      f--the file for output
//      patterns--the test patterns will be output
//      width,number--the width and the number of the patterns(matrix)


void matrixoutput(FILE *f,char *patterns,int width,int number)
{
	
	int i,j;
    for ( i=0;i<number;i++ )
    {
	    for ( j=0;j<width;j++ )
		    fprintf(f,"%c",patterns[i*width+j]);
	    fprintf(f,"%s\n","");
    }
    fprintf(f,"%s\n","");
   
}





//*******************function distgraphset***********************


//this function set up the distance graph of the patterns
//the distance between two patterns equals the number of the uncompatible bits
//and we think the distance between a pattern to itself is maxdistance+1(infinite).here it is width+1.
//the meaning of the function's parameters as follows:
//      patterns--the test patterns will be checked
//      graphg--the distance graph
//      width,number--the width and the number of the patterns


void distgraphset(char *patterns,int *graphg,int width,int number)
{
	    
	int i,j,k,cn;
	for(i=0;i<number;i++)
		for(j=0;j<number;j++)
		{
			k=0;
		    cn=0;//the distance
		    while(k<width)
			{
				if((patterns[i*width+k]!='-')&&(patterns[i*width+k]!='-'))			
				{
					if(patterns[i*width+k]==patterns[j*width+k])
						k++;
				    else
					{
						cn++;
					    k++;
					}
				}
			    else k++;
		   
			}
		    graphg[i*number+j]=cn;
		    if(i==j)
				graphg[i*number+j]=width+1;
		}
}





//********************function patternsort***********************


//this function will sort the patterns in order to make the sum of the distances of the patterns adjoined as small as possible
//this is a greedy algorithm
//we begin from the first pattern,and find the pattern which has the shortest distance to the first pattern.
//then begin from this new pattern to find the next pattern and just one by one as this
//the meaning of the function's parameters as follows:
//      patterns--the test patterns need be be sorted
//      temp--the heap room to save the sorted patterns
//      graphg--the distance graph
//      width,number--the width and the number of the patterns


void patternsort(char *patterns,char *temp,int *graphg,int width,int number)
{
	int i,j,k,t=0;
	int p=0;
    do
	{
		for(i=0;i<width;i++)
		{
			temp[t]=patterns[p*width+i];
		    t++;
		}
	    for(i=0;i<number;i++)
			graphg[i*number+p]=width+1;
	    j=graphg[p*number];
	    for(i=0;i<number;i++)
		{
			if(j>graphg[p*number+i])
			{
				j=graphg[p*number+i];
			    k=i;
			}
		}
	    p=k;

	}while(j<width+1);
}





//*******************function firstpattern**********************


//this function will confirm the first pattern as compared standard
//of course,it will be changed as the compare goes on.
//the first pattern is consisted of the first specified bit of every column of test set
//if there is not specified bit,we will pad '0'.
//the meaning of the function's parameters as follows:
//      patterns--the test patterns will be checked
//      temp--the heap room to save the first pattern
//      width,number--the width and the number of the patterns(matrix)


void firstpattern(char *patterns,char *temp,int width,int number)
{
	int i,j;   
	for(i=0;i<width;i++)
    {
		j=0;
	    temp[i]='0';
        while(j<number)
		{
			if((patterns[j*width+i]=='0')||(patterns[j*width+i]=='1'))
			{
				temp[i]=patterns[j*width+i];
		        j++;
		        break;
			}
	        else j++;
		}
	}
}





//*******************function maxdistfind************************


//this function is used to find the maximum of the distances between the sorted patterns
//it scans the whole test set
//the meaning of the function's parameters as follows:
//      patterns--the test patterns will be checked
//      first--the first(standard) pattern
//      width,number--the width and the number of the patterns(matrix)


int maxdistfind(char *patterns,char *first,int width,int number)
{
	int i,j,k,max=0;
	char *temp=new char[width];
	
	for (i=0;i<width;i++)
		temp[i]=first[i];

    for(i=1;i<number;i++)
    {
		j=0;
		k=0;
	    while(j<width)
		{
			if((patterns[i*width+j]=='0')||(patterns[i*width+j]=='1'))
			{
				if(patterns[i*width+j]==temp[j]) j++;
	            else
				{
					temp[j]=patterns[i*width+j];
					k++;
	                j++;
				}
			}
	        else j++;
	
		}
		if(max<k)    max=k;
	}
	delete[]temp;
	return max;
}




//*******************function log2upl**********************


//this small function is used to gain the upper limit of log2(x)


int log2upl(int x)
{
	int y;
	if ((log10(x)/log10(2))==int((log10(x)/log10(2))))
		y=int((log10(x)/log10(2)));
    else
		y=int((log10(x)/log10(2)))+1;
	return y;

}





//*******************function positioncao************************


//this function completes the compare and output of the position
//in every row of output file
//first we output the number(fixed-length1(dmax)) of the different position
//then we output the different position values(fixed-length2(lmax))
//the meaning of the function's parameters as follows:
//      f--the file for output
//      patterns--the test patterns will be checked
//      temp--the first(standard) pattern
//      width,number--the width and the number of the patterns(matrix)
//      dmax--the length of the number of the different position
//      lmax--the length of the different position values
//this function will return the total number(bits) for output 
 

int positioncao(FILE *f,char *patterns,char *temp,int width,int number,int dmax,int lmax)
{

	int i,j,k,cn,p,q,p1,total=0;
	int *temp1=new int[width];
	for(i=1;i<number;i++)
    {
		j=0;
		k=0;
		cn=0;
	    while(j<width)
		{
			if((patterns[i*width+j]=='0')||(patterns[i*width+j]=='1'))
			{
				if(patterns[i*width+j]==temp[j]) j++;
	            else
				{
					temp[j]=patterns[i*width+j];
	                temp1[k]=j;
					k++;
					cn++;
	                j++;
				}
			}
	        else j++;
	
		}
   	    for(j=(dmax-1);j>=0;j--)
		{
			p=int(cn/pow(2,j));
			fprintf(f,"%d",p);
			total++;
			cn=cn-p*int(pow(2,j));
		}//output the number
		for(q=0;q<k;q++)
		{
			p1=temp1[q];
			for(j=(lmax-1);j>=0;j--)
			{
				p=int(p1/pow(2,j));
			    fprintf(f,"%d",p);
			    total++;
			    p1=p1-p*int(pow(2,j));
			}
		}//output the position
		fprintf(f,"%s\n","");
	}
	return total;
}





//******************function positionmarkalg********************


//this function transfer allocate six functions above to complete the second compression.
//the meaning of the function's parameters as follows:
//      f1--the point of the file to output the information
//      f2--the point of the file to output the result
//      patterns--the test patterns will be compressed
//      width,number--the width and the number of the patterns
//this function will return the total number(bits) of compressed test set except the first pattern



int positionmarkalg(FILE *f1,FILE *f2,char *patterns,int width,int number)
{

	int smax=0;                  //the length of the maximal number of the different positions  
	int lmax=0;                  //the length of the position value
    char *temp2=new char[width]; //a pattern consisted of the first specified value of every column;otherwise pad 0.
    int *temp1=new int[number*number];
	char *temp=new char[width*number];
	int i;

	if(temp2==NULL) cout<<"allocate error3"<<endl;
	if(temp1==NULL) cout<<"allocate error4"<<endl;
	if(temp==NULL) cout<<"allocate error5"<<endl;

	distgraphset(patterns,temp1,width,number);
	patternsort(patterns,temp,temp1,width,number);

	firstpattern(temp,temp2,width,number);
	matrixoutput(f2,temp2,width,1);

	smax=maxdistfind(temp,temp2,width,number);
	fprintf(f1,"%s","the number of the changed bits in every pattern: ");
	fprintf(f1,"%d\n",smax);
	fprintf(f1,"%s\n","");
	
	smax=int((log10(smax)/log10(2)))+1;
	fprintf(f1,"%s","the length of the number value of the changed bits in every pattern: ");
	fprintf(f1,"%d\n",smax);
	fprintf(f1,"%s\n","");

	lmax=log2upl(width);
	fprintf(f1,"%s","the length of the position value: ");
	fprintf(f1,"%d\n",lmax);
	fprintf(f1,"%s\n","");

	i=positioncao(f2,temp,temp2,width,number,smax,lmax);

	delete[]temp;
	delete[]temp1;
	delete[]temp2;

	return i;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品综合在线| 国产精品动漫网站| 6080yy午夜一二三区久久| 91视频在线观看| 91在线国内视频| 91欧美一区二区| 91国内精品野花午夜精品| 91免费国产在线| 在线区一区二视频| 欧美日韩久久不卡| 日韩欧美亚洲一区二区| 日韩精品一区二区三区四区视频| 日韩欧美高清dvd碟片| 精品免费视频.| 久久精品一区二区三区av| 国产精品少妇自拍| 国产精品福利影院| 伊人开心综合网| 午夜影视日本亚洲欧洲精品| 日韩国产精品大片| 国产真实乱偷精品视频免| 国产乱人伦偷精品视频不卡| 国产不卡在线播放| 91国产免费看| 欧美一级欧美一级在线播放| 久久亚洲一级片| 亚洲欧洲国产日本综合| 亚洲国产日日夜夜| 久久成人久久爱| 成人sese在线| 欧美丰满少妇xxxxx高潮对白| 日韩一级黄色片| 国产女主播一区| 亚洲成人7777| 国产精品一品视频| 日本韩国视频一区二区| 欧美一区二区大片| 国产精品国产精品国产专区不蜜 | 精品日韩欧美在线| 国产精品乱子久久久久| 午夜精品久久久久久久久| 精品一区二区免费视频| 99免费精品在线观看| 欧美嫩在线观看| 欧美国产激情一区二区三区蜜月| 一区二区三区在线播放| 久久国产生活片100| 91无套直看片红桃| 日韩精品一区国产麻豆| 亚洲精品你懂的| 极品少妇xxxx精品少妇偷拍| 91美女片黄在线观看91美女| 精品久久久久久久久久久久久久久久久| 日本一区二区成人| 日韩在线播放一区二区| 成人激情视频网站| 欧美一区二区三区视频在线观看| 国产精品乱码妇女bbbb| 日韩精品久久理论片| 波多野结衣欧美| 日韩欧美三级在线| 亚洲一区二区三区四区五区黄| 国产一区不卡在线| 在线播放中文一区| 日韩毛片精品高清免费| 黄色精品一二区| 欧美日韩精品一区二区天天拍小说| 久久久不卡影院| 日本伊人精品一区二区三区观看方式| a亚洲天堂av| 久久久夜色精品亚洲| 日韩在线观看一区二区| 91黄色免费观看| 亚洲欧洲成人自拍| 国产成人日日夜夜| 欧美成人乱码一区二区三区| 亚洲h精品动漫在线观看| 成人黄动漫网站免费app| 欧美mv日韩mv亚洲| 午夜国产精品一区| 日本久久一区二区三区| 国产精品私人影院| 国产精品系列在线观看| 欧美成人乱码一区二区三区| 视频在线在亚洲| 欧美系列一区二区| 亚洲视频一二区| 福利91精品一区二区三区| 欧美成人精精品一区二区频| 天天操天天色综合| 在线观看一区日韩| 亚洲精品免费看| 色系网站成人免费| 中文字幕综合网| 99精品国产一区二区三区不卡| 久久久.com| 国产精品一卡二卡| 久久精品亚洲精品国产欧美kt∨| 毛片av中文字幕一区二区| 91精品国产综合久久精品app| 性欧美大战久久久久久久久| 欧美日韩一区国产| 亚洲高清不卡在线观看| 欧美亚男人的天堂| 亚洲成人免费电影| 欧美福利视频一区| 蜜臀av一级做a爰片久久| 91精品国产全国免费观看| 日韩精品成人一区二区三区| 欧美日韩的一区二区| 图片区小说区区亚洲影院| 9191精品国产综合久久久久久| 亚洲第一搞黄网站| 欧美一区中文字幕| 久久国产视频网| 国产亚洲欧美一区在线观看| 国产伦精品一区二区三区在线观看| 亚洲精品一区二区三区在线观看| 九色porny丨国产精品| 国产情人综合久久777777| 成人精品小蝌蚪| 一区二区三区91| 欧美区一区二区三区| 日本亚洲最大的色成网站www| 日韩丝袜美女视频| 国产精品1024| 亚洲欧美乱综合| 欧美电影一区二区| 狠狠色丁香婷综合久久| 国产欧美精品在线观看| 99re视频精品| 午夜视频一区二区三区| 精品欧美乱码久久久久久| 成人在线综合网站| 一区二区三区日本| 日韩免费成人网| 成人手机在线视频| 亚洲mv在线观看| 久久亚洲捆绑美女| 色综合中文字幕国产| 亚洲一区在线观看免费| 日韩女同互慰一区二区| 成人免费福利片| 午夜电影网一区| 国产色综合久久| 欧美体内she精高潮| 国产综合色产在线精品| 亚洲日本一区二区三区| 欧美一区二区三区四区在线观看| 国产福利91精品一区| 亚洲综合一二区| 久久久久久免费网| 欧美日韩国产美女| 国产成人av一区| 天天影视色香欲综合网老头| 国产精品你懂的| 日韩欧美一二三四区| 一本大道久久精品懂色aⅴ| 捆绑调教一区二区三区| 中文字幕人成不卡一区| 日韩免费电影一区| 91黄色免费网站| 国产不卡视频在线播放| 欧美aaa在线| 一区二区三区中文字幕精品精品| 欧美www视频| 欧美视频一区二区在线观看| 国产精品一区二区在线观看网站| 亚洲超碰97人人做人人爱| 国产精品色在线观看| 欧美电影免费提供在线观看| 在线观看日韩一区| 成人小视频免费观看| 另类小说视频一区二区| 亚洲老司机在线| 日韩激情中文字幕| 亚洲欧美一区二区久久| 久久久另类综合| 日韩欧美国产一区二区三区| 色婷婷久久一区二区三区麻豆| 精品一区二区三区在线观看| 午夜精品成人在线视频| 亚洲人精品一区| 国产精品免费看片| 久久影视一区二区| 日韩欧美精品在线视频| 欧美人xxxx| 欧美撒尿777hd撒尿| 99re热视频这里只精品| 成人激情校园春色| 国产69精品久久久久毛片| 韩国中文字幕2020精品| 日本aⅴ精品一区二区三区| 亚洲一区二区三区四区在线观看| 最新国产成人在线观看| 国产精品久99| 中日韩免费视频中文字幕| 久久久99久久| 欧美激情一区二区三区蜜桃视频 | 久久网这里都是精品|