 		t_mask = thrust::device_pointer_cast(d_mask);
 		t_truePattern = thrust::device_pointer_cast(d_truePattern);
 		t_pattern = thrust::device_pointer_cast(d_pattern);
+		t_data = thrust::device_pointer_cast(d_data);
 
 		printf("Memset: %d\n", cudaMemset(d_data, 0, sizeof(cufftComplex) * SIDE * SIDE));
 		cufftPlan2d(&plan, SIDE, SIDE, CUFFT_Z2Z);

}
} likelihooder;

struct gradientgetter {
  double __device__ gradient(int count, int mask, cufftComplex val, cufftComplex gTempl)
  {

  thrust::device_ptr<int> t_mask;
  thrust::device_ptr<int> t_truePattern;
  thrust::device_ptr<cufftComplex> t_pattern;
  thrust::device_ptr<cufftComplex> t_data;

	evaluator()
	{
