 
 
 int SIDE = 256;
-int SHORT_SIDE = 12;
+int SHORT_SIDE = 24;
 
 #include <cufft.h>
 #include <thrust/device_vector.h>

		skips = 0;
	}
	iter++;
			if (temperatureFactor < 1) temperatureFactor = 1;
	for (int y = 0; y < SHORT_SIDE; y++)
	{
		for (int x = 0; x < SHORT_SIDE; x++)



//			cudaMemcpy(&d_data[index], &data[index], sizeof(cufftComplex), cudaMemcpyHostToDevice);
//			cudaMemcpy(d_data, data, sizeof(cufftComplex) * SIDE * SHORT_SIDE, cudaMemcpyHostToDevice);
			cudaMemcpy2D(d_data, sizeof(cufftComplex) * SIDE, data, sizeof(cufftComplex) * SIDE, SHORT_SIDE / 2 * sizeof(cufftComplex), SHORT_SIDE / 2, cudaMemcpyHostToDevice);
			cudaMemcpy2D(&d_data[SIDE - SHORT_SIDE / 2], sizeof(cufftComplex) * SIDE, &data[SHORT_SIDE / 2], sizeof(cufftComplex) * SIDE, SHORT_SIDE / 2 * sizeof(cufftComplex), SHORT_SIDE / 2, cudaMemcpyHostToDevice);

			cudaMemcpy2D(&d_data[(SIDE - SHORT_SIDE / 2) * SIDE], sizeof(cufftComplex) * SIDE, &data[SHORT_SIDE / 2 * SIDE], sizeof(cufftComplex) * SIDE, SHORT_SIDE / 2 * sizeof(cufftComplex), SHORT_SIDE / 2, cudaMemcpyHostToDevice);
			cudaMemcpy2D(&d_data[(SIDE - SHORT_SIDE / 2) * (SIDE + 1)], sizeof(cufftComplex) * SIDE, &data[SHORT_SIDE / 2 * SIDE + SHORT_SIDE / 2], sizeof(cufftComplex) * SIDE, SHORT_SIDE / 2 * sizeof(cufftComplex), SHORT_SIDE / 2, cudaMemcpyHostToDevice);

			cufftExecC2C(plan, d_data, d_pattern, CUFFT_FORWARD);
			double newLikelihood = thrust::transform_reduce(thrust::make_zip_iterator(thrust::make_tuple(t_truePattern, t_mask, t_pattern)),
                                         thrust::make_zip_iterator(thrust::make_tuple(&t_truePattern[SIDE * SIDE], &t_mask[SIDE * SIDE], &t_pattern[SIDE * SIDE])), likelihooder,
					 (double) 0, thrust::plus<double>()) + 34154. * 2 * SIDE * SIDE;
			if (newLikelihood > oldLikelihood)
			{
//				printf("FORCED ACCEPT: x: %d, y: %d - %f at %lf : %f %lf %lf %d\n", x, y, val, angle, newLikelihood, nowsum, nowsum - basesum + basesum * factor * factor, iter);
