code: public static double computeEnergy( float []array  ) {
  		double total = 0;
  
  		for( int i = 0; i < array.length; i++ ) {
  			total += array[i]*array[i];
  		}
  
  		return total;
  	}
docs: <p>
  Compute the energy of the specified array.
  </p>
  
  <p>
  E = sum( i=1..N , a[i]*a[i] )
  </p>