code: public static boolean validate (double[][] weights, int numberOfComponents) {
  		int i;
  		boolean correct;
  		correct = (weights != null && weights.length > 0);
  
  		i = 0;
  		while (correct && i < weights.length)
  		{
  			correct = (weights[i].length == numberOfComponents);
  			i++;
  		}
  
  		return correct;
  	}
docs: Validate if the number of components of all weight vectors has the expected dimensionality.
  
  @param weights Weight vectors to validate
  @param numberOfComponents Number of components each weight vector must have
  @return True if the weight vectors are correct, False if the weight vectors are incorrect