  * dSumTables - vector of the sum of the columns of the dCountingTables
  * dOutputAdvice - this node's advice to be fed to its children nodes
  */
+//TODO: make a check to see if it has enough shared memory
 __global__ void UpdateBeliefs( const int states, float *dPOS, float * dNewBeliefs, float * dOldBeliefs, int * dCountingTables,
 		int * dParentsInputAdvice, int parentStates, int * dSumTables, int * dOutputAdvice){
 

        tid += blockDim.x;
    }
}



/*

	dim3 grid( mCols, mRows);

	int n = states > 22 ? 22 : states;
	dim3 threads( n, n ); //total threads should be less than 512 per block, hardware limit so states needs to be less<=22
	//TODO: this should probably be a multiple of states instead to avoid wasting threads

	UpdateBeliefs<< grid, threads >>();


*/

//TODO: make a check to see if it has enough shared memory
//TODO: make sure that I'm useing __shared__ properly and if im doing it dynamically will it work properly
//TODO: still need to normalize as in the denominator of the belief update equation.

/**
 * UpdateBeliefs - Performs the P(s'|s,a)*b(s) calculations of the DeSTIN belief update rule.

	//multiply the two parts of the belief update equation numerator together, Pr(o|s') by Sum[ Pr(s'|s,c)*b(S) ]
	//The cache[sp * states] is the Pr(s'|s,c)*b(S)  vector

	//we launched with a 2d block of threads now only dealing with 1d arrays, so convert this back to 1d so we waste fewer threads
	int sp_start  = threadIdx.y * blockDim.x + threadIdx.x; 
	int n_threads = blockDim.x * blockDim.y;

	//transform it from a column into a row
	for(int sp = sp_start ; sp < states ; sp += n_threads ){
		//dNewBeliefs[i] = dPOS[i] * cache[sp * states];
		pssc_b_vector[sp] = cache[sp * states] *= dPOS[bid * states + sp];
