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

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

?? compression12.cpp

?? 對流數據的壓縮
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// compression12.cpp : Defines the entry point for the console application.
//

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

void patternfmat(char *,char *,int,int,int);

int compgraphset(char *,int *,int,int);
int maxcliquegreedy(FILE *,int *,int *,int,int);
int comppatdelete(char *,int *,int,int,int);
int rowcompalg(FILE *,char *,int,int);//first compression

void matrixoutput(FILE *,char *,int,int);

//int alterrunlen(FILE *,char *,int);
//int shiftedfdr(FILE *,int);





//***********************main function*************************


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
	int l=0;                   //the length of the subvectors
    int wfmp=0;                //the width of the formatted test data
	int tm=0;                  //the number of the vectors in the array in which the compatible patterns have been deleted
	int nw=0;                  //the width of the new test patterns
	int total;                 //the size of the compressed test set
	int i,j;
	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);
	fprintf(fp,"%s","the width and number of test patterns : ");
    fprintf(fp,"%d ",width);
	fprintf(fp,"%d\n",number);
	fprintf(fp,"%s\n","it is hard to make a \n");

	
//read and output 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","");


//calculate l and wfmp

    if ( width%m==0 )    	l=width/m;
    else            		l=width/m+1;
    wfmp=number*l;



    char *patterns=new char[width*number];  //the heap for the original patterns
                                            //many times we use the heap as two dimensions array
    char *ptemp;                            //the point of the array patterns
	char *fmatpat=new char[wfmp*m];         //the heap for the formatted test data
	char *tfmat=new char[wfmp*m];           //temp fmatpat
    ptemp=patterns;

   
//read the original patterns

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

//first compression

	patternfmat(patterns,fmatpat,width,number,m);

    tm=rowcompalg(fp,fmatpat,wfmp,m);
    fprintf(fp,"%s ","the number of the vectors after the compatible vectors have been deleted:");
    fprintf(fp,"%d\n",tm);
    fprintf(fp,"%s\n","");


//rearrange the array fmatpat to tfmat(nw,number)

    for ( i=0;i<wfmp;i++ )
	    for ( j=0;j<tm;j++ )
		    tfmat[i*tm+j]=fmatpat[j*wfmp+i];

    nw=tm*l;        //the width of the tfmat,and also the length of the CSR
    fprintf(fp,"%s ","the length of the CSR (the width of the new patterns): ");
    fprintf(fp,"%d\n",nw);
    fprintf(fp,"%s\n","");
/*	fprintf(fp,"%s\n","the rearranged fmatpat:");
    matrixoutput(fp,tfmat,nw,number);*/

/*  
//second compression.process the new patterns and output the result using position-mark method
	
	total=alterrunlen(fr,tfmat,nw*number);
	delete[]tfmat;
	fprintf(fp,"%s","the total size of the compressed test set: ");
	fprintf(fp,"%d\n",total);
    
*/
//close the file

    fclose(fp);
	fclose(fr);

	return 0;


}



//**********************function patternfmat********************


//this function formats the test patterns according to the number of scan chains m
//the formatting details refer to lilei's dictionary-based test data compression
//the meaning of the function's parameters as follows:
//      patterns--the test patterns will be formatted
//      fmatpat--the heap room used to save the formatted test patterns
//      width,number--the width and the number of the patterns
//      m--the number of the scan chains


void patternfmat(char *patterns,char *fmatpat,int width,int number,int m)
{

	int i,j,k,p,l,t=0;
	int flag=0;  //here the flag show whether need or not to pad the don't care in the end.if flag=1,it means needing    
    int wfmp=0;  //the width of the fmatpat

	if ( width%m==0 )    l=width/m;
    else
	{
		l=width/m+1;
		flag=1;
	}
    wfmp=number*l;

	p=width/l;
	if ( flag==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<p;j++ )
		        for ( k=0;k<l;k++ )
				{
			         fmatpat[j*wfmp+(k+i*l)]=patterns[t];
			         t++;
				}
		    for ( k=0;k<(width-p*l);k++ )
			{
			    fmatpat[j*wfmp+(k+i*l)]=patterns[t];
			    t++;
			}
		    for ( k=(width-p*l);k<l;k++ )
			    fmatpat[j*wfmp+(k+i*l)]='-';
		    for ( j=p+1;j<m;j++ ) //do while width%m>l
			    for ( k=0;k<l;k++ )
					fmatpat[j*wfmp+(k+i*l)]='-';
		}
	}
}




//********************function compgraphset*********************


