public static double vectorLength(double[] vector){
  double ret=0;
  if (vector == null)   return ret;
 else {
    for (    double aVector : vector) {
      ret+=Math.pow(aVector,2);
    }
  }
  return ret;
}

public static double vectorLength ( double [ ] vector ) { double ret = 0 ; if ( vector == null ) return ret ; else { for ( double aVector : vector ) { ret += Math . pow ( aVector , 2 ) ; } } return ret ; }
returns the vector length ( sqrt ( sum ( x_i ) )
