private double cosineSimilarity(double[] a, double[] b) 
			throws ClusterException {
		
		double dot= this.dotProduct(a, b);
		double normProduct= this.getNorm(a) * this.getNorm(b);
		if (normProduct == 0)
			throw new ClusterException("Can't compute cosine similarity on arrays with all zeros!");
		return dot / normProduct;
	  }