Commit fe8e826f authored by karius's avatar karius

quadrature tests work

parent ed7cb02c
......@@ -490,13 +490,13 @@ __host__
void TransformationGrid::gaussian(void){
float4 * rotation = (float4 *) malloc(sizeof(*rotation));
float4 * translation = (float4 *) malloc(sizeof(*translation));
float sigma = h_translation_offset->x/4;
float sigma = h_translation_offset->x/2;
float mu = h_translation_offset->x;
float N = 1.0/(powf(sigma,3.0)*powf(2*M_PI,1.5));
for (uint i = 0; i < h_num_transformations[0];i++){
h_transformation_to_memory(i,rotation,translation);
// h_scores[i] = N*expf(-powf(translation->x-mu,2.0)/powf(sigma,2.0)-powf(translation->y-mu,2.0)/powf(sigma,2.0)-powf(translation->z-mu,2.0)/powf(sigma,2.0));
h_scores[i] = powf(translation->x,2.0) + powf(translation->y,2.0) + powf(translation->z,2.0);
h_scores[i] = N*expf(-powf(translation->x-mu,2.0)/powf(sigma,2.0)-powf(translation->y-mu,2.0)/powf(sigma,2.0)-powf(translation->z-mu,2.0)/powf(sigma,2.0));
// h_scores[i] = powf(translation->x,2.0) + powf(translation->y,2.0) + powf(translation->z,2.0);
}
cudaMemcpy(d_scores,h_scores,h_num_transformations[0]*sizeof(*d_scores),cudaMemcpyHostToDevice);
CudaCheckError();
......
No preview for this file type
......@@ -632,7 +632,7 @@ BOOST_AUTO_TEST_CASE(translational_quadrature)
effective_translational_shift.first = {0,0,0};
effective_translational_shift.second = {2,2,2};
float trans_offset[3] = {1,1,1};
float tau = 0.5;
float tau = 0.1;
float * quadrature_result = (float *) malloc(sizeof(*quadrature_result));
TransformationGrid transformation_grid(effective_translational_shift,tau,&trans_offset[0]);
transformation_grid.gaussian();
......
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