//this function sets up the compatible graph G of the test patterns
//if the two patterns are compatible,the corresponding position in the graph G equals 1;otherwise 0.
//we think the pattern is not compatible to itself
//the meaning of the function's parameters as follows:
//      patterns--the test patterns will be set up the compatible graph G
//      graphg--the heap room used to save the compatible graph G
//      width,number--the width and the number of the patterns
//this function will return the number of 1 in the graph G

//對分段后的測試集合建立圖g
int compgraphset(char *patterns,int *graphg,int width,int number)
{

	int i,j,k,flag;
    int total=0;
	
	for ( i=0;i<number;i++ )
    {
		for ( j=0;j<number;j++ )
		{
			flag=0;//the flag of the compatible;if flag=1;it means the patterns are not compatible
		    k=0;
		    while ( k<width )
			{
			    if ((patterns[i*width+k]!='-')&&(patterns[j*width+k]!='-'))
				{
				    if (patterns[i*width+k]==patterns[j*width+k])  k++;
				    else
					{
					    graphg[i*number+j]=0;
					    flag=1;
					    break;
					}
				}
			    else k++;
			}
		    if ((flag==0)&&(i!=j))
			{
			    graphg[i*number+j]=1;
			    total++;//the total number of the compatible relationship
			}
		    if (i==j) graphg[i*number+j]=0;
		}
	}

	return total;
}




//*******************function maxcliquegreedy********************


//this fuction is the greedy algorithm to find the maximal clique in graph G.

//the first cycle is used to confirm the group of compatible vectors(clique).
//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)
//the meaning of the function's parameters as follows:
//      f--the point of the file to output the position value
//      graphg--the graph G show the compatible relationship
//      rcomp--a heap room to save compatible mark of every pattern
//      n--the number of the vertices in graph G
//      total--the number of 1 in the graph G
//this function will return the number of the cliques

 //圖g中用貪心算法求最大相容類  
