Example #1
0
int inzstruct_data(struct_data *data)
{
  long size;
  dataLMN("LMNmaxdata.txt",&data->L,&data->M,&data->N,&data->maxy,&data->maxNoTIME);  
  testsame(data->L*data->M*data->N,data->maxy);

  size=data->L*data->M*data->N; /*input from file*/ 
  data->y=malloc(size*sizeof(double));        /*Cycle with SHIFTlmn*/
  data->x=malloc(size*sizeof(double));        /*Cycle with SHIFTlmn*/
  size=data->L;
  data->NoORF=malloc(size*sizeof(double));    /*Cycle with data->L*/
  data->NoSUM=malloc(size*sizeof(double));    /*Cycle with data->L*/

  /*if (data->y==NULL||data->x==NULL||data->NoORF==NULL||data->NoSUM==NULL||data->NoTIME==NULL) {
    perror("malloc failed");
    exit(EXIT_FAILURE);
    }*/

  datadouble("ydata.txt",data->y,data->L*data->M*data->N);
  datadouble("xdata.txt",data->x,data->L*data->M*data->N);
  dataint("NoORFdata.txt",data->NoORF,data->L);

  filldata(data);
  testsame(data->maxNoTIME,data->SHIFTlmn);

  size=data->SHIFTlmn;/*inputfromfile*/
  data->NoTIME=malloc(size*sizeof(double));   /*Cycle with SHIFTlm*/
  dataint("NoTIMEdata.txt",data->NoTIME,data->SHIFTlmn);


  return 0;
}
Example #2
0
int inzstruct_data(struct_data *data)
{
	long size;
	dataLMN("LMNmaxdata.txt",&data->L,&data->M,&data->N);  
	size=data->L*data->M*data->N*2; /*input from file*/
	data->SHIFTlmn=data->L*data->M*data->N; /*input from file*/
  	data->y=malloc(size*sizeof(double));        /*Cycle with SHIFTlmn*/
        data->x=malloc(size*sizeof(double));        /*Cycle with SHIFTlmn*/
	size=data->L*2;
	data->NoORF=malloc(size*sizeof(double));    /*Cycle with data->L*/
	data->NoSUM=malloc(size*sizeof(double));    /*Cycle with data->L*/
	size=17308*2;/*inputfromfile*/
	data->NoTIME=malloc(size*sizeof(double));   /*Cycle with SHIFTlm*/
	
	if (data->y==NULL||data->x==NULL||data->NoORF==NULL||data->NoSUM==NULL||data->NoTIME==NULL) {
		perror("malloc failed");
    		exit(EXIT_FAILURE);
  	}

	datadouble("ydata.txt","ydata2.txt",data->y);
        datadouble("xdata.txt","xdata2.txt",data->x);
        dataint("NoORFdata.txt","NoORFdata2.txt",data->NoORF);
        dataint("NoTIMEdata.txt","NoTIMEdata2.txt",data->NoTIME);

	filldata(data);
return 0;
}
Example #3
0
File: datain.c Project: jhncl/LNA
int inzstruct_data(struct_data *data)
{
  long size;
  int i;
  dataLMN("LMNmaxdata.txt",&data->L,&data->M,&data->N,&data->maxy,&data->maxNoTIME);  
  testsame(data->L*data->M*data->N,data->maxy);

  size=data->L*data->M*data->N; /*input from file*/ 
  data->y=malloc(size*sizeof(double));        /*Cycle with SHIFTlmn*/
  data->x=malloc(size*sizeof(double));        /*Cycle with SHIFTlmn*/
  data->yy=malloc(size*sizeof(double));
  size=data->L;
  data->NoORF=malloc(size*sizeof(double));    /*Cycle with data->L*/
  data->NoSUM=malloc(size*sizeof(double));    /*Cycle with data->L*/

  /*if (data->y==NULL||data->x==NULL||data->NoORF==NULL||data->NoSUM==NULL||data->NoTIME==NULL) {
    perror("malloc failed");
    exit(EXIT_FAILURE);
    }*/

  datadouble("ydata.txt",data->y,data->L*data->M*data->N);
  datadouble("ydata.txt",data->yy,data->L*data->M*data->N);
  for (i=0;i<(data->L*data->M*data->N);i++){
    /*    if(data->y[i]<=0){ data->y[i]=0.00001;} */ /************/
    /*    if(data->x[i]<0){ data->x[i]=0.00001;}*/
  }

  /*  for (i=0;i<data->L*data->M*data->N;i++){
    if(data->yy[i]<=0){data->yy[i]=0.00001;}
  }*/
  datadouble("xdata.txt",data->x,data->L*data->M*data->N);
  for (i=0;i<data->L*data->M*data->N;i++){
    if(data->x[i]<=0){data->x[i]=(data->x[i+1]+data->x[i])/2+0.00001;}/*Can't have time <=0*/
  }

  dataint("NoORFdata.txt",data->NoORF,data->L);

  filldata(data);
  testsame(data->maxNoTIME,data->SHIFTlmn);

  size=data->SHIFTlmn;/*inputfromfile*/
  data->NoTIME=malloc(size*sizeof(double));   /*Cycle with SHIFTlm*/
  dataint("NoTIMEdata.txt",data->NoTIME,data->SHIFTlmn);


  return 0;
}