예제 #1
0
파일: RealFft.C 프로젝트: libqueso/queso
void
Fft<T>::allocTables(unsigned int fftSize)
{
  if (m_fftSize != fftSize) {
    if (m_fftSize != 0) freeTables();
    m_fftSize = fftSize;
    m_realWkSpace = gsl_fft_real_workspace_alloc       (fftSize);
    m_realWvTable = gsl_fft_real_wavetable_alloc       (fftSize);
  //m_hcWvTable   = gsl_fft_halfcomplex_wavetable_alloc(fftSize);
  }

  return;
}
예제 #2
0
int main(int argc, char* argv[])
{
    char inputFile[FILENAME_MAX];
    char temp[FILENAME_MAX];
    int flag = TRUE;
    int i;
    FILE *file;
    if(argc==1)
    {
        printf("No files to compile\n");
        return 0;
    }
/*Loop through file names.*/
    for(i=1; i<argc; i++)
    {
        fileName = argv[i];
        strcpy(inputFile,argv[i]);
        strcat(inputFile,".as");
        file = fopen (inputFile, "r");
        if (!file)
        {
            printf("File %s does not exist\n",fileName);
            return 0;
        }
/*Collect the input from the file and make first validation*/
        flag = buildMatrix(file);
/*Swap all the Dollars operand and check that the swaps are legal*/
        if(flag)
            flag = changeDollars();
/*Check that all labels, commands and operands are valid*/
        if(!checkLabels()||!checkAllCommands())
            flag = FALSE;
/*If flag is TRUE, can go on and parser the input*/
        if(flag)
        {
            buildSymbolTable();
            buildOutputTable();
            freeTables();
        /*Delete temp files*/
            strcpy(temp,fileName);
            strcat(temp,".ex");
            remove(temp);
            strcpy(temp,fileName);
            strcat(temp,".en");
            remove(temp);
            printf("compiled %s.\n",fileName);
        }
/*if Flag is false, print error*/
        else
        {
        /*Print error*/
            printf("Cannot compile %s.\n",fileName);
        /*Delete temp file*/
            strcpy(temp,fileName);
            strcat(temp,".ex");
            remove(temp);
            strcpy(temp,fileName);
            strcat(temp,".en");
            remove(temp);
        }
/*Free input table*/
        freeMatrixMem();
        fclose(file);
    } /*end for*/
    return 0;
}