private double dotProduct(double[] a, double[] b) 
		throws ClusterException {
		
		int size = a.length;
		if(size != b.length)
			throw new ClusterException("Can't compute dot product on different size matrices!");
			
		double result= 0;
		for (int i=0; i<size; ++i)
			result += (a[i]*b[i]);
		
		return result;
	}