int maxcliquegreedy(FILE *f,int *graphg,int *rcomp,int n,int total)
{

   int *scl=new int[n];   //the temp array used to save the original position value
   int *tscl=new int[n];  //the temp array usd to save the changed position value
   int *gg=new int[n*n];  //G'
   int *tgg=new int[n*n]; //temp G'
   int *ncomp=new int[n]; //the degree of every vertex 
   int i,j,t,t1,t2,tmax,flag,pgg1,pgg2;

   if(gg==NULL)       cout<<"allocate error1"<<endl;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品天天看| 欧美视频一区二区三区| 日本一区二区综合亚洲| 国产精品1区2区3区在线观看| 国产亚洲精品超碰| 91小视频免费观看| 亚洲风情在线资源站| 欧美日韩国产小视频| 蜜臀精品久久久久久蜜臀| 久久影视一区二区| 成人黄色在线视频| 亚洲另类在线制服丝袜| 欧美日韩一区二区三区不卡| 日产欧产美韩系列久久99| 久久九九久久九九| 色嗨嗨av一区二区三区| 日韩精品一区第一页| 久久久激情视频| 一本色道久久综合狠狠躁的推荐| 三级亚洲高清视频| 久久精品一区二区三区不卡牛牛| 91视视频在线直接观看在线看网页在线看| 亚洲综合一二区| 久久美女高清视频| 色拍拍在线精品视频8848| 蜜臀av一区二区| 国产精品久久久久精k8| 69堂成人精品免费视频| 国产宾馆实践打屁股91| 亚洲成人av电影在线| 久久久一区二区三区| 日本高清不卡在线观看| 国产一区二区成人久久免费影院| 国产精品―色哟哟| 91精品国产品国语在线不卡| 国产69精品一区二区亚洲孕妇| 亚洲高清久久久| 欧美激情综合网| 日韩午夜三级在线| 色综合一个色综合亚洲| 精品一区二区三区在线观看| 国产精品理伦片| 日韩视频免费直播| 91啪九色porn原创视频在线观看| 精品一区二区日韩| 日韩精品视频网| 怡红院av一区二区三区| 国产欧美日韩另类一区| 在线不卡免费欧美| 91久久精品网| av男人天堂一区| 韩日欧美一区二区三区| 日韩精品欧美精品| 亚洲午夜电影在线| 亚洲欧美一区二区三区国产精品 | 99久久99久久精品免费观看| 久久国产精品99精品国产| 亚洲一区av在线| 亚洲精品日韩综合观看成人91| 久久久午夜精品理论片中文字幕| 欧美一区二区不卡视频| 欧美日韩午夜影院| 在线视频你懂得一区二区三区| 成人不卡免费av| 国产宾馆实践打屁股91| 国产精品一区二区久久不卡| 狠狠色综合播放一区二区| 日本成人在线一区| 日韩影院在线观看| 日本欧美肥老太交大片| 日韩黄色免费电影| 亚洲bt欧美bt精品| 午夜精品影院在线观看| 亚洲成人免费观看| 亚洲一区av在线| 石原莉奈在线亚洲三区| 日本欧洲一区二区| 免费在线成人网| 青青草原综合久久大伊人精品优势 | 成人app软件下载大全免费| 国产精品一区二区在线看| 国产在线看一区| 国产精品一区二区在线观看网站| 狠狠色丁香久久婷婷综合丁香| 麻豆国产精品视频| 国产精品亚洲专一区二区三区| 精品一区二区三区在线观看| 国内精品伊人久久久久av一坑| 日本大胆欧美人术艺术动态| 精品亚洲aⅴ乱码一区二区三区| 看电影不卡的网站| 国产综合色精品一区二区三区| 激情五月播播久久久精品| 国产露脸91国语对白| 成人免费视频一区二区| 91麻豆蜜桃一区二区三区| 欧美网站大全在线观看| 欧美精品丝袜中出| 国产三级一区二区| 亚洲欧美日韩中文播放 | 美女视频黄久久| 国模无码大尺度一区二区三区| 国产不卡在线一区| 欧美亚洲国产bt| 欧美tickle裸体挠脚心vk| 国产欧美一区二区精品性色 | 日韩av在线免费观看不卡| 久久精品72免费观看| 成人av综合在线| 欧美性猛交xxxxxx富婆| 精品国精品国产| 亚洲三级理论片| 免费三级欧美电影| 国产成人精品综合在线观看| 欧美性xxxxx极品少妇| 精品国产百合女同互慰| 国产精品久久久久毛片软件| 午夜影视日本亚洲欧洲精品| 国产一区二区伦理| 欧美伊人精品成人久久综合97| 精品国产免费一区二区三区香蕉 | 亚洲午夜一区二区三区| 精品一区二区三区免费观看 | 成人精品国产免费网站| 欧美日韩精品免费观看视频| 国产亚洲一二三区| 石原莉奈在线亚洲二区| 97久久超碰国产精品| 久久综合资源网| 亚洲国产裸拍裸体视频在线观看乱了| 国产一区二区三区综合| 欧美日韩免费在线视频| 欧美国产乱子伦| 久久99国产精品免费网站| 在线欧美一区二区| 国产精品狼人久久影院观看方式| 美国十次了思思久久精品导航| 91国偷自产一区二区三区观看| 国产色产综合色产在线视频| 人人狠狠综合久久亚洲| 欧美午夜在线一二页| 中文字幕一区在线观看视频| 国内精品久久久久影院薰衣草| 337p亚洲精品色噜噜噜| 夜夜揉揉日日人人青青一国产精品| 国产呦精品一区二区三区网站| 91精品久久久久久久99蜜桃| 亚洲国产美女搞黄色| 在线视频一区二区三| 国产精品国产精品国产专区不片| 国内精品伊人久久久久av影院 | 国产日产欧美一区| 经典三级视频一区| 欧美mv和日韩mv国产网站| 免费成人在线视频观看| 欧美精品aⅴ在线视频| 亚洲综合一区二区三区| 色婷婷综合久久久久中文| 亚洲色图在线视频| 91麻豆123| 亚洲另类春色校园小说| 日本韩国欧美三级| 亚洲黄网站在线观看| 91片在线免费观看| 亚洲一区在线观看免费| 欧美色欧美亚洲另类二区| 午夜免费久久看| 欧美精品丝袜中出| 日本不卡高清视频| 欧美二区在线观看| 日韩**一区毛片| 99久久精品国产麻豆演员表| 中文字幕一区二区在线观看| 色婷婷综合久久久中文一区二区| 国产女人水真多18毛片18精品视频 | 亚洲国产精品一区二区久久恐怖片 | 亚洲一区成人在线| 成人性视频免费网站| 国产精品二三区| 91福利小视频| 亚洲综合激情网| 欧美军同video69gay| 五月婷婷另类国产| 欧美大片国产精品| 国产精品1024| 国产午夜精品一区二区三区嫩草 | 奇米色一区二区三区四区| 精品久久久久久久久久久久包黑料 | 国产一区二区三区精品欧美日韩一区二区三区 | 国产三级三级三级精品8ⅰ区| 日韩精品久久久久久| 精品欧美一区二区久久 | 亚洲欧美综合网| 色视频成人在线观看免| 日本vs亚洲vs韩国一区三区二区 | 精品国产自在久精品国产| 成人黄色国产精品网站大全在线免费观看 | 久久草av在线| 久久久久久久电影| 一本大道av一区二区在线播放|