⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 qrdrls算法
💻 CPP
字号:
#include "filein.h"
#include "fileout.h"
#include "share.h"
int mark1,mark2,mark3,model;

void main()
{
	int  i=0,j=0,k=0,pos1=0, pos2=0, pos3=0, pos4=0,pos5=0,pos6=0;
	int ifend=1;
	CString filenametest_out,filenameweight,temp1,temp2;
	double *qr_inputi,*qr_inputq,*qr_outputi,*qr_outputq; //,*testin_i,*testin_q
	printf("*******please input model type*******\nwhen model = ");
    scanf("%d",&model);
	switch(model)
	{
	case 0:
		printf("*****memory ploynomial model*****\n");
		mark1=M*N;
		mark2=NUMBER1-N;
		mark3=NUMBER2-N;
		break;
	case 1:
		printf("*****prewidowing*****\n");
		mark1=M;
		mark2=NUMBER1;
		mark3=NUMBER2;
		break;
	case 2:
		printf("*****Wiener model*****\n");
		mark1=M;
		mark2=NUMBER1;
		mark3=NUMBER2;
	default:
		break;
	}

 
	complex2 *w;
	w=new complex2 [mark1];
	boundaryCell  *BC;
	BC=new boundaryCell [mark1];
	internalCell **IC;
	IC=new internalCell *[mark1];
	for(i=0;i<mark1;i++)
		IC[i]=new internalCell [mark1];
	
    complex2 *temp; //*test_out,
	//test_out=new complex2 [mark3];
	temp=new complex2[mark3];

	/*matrix *A2;
	A2=new matrix(mark1,mark3,0);*/
	
	
    qr_inputi=new double [NUMBER1];
	qr_inputq=new double [NUMBER1];
	qr_outputi=new double [NUMBER1];
	qr_outputq=new double [NUMBER1];
//	testin_i=new double [NUMBER2];
	//testin_q=new double [NUMBER2]; 
//initial


	readfile(TRAININGFILEIN_I, qr_inputi,NUMBER1,&pos1);
	readfile(TRAININGFILEIN_Q, qr_inputq,NUMBER1,&pos2);
	readfile(TRAININGFILEOUT_I, qr_outputi,NUMBER1,&pos3);
	ifend=readfile(TRAININGFILEOUT_Q, qr_outputq,NUMBER1,&pos4);
	//readfile(TESTFILEIN_I,testin_i,NUMBER2,&pos5);
   // readfile(TESTFILEIN_Q,testin_q,NUMBER2,&pos6);
//read file in
    matrix W(1,mark1,0); //test_out_matrix(1,mark3,0)



	for(i=0;i<1;i++)
	{
		//printf("%d  ",i);
	
		GetWeightValue( qr_inputi,qr_inputq,qr_outputi,qr_outputq,w,BC,IC);
//data process
//
//
//
	    writefile("weight1.txt",w,mark1);
		W.set_matrix(w);
		W.print_matrix();
		/*test_out_matrix=W*(*A2);
		for(j=0;j<mark3-mark1;j++)
		{
			temp[j]=test_out_matrix.get_element(0,j);
			test_out[j]=temp[j].conjugate();
		}
		writefile("model_out1.txt", test_out, mark3);*/
//write file out
	}
	//test_out_matrix.free_memory();
	W.free_memory();

	delete [] qr_inputi;
	delete [] qr_inputq;
	delete [] qr_outputi;
	delete [] qr_outputq;
	//delete [] testin_i;
	//delete [] testin_q;
	//delete [] test_out;
	delete [] temp;
	delete [] w;
	delete [] BC;
	for(i=0;i<mark1;i++)
		delete [] IC[i];
	delete IC;


	//A2->free_memory();
	//delete A2;
//finished
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -