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

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

?? compression4.cpp

?? 對流數(shù)據(jù)的壓縮
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// compression4.cpp : Defines the entry point for the console application.

//this is an improved method of the lilei's dictionary-based test data compression.
//but we compress the test data from two directions.
//firstly we compress the test data vertically, and then we compress them from crosswise.
//the main algorithms refer to lilei's dictionary-based test data compression method.

#include "stdafx.h"
#include "iostream.h"
#include "stdio.h"
#include "math.h"

int main(int argc, char* argv[])
{
	char sourcename[35];  //filename for input
	char destinationname[35]; //filename for output(related information)
	char resultname[35];//filename for result
    int width = 0; // the width of test patterns
    int number = 0; // the number of test patterns
    int m=0; //the number of the scan chains
	FILE *fpp,*fp,*fr; //the point of the input file and the output file

//open the file
    cout << "Filename input:";
    cin >> sourcename;
	fpp=fopen(sourcename,"r");
	if (!fpp)
	{
		cout << sourcename << " could not be opened" << endl;
		return 1;
	}  
    cout << "Filename output:";
    cin >> destinationname;
    fp=fopen(destinationname,"w");
    if (!fp)
    {
	     cout<< destinationname << "not created" << endl;
         return 1;
	}
	cout << "Filename for result:";
    cin >> resultname;
    fr=fopen(resultname,"w");
    if (!fr)
    {
	     cout<< resultname << "not created" << endl;
         return 1;
	}
       
//read the width and the number of the patterns
	fscanf(fpp,"%d", &width);
    if (width==0)
    {
         cout << "no patterns!";
         return 1;
    }
    fscanf(fpp,"%d", &number);
	
//read the number of the scan chains
    cout << "please input the number of the scan chains m(<width):";
    cin >> m;
    fprintf(fp,"%s","the number of the scan chains m:");
    fprintf(fp,"%d\n",m);
	fprintf(fp,"%s\n","");


//read the original patterns
    char *patterns=new char[width*number]; //the array for the original patterns
    char *ptemp; //the point of the array patterns
    int l; //the length of the subvectors
    int fcare=0; 
    int i,j,k,t,tp1;
    int wfmp; //the width of the formatted test data
    ptemp=patterns;
   

    while(!feof(fpp))
    {
	    fscanf(fpp,"%c",ptemp);
        if(*ptemp!='\n') ptemp++;
    }
    fclose(fpp);

//output the array patterns for checking
	fprintf(fp,"%s\n","the test patterns:");
	for ( i=0;i<number;i++ )
	{
		for ( j=0;j<width;j++ )
			fprintf(fp,"%c",patterns[i*width+j]);
		fprintf(fp,"%s\n","");
	}
	fprintf(fp,"%s\n","");


//rebuild the array of the test patterns formatted for multiple scan chains
   
//calculate l first
    if ( width%m==0 )  l=width/m;
    else  
    {   
	    l=width/m+1;
	    fcare=1;//here the flag show whether need or not to pad the don't care in the end.if fcare=1,it means needing
    }

//then format the test patterns and process the patterns one by one 
    t=0;
    wfmp=number*l;
    char *fmatpat=new char[wfmp*m];//the array for the formatted test data
	char *tfmat=new char[wfmp*m];

    tp1=width/l;
	if ( fcare==0 )
	{
		 for ( i=0;i<number;i++ )
		 {
			  for ( j=0;j<m;j++ )
			      for ( k=0;k<l;k++ )
				  {
			            fmatpat[j*wfmp+(k+i*l)]=patterns[t];
			            t++;
				  }
		 }
	}
	else
	{
		for ( i=0;i<number;i++ )
		{
		    for ( j=0;j<tp1;j++ )
		        for ( k=0;k<l;k++ )
				{
			         fmatpat[j*wfmp+(k+i*l)]=patterns[t];
			         t++;
				}
		    for ( k=0;k<(width-tp1*l);k++ )
			{
			    fmatpat[j*wfmp+(k+i*l)]=patterns[t];
			    t++;
			}
		    for ( k=(width-tp1*l);k<l;k++ )
			    fmatpat[j*wfmp+(k+i*l)]='-';
		    for ( j=tp1+1;j<m;j++ ) //do while l<m
			    for ( k=0;k<l;k++ )
					fmatpat[j*wfmp+(k+i*l)]='-';
		}
	}
  

//output the array fmatpat for checking
	fprintf(fp,"%s\n","the formatted pattern:");
	for ( i=0;i<m;i++ )
	{
		for ( j=0;j<wfmp;j++ )
			fprintf(fp,"%c",fmatpat[i*wfmp+j]);
		fprintf(fp,"%s\n","");
	}
	fprintf(fp,"%s\n","");
   

//find the compatible cliques among rows
//this is the first time to look for the compatible cliques
//the results we need are the positions of the shanchu lines and the compatible array in which the compatible patterns have been deleted
   
   int *scl=new int[m];//the temp array used to save the original position value
   int *tscl=new int[m];//the temp array usd to save the changed position value
   int *graphg=new int[m*m]; //the graph G for the compatible matrix of the famatted data
   int *gg=new int[m*m];//G'
   int *tgg=new int[m*m];//temp G'
   int *ncomp=new int[m];//the degree of every vertex
   int *rcomp=new int[m];//show the compatible relationship
   int fcomp; 
   int t1,t2,tmax;
   int tm;//the number of the vectors in the array in which the compatible patterns have been deleted
   int pgg1,pgg2;
   int temp=0;

//set up the compatible matrix G
//if the two patterns are compatible,the corresponding position in the matrix equals 1;otherwise 0.
//we think the pattern is not compatible to itself

   for ( i=0;i<m;i++ )
   {
	   for ( j=0;j<m;j++ )
	   {
		   fcomp=0;//the flag of the compatible;here if fcomp=1;it means the patterns are not compatible
		   k=0;
		   while ( k<wfmp )
		   {
			   if (((fmatpat[i*wfmp+k]=='0')||(fmatpat[i*wfmp+k]=='1'))&&((fmatpat[j*wfmp+k]=='0')||(fmatpat[j*wfmp+k]=='1')))
			   {
				   if (fmatpat[i*wfmp+k]==fmatpat[j*wfmp+k])  k++;
				   else
				   {
					   graphg[i*m+j]=0;
					   fcomp=1;
					   break;
				   }
			   }
			   else k++;
		   }
		   if ((fcomp==0)&&(i!=j))
		   {
			   graphg[i*m+j]=1;
			   temp++;//the total number of the compatible relationship
		   }
		   if (i==j) graphg[i*m+j]=0;
	   }
   }

//output graph G for checking
   fprintf(fp,"%s\n","the compatible matrix G:");
   for ( i=0;i<m;i++ )
   {
	   for ( j=0;j<m;j++ )
		   fprintf(fp,"%d",graphg[i*m+j]);
	   fprintf(fp,"%s\n","");
   }
   fprintf(fp,"%s\n","");


//greedy algorithm.

//the first cycle is used to confirm the group of compatible vectors
//cycle one time comfirms a group of compatible vectors
//here we will output the positions of the compatible vectors(the positions of the shanchu lines)
   
   fprintf(fp,"%s\n","the positions of the shanchu lines:");
   fcomp=0;//count the number of the groups of the compatible vectors    
   while(temp!=0)
   {
	   for ( i=0;i<(m*m);i++ )
	       gg[i]=graphg[i];
           pgg2=m;
	   for ( i=0;i<m;i++ )
	       scl[i]=i;
	   fcomp++;
	   do
	   {
            for ( i=0;i<pgg2;i++ )
				ncomp[i]=0;
			for ( i=0;i<pgg2;i++ )
				for ( j=0;j<pgg2;j++ )
				{
					if( gg[i*pgg2+j]==1)
						ncomp[i]++;
				}
		    t2=ncomp[0];
            tmax=0;
            for( t1=1;t1<pgg2;t1++ )
			{
	            if( t2<ncomp[t1] )
				{
		            t2=ncomp[t1];
		            tmax=t1;
				}
			}
			t=scl[tmax];//the position of the vector in graphg
			fprintf(fp,"%d ",t);//output the position of the shanchu line
			rcomp[t]=fcomp;//the compatible vectors have the same value in the corresponding positions in the array rcomp.this can be used later.
			for ( i=0;i<m;i++ )
			{
				if(graphg[i*m+t]==1)
				{
					graphg[i*m+t]=0;
					temp--;
				}
				if(graphg[t*m+i]==1)
				{
					graphg[t*m+i]=0;
					temp--;
				}
			}
			pgg1=pgg2;
			pgg2=0;
			for ( i=0;i<pgg1;i++ )
			{
				if( gg[tmax*pgg1+i]==1 )
				{
					tscl[pgg2]=i;
					pgg2++;
				}
			}
			for ( i=0;i<pgg2;i++ )
			{
				t1=tscl[i];
				scl[i]=scl[t1];//t1 increases progressively
				for ( j=0;j<pgg2;j++ )
				{
					t2=tscl[j];
					tgg[i*pgg2+j]=gg[t1*pgg1+t2];
				}
					
			}
			for ( i=0;i<(pgg2*pgg2);i++ )
					gg[i]=tgg[i];			

	   }while(pgg2!=0);
	   
	   fprintf(fp,"%s\n","");
   }
   fprintf(fp,"%s\n","");
   
   delete[]graphg;
   delete[]gg;
   delete[]tgg;
   delete[]ncomp;
   delete[]scl;


//rebuild the array in which the compatible vectors have been deleted
   for ( i=1;i<=fcomp;i++ )
   {
	   t=0;
	   t1=0;
//the compatible vectors belong to same group resave to the array tfmat in order to process easily
	   for ( j=0;j<m;j++ )
	   {
		   if ( rcomp[j]==i )
		   {
			   for ( k=0;k<wfmp;k++ )
			   {
				   tfmat[t]=fmatpat[j*wfmp+k];
				   t++;
			   }
			   tscl[t1]=j;
			   t1++;//the size of the group of the compatible patterns
		   }
	   }

//specify the bits that can be specified
	   for ( j=0;j<wfmp;j++ )
	   {
		   k=0;
		   while ( k<t1 )
		   {
			   if( tfmat[k*wfmp+j]=='-') k++;
			   else
			   {
				   tfmat[j]=tfmat[k*wfmp+j];
				   break;
			   }
		   }

	   }
//rewrite the specified patterns to the first appeared vector in the original formatted array 
//char 2 is rewited to the first cells of the other patterns

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲第一成年网| 日韩写真欧美这视频| 久久综合网色—综合色88| 亚洲444eee在线观看| 大胆亚洲人体视频| 久久这里都是精品| 麻豆91精品视频| 欧美一级xxx| 日本va欧美va精品| 欧美裸体一区二区三区| 亚洲一区二区在线观看视频 | 香蕉久久一区二区不卡无毒影院| av在线播放成人| 国产精品国产馆在线真实露脸| 国产成人午夜视频| 久久久www成人免费无遮挡大片 | 日韩一区二区三区电影在线观看| 自拍偷拍亚洲综合| 色呦呦一区二区三区| 成人av电影免费观看| 国产精品久久二区二区| 91丨九色丨尤物| 亚洲欧美日韩电影| 欧美中文字幕一二三区视频| 亚洲一区二区中文在线| 欧美午夜在线一二页| 午夜久久久久久电影| 欧美精品乱人伦久久久久久| 一区二区理论电影在线观看| 在线播放中文字幕一区| 久久精品72免费观看| 国产清纯在线一区二区www| 国产99久久精品| 亚洲人吸女人奶水| 欧美中文字幕一二三区视频| 麻豆一区二区99久久久久| 欧美一级日韩不卡播放免费| 精东粉嫩av免费一区二区三区| 国产亚洲一区二区三区四区| 国产一区福利在线| 亚洲柠檬福利资源导航| 日韩欧美亚洲国产另类| 国产91色综合久久免费分享| 亚洲天堂精品在线观看| 欧美日韩免费一区二区三区| 久久99久久精品欧美| 国产精品久久久久影院| 欧美色倩网站大全免费| 国产剧情在线观看一区二区| 国产精品国产三级国产有无不卡| 欧美日韩日日夜夜| 国产精品一二三在| 中文字幕免费在线观看视频一区| 在线观看一区日韩| 国产美女主播视频一区| 洋洋成人永久网站入口| 欧美一卡二卡三卡| 91在线码无精品| 精品一区二区三区久久久| 中文字幕一区日韩精品欧美| 欧美一级国产精品| 99国产欧美另类久久久精品 | 91网站在线播放| 国产自产高清不卡| 亚洲一区二区三区中文字幕在线| 久久综合九色综合97婷婷| 欧洲亚洲国产日韩| 不卡欧美aaaaa| 国内一区二区在线| 日本伊人精品一区二区三区观看方式| 中文字幕一区免费在线观看| ww久久中文字幕| 一本久久综合亚洲鲁鲁五月天 | 亚洲自拍偷拍九九九| 日本一区二区三区四区| 欧美日韩色一区| 成人国产亚洲欧美成人综合网 | 欧美性生活影院| 国产91对白在线观看九色| 免费看欧美美女黄的网站| 一区二区三区在线视频免费观看| 日本一区二区视频在线观看| 精品国产伦理网| 精品入口麻豆88视频| 欧美一区二区在线观看| 欧美网站大全在线观看| 91欧美激情一区二区三区成人| 国产美女精品一区二区三区| 久久国产生活片100| 亚洲午夜私人影院| 一区二区三区成人在线视频| 中文字幕亚洲不卡| 国产精品黄色在线观看| 国产精品乱码一区二区三区软件| 久久青草欧美一区二区三区| 欧美日韩亚洲综合在线| 欧美性受极品xxxx喷水| 欧美日韩一区精品| 欧美午夜寂寞影院| 欧美视频一区二区在线观看| 欧美丝袜丝nylons| 亚洲同性同志一二三专区| 亚洲日本在线天堂| 亚洲欧美日韩在线播放| 亚洲精品视频在线看| 日韩毛片高清在线播放| 亚洲欧美成aⅴ人在线观看| ...xxx性欧美| 一区二区三区四区亚洲| 夜夜嗨av一区二区三区四季av| 亚洲自拍都市欧美小说| 亚洲精品欧美专区| 亚洲欧美一区二区不卡| 亚洲已满18点击进入久久| 天天综合天天做天天综合| 日本不卡视频在线观看| 男女激情视频一区| 国产成人亚洲综合色影视| 成人福利视频在线看| aa级大片欧美| 欧美亚洲高清一区二区三区不卡| 欧美二区在线观看| 日韩你懂的在线观看| 国产人成亚洲第一网站在线播放| 国产精品成人免费精品自在线观看 | 国产精品九色蝌蚪自拍| 一区二区三区四区不卡视频| 日本女人一区二区三区| 亚洲国产日韩精品| 国产一区二区三区蝌蚪| av在线免费不卡| 欧美肥胖老妇做爰| 日本一区二区免费在线| 亚洲一区二区三区四区中文字幕| 丝袜美腿亚洲色图| 丰满少妇在线播放bd日韩电影| 不卡一区在线观看| 欧美日韩一区二区三区在线| 久久久久久久久久看片| 亚洲伦在线观看| 日本特黄久久久高潮| 91丨九色porny丨蝌蚪| 久久免费视频色| 日韩高清国产一区在线| 色8久久人人97超碰香蕉987| 久久综合九色综合欧美就去吻| 亚洲成av人片在线观看无码| 99久久夜色精品国产网站| 精品99久久久久久| 蜜臀久久99精品久久久久久9| 色老综合老女人久久久| 中文字幕一区免费在线观看| 国产成人亚洲综合a∨婷婷图片| 欧美成人精品1314www| 五月天久久比比资源色| 色欧美日韩亚洲| 国产精品久久久久久妇女6080 | 亚洲国产综合在线| 99精品欧美一区二区蜜桃免费| 久久综合色8888| 久久草av在线| 日韩午夜在线观看视频| 亚洲成人在线免费| 欧美性色aⅴ视频一区日韩精品| 成人免费小视频| 成人精品免费网站| 国产精品天干天干在线综合| 国产黄色成人av| 国产亚洲成av人在线观看导航| 久久se这里有精品| 午夜av电影一区| 欧美在线观看一区二区| 玉足女爽爽91| 欧美性感一类影片在线播放| 亚洲国产精品一区二区久久| 欧美色图免费看| 午夜成人免费视频| 欧美一区日韩一区| 精品一区二区三区香蕉蜜桃| 久久久久久久网| 国产v日产∨综合v精品视频| 国产精品私房写真福利视频| 波多野结衣亚洲| 亚洲免费在线观看视频| 欧美探花视频资源| 日韩电影在线看| 久久这里只有精品首页| 国产91对白在线观看九色| 中文字幕亚洲不卡| 欧美私人免费视频| 麻豆成人综合网| 国产精品乱码妇女bbbb| 91亚洲国产成人精品一区二三| 一区二区三区四区在线播放| 欧美一级日韩一级| 国产91在线观看| 亚洲高清免费观看高清完整版在线观看 | 中文字幕一区二区三区视频| 色婷婷久久久久swag精品| 亚洲成人免费在线|