Commit 65947e3b authored by David Rohr's avatar David Rohr
Browse files

Do initialize buffers where not needed

parent 47c12f7a
...@@ -164,8 +164,8 @@ int bioem::configure(int ac, char* av[]) ...@@ -164,8 +164,8 @@ int bioem::configure(int ac, char* av[])
/****************** Precalculating Necessary Stuff *********************/ /****************** Precalculating Necessary Stuff *********************/
precalculate(); precalculate();
param.nTotGridAngles = 10; param.nTotGridAngles = 4;
param.nTotCTFs = 10; param.nTotCTFs = 4;
//param.param_device.maxDisplaceCenter = 0; //param.param_device.maxDisplaceCenter = 0;
deviceInit(); deviceInit();
...@@ -182,10 +182,6 @@ int bioem::precalculate() ...@@ -182,10 +182,6 @@ int bioem::precalculate()
// Generating Grids of orientations // Generating Grids of orientations
param.CalculateGridsParam(); param.CalculateGridsParam();
//Inizialzing crosscorrelations of Maps
memset(RefMap.sum_RefMap, 0, BIOEM_MAX_MAPS * sizeof(*RefMap.sum_RefMap));
memset(RefMap.sumsquare_RefMap, 0, BIOEM_MAX_MAPS * sizeof(*RefMap.sum_RefMap));
myfloat_t sum,sumsquare; myfloat_t sum,sumsquare;
//Precalculating cross-correlations of maps //Precalculating cross-correlations of maps
...@@ -266,7 +262,6 @@ int bioem::run() ...@@ -266,7 +262,6 @@ int bioem::run()
{ {
printf("\t\tConvolution %d %d\n", iProjectionOut, iConv); printf("\t\tConvolution %d %d\n", iProjectionOut, iConv);
/*** Calculating convolutions of projection map and crosscorrelations ***/ /*** Calculating convolutions of projection map and crosscorrelations ***/
memset(conv_mapFFT,0,param.param_device.NumberPixels*param.param_device.NumberPixels*sizeof(*conv_mapFFT));
timer.ResetStart(); timer.ResetStart();
createConvolutedProjectionMap(iProjectionOut,iConv,proj_mapFFT,conv_map,conv_mapFFT,sumCONV,sumsquareCONV); createConvolutedProjectionMap(iProjectionOut,iConv,proj_mapFFT,conv_map,conv_mapFFT,sumCONV,sumsquareCONV);
...@@ -429,9 +424,6 @@ int bioem::calculateCCFFT(int iRefMap, int iConv, mycomplex_t* localConvFFT,myco ...@@ -429,9 +424,6 @@ int bioem::calculateCCFFT(int iRefMap, int iConv, mycomplex_t* localConvFFT,myco
{ {
myfftw_plan plan; myfftw_plan plan;
memset(lCC,0,param.param_device.NumberPixels*param.param_device.NumberPixels*sizeof(*lCC));
memset(localCCT,0,param.param_device.NumberPixels*param.param_device.NumberPixels*sizeof(*localCCT));
for(int i=0; i < param.param_device.NumberPixels ; i++ ) for(int i=0; i < param.param_device.NumberPixels ; i++ )
{ {
for(int j=0; j < param.param_device.NumberPixels ; j++ ) for(int j=0; j < param.param_device.NumberPixels ; j++ )
......
...@@ -142,8 +142,6 @@ int bioem_RefMap::PreCalculateMapsFFT(bioem_param& param) ...@@ -142,8 +142,6 @@ int bioem_RefMap::PreCalculateMapsFFT(bioem_param& param)
mycomplex_t* localout; mycomplex_t* localout;
localout= (mycomplex_t *) myfftw_malloc(sizeof(mycomplex_t) *param.param_device.NumberPixels*param.param_device.NumberPixels); localout= (mycomplex_t *) myfftw_malloc(sizeof(mycomplex_t) *param.param_device.NumberPixels*param.param_device.NumberPixels);
memset(localMap,0,param.param_device.NumberPixels*param.param_device.NumberPixels*sizeof(mycomplex_t));
for (int iRefMap = 0; iRefMap < ntotRefMap ; iRefMap++) for (int iRefMap = 0; iRefMap < ntotRefMap ; iRefMap++)
{ {
//Assigning localMap values to padded Map //Assigning localMap values to padded Map
...@@ -155,8 +153,6 @@ int bioem_RefMap::PreCalculateMapsFFT(bioem_param& param) ...@@ -155,8 +153,6 @@ int bioem_RefMap::PreCalculateMapsFFT(bioem_param& param)
localMap[i*param.param_device.NumberPixels+j][1]=0.0; localMap[i*param.param_device.NumberPixels+j][1]=0.0;
} }
} }
//setting elements of output map to 0
memset(localout,0,param.param_device.NumberPixels*param.param_device.NumberPixels*sizeof(mycomplex_t));
//Calling FFT_Forward //Calling FFT_Forward
plan = myfftw_plan_dft_2d(param.param_device.NumberPixels,param.param_device.NumberPixels,localMap,localout,FFTW_FORWARD,FFTW_ESTIMATE); plan = myfftw_plan_dft_2d(param.param_device.NumberPixels,param.param_device.NumberPixels,localMap,localout,FFTW_FORWARD,FFTW_ESTIMATE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment