 	int pchi = 2;
 
 public:
-	// Constructor when storing the measurements in std::vector
-	DataAugmentation(vecvec& meas, vecvec& meas_unc, dim3& nB, dim3& nT) : nBlocks(nB), nThreads(nT)
-	{
-		int size1 = meas.size();
-		int size2 = meas[0].size();
-
-		ndata = max(size1,size2); // assume that ndata < mfeat and figure out the values from the size
-		mfeat = min(size1,size2); // of the arrays.
-
+	// Constructor
+	DataAugmentation(double** meas, double** meas_unc, int n, int m, dim3& nB, dim3& nT) :
+		ndata(n), mfeat(m), nBlocks(nB), nThreads(nT)
+	{
 		_SetArraySizes();
 
 		// copy input data to data members
 		for (int j = 0; j < mfeat; ++j) {
 			for (int i = 0; i < ndata; ++i) {
-				if (size1 < size2) {
-					h_meas[ndata * j + i] = meas[j][i];
-					h_meas_unc[ndata * j + i] = meas_unc[j][i];
-				} else {
-					h_meas[ndata * j + i] = meas[i][j];
-					h_meas_unc[ndata * j + i] = meas_unc[i][j];
-				}
+				h_meas[ndata * j + i] = meas[i][j];
+				h_meas_unc[ndata * j + i] = meas_unc[i][j];
 			}
 		}
 		// copy data from host to device
 		d_meas = h_meas;
 		d_meas_unc = h_meas_unc;
+
+		// place array sizes constant memory
+        CUDA_CHECK_RETURN(cudaMemcpyToSymbol(&c_ndata, &ndata, sizeof(ndata)));
+        CUDA_CHECK_RETURN(cudaMemcpyToSymbol(&c_mfeat, &mfeat, sizeof(ndata)));
+        CUDA_CHECK_RETURN(cudaMemcpyToSymbol(&c_pchi, &pchi, sizeof(ndata)));
 
 		thrust::fill(h_cholfact.begin(), h_cholfact.end(), 0.0);
 		d_cholfact = h_cholfact;

boost::random::mt19937 rng;
boost::random::normal_distribution<> snorm(0.0, 1.0); // Standard normal distribution
boost::random::uniform_real_distribution<> uniform(0.0, 1.0); // Uniform distribution from 0.0 to 1.0

// Function to compute the rank-1 Cholesky update/downdate. Note that this is done in place.
__device__ __host__

#include <thrust/device_vector.h>
#include <thrust/host_vector.h>

#define CUDA_CHECK_RETURN(value) {											\
	cudaError_t _m_cudaStat = value;										\
	if (_m_cudaStat != cudaSuccess) {										\
		fprintf(stderr, "Error %s at line %d in file %s\n",					\
				cudaGetErrorString(_m_cudaStat), __LINE__, __FILE__);		\
		exit(1);															\
	} }

typedef std::vector<std::vector<double> > vecvec;
typedef hvector hvector;
typedef dvector dvector;
