private static double norm(final double[] v){
  double agg=0;
  for (int i=0; i < v.length; i++) {
    agg+=(v[i] * v[i]);
  }
  return Math.sqrt(agg);
}

private static double norm ( final double [ ] v ) { double agg = 0 ; for ( int i = 0 ; i < v . length ; i ++ ) { agg += ( v [ i ] * v [ i ] ) ; } return Math . sqrt ( agg ) ; }
returns the norm l2 . sqrt ( sum_i ( v_i ^ 2 ) )
