code: private static double getNorm(double[] w)
    {
      double norm = 0;
      for (int i = 0; i < w.length; i++) {
        norm += w[i]*w[i];
      }
      return norm;
    }
docs: really this is the square of the L2 norm....