public static double evaluateLateralOverlapProbability(NDE nde1, NDE nde2, double S, double w) throws MathException{
		int m1 = nde1.getM();
		int n1 = nde1.getN();
		int m2 = nde2.getM();
		int n2 = nde2.getN();
		double pi1[] = nde1.getPi();
		double sigma1[] = nde1.getSigma();
		double lambda1[] = nde1.getLambda();
		double pi2[] = nde1.getPi();
		double sigma2[] = nde1.getSigma();
		double lambda2[] = nde1.getLambda();
		double sum = 0;
		for(int i=0;i<m1;i++){
			for(int j=0;j<m2;j++){
				sum += pi1[i]*pi2[j]*PySyN(S,w,sigma1[i],sigma2[j]);
			}
		}
		for(int i=0;i<m1;i++){
			for(int j=0;j<n2;j++){
				sum += pi1[i]*pi2[m1+j]*PySyNVSDE(S,w,sigma1[i],lambda2[j]);
			}
		}
		for(int i=0;i<n1;i++){
			for(int j=0;j<m2;j++){
				sum += pi1[m1+i]*pi2[j]*PySyNVSDE(S,w,sigma2[j],lambda1[i]);
			}
		}
		for(int i=0;i<n1;i++){
			for(int j=0;j<n2;j++){
				sum += pi1[m1+i]*pi2[m1+j]*PySyDE(S,w,lambda1[i],lambda2[j]);
			}
		}
		return sum;
	}