Return the l2 norm (Euclidean vector length) of a Counter.
<i>Implementation note:</i> The method name favors legibility of the L over
the convention of using lowercase names for methods.

@param c
The Counter
@return Its length
966440
public static <E, C extends Counter<E>> double L2Norm(C c) {
    double lenSq = 0.0;
    for (E key : c.keySet()) {
      double count = c.getCount(key);
      if (count != 0.0) {
        lenSq += (count * count);
      }
    }
    return Math.sqrt(lenSq);
  }
1098461
public int[] getMetricsTT(int c) {
        if (cmapExt != null) {
            return (int[])cmapExt.get(Integer.valueOf(c));
        }
        if (!fontSpecific && cmap31 != null) { 
            return (int[])cmap31.get(Integer.valueOf(c));
        }
        if (fontSpecific && cmap10 != null) { 
            return (int[])cmap10.get(Integer.valueOf(c));
        }
        if (cmap31 != null) { 
            return (int[])cmap31.get(Integer.valueOf(c));
        }
        if (cmap10 != null) {
            return (int[])cmap10.get(Integer.valueOf(c));
        }
        return null;
    }
834129
public int[] getMetricsTT(int c) {
        if (cmapExt != null)
            return (int[])cmapExt.get(Integer.valueOf(c));
        HashMap map = null;
        if (fontSpecific)
            map = cmap10;
        else
            map = cmap31;
        if (map == null)
            return null;
        if (fontSpecific) {
            if ((c & 0xffffff00) == 0 || (c & 0xffffff00) == 0xf000)
                return (int[])map.get(Integer.valueOf(c & 0xff));
            else
                return null;
        }
        else
            return (int[])map.get(Integer.valueOf(c));
    }
1053534
public static <E> E argmin(Counter<E> c) {
    double min = Double.POSITIVE_INFINITY;
    E argmin = null;

    for (E key : c.keySet()) {
      double count = c.getCount(key);
      if (argmin == null || count < min) {// || (count == min &&
                                          // tieBreaker.compare(key, argmin) <
                                          // 0)) {
        min = count;
        argmin = key;
      }
    }
    return argmin;
  }
609703
public static <E> Counter<E> division(Counter<E> c1, Counter<E> c2) {
    Counter<E> result = c1.getFactory().create();
    for (E key : Sets.union(c1.keySet(), c2.keySet())) {
      result.setCount(key, c1.getCount(key) / c2.getCount(key));
    }
    return result;
  }
510071
public static int isCNNumeric( char c ) 
    {
        Integer i = cnNumeric.get(c);
        if ( i == null ) return -1;
        return i.intValue();
    }
1022290
public int length() {
        Opcode opcode = getOpcode();
        if (opcode == null)
            return 1;

        switch (opcode) {
            case TABLESWITCH: {
                int pad = align(pc + 1) - pc;
                int low = getInt(pad + 4);
                int high = getInt(pad + 8);
                return pad + 12 + 4 * (high - low + 1);
            }
            case LOOKUPSWITCH: {
                int pad = align(pc + 1) - pc;
                int npairs = getInt(pad + 4);
                return pad + 8 + 8 * npairs;

            }
            default:
                return opcode.kind.length;
        }
    }
398477
protected static double subtractedMagnitude(DoubleVector c, DoubleVector v) {
        return Math.sqrt(subtractedMagnitudeSqrd(c, v));
    }
154653
public static int[] trim(LinearSparseVector c, float v) {
		int[][] idx = getTop(c, v);
		setZero(c, idx[1]);
		return idx[0];

	}
50528
public int length() {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "length");
        if (tc.isDebugEnabled())
            SibTr.debug(tc, "rc=", elements);
        if (tc.isEntryEnabled())
            SibTr.exit(tc, "length");

        return elements;
    }
1297979
public double distance(Coordinate c) {
		Coordinate nearest = this.nearest(c);
		LineSegment ls = new LineSegment(c, nearest);
		return ls.getLength();
	}
101291
public double getLength() {
		double length = 0;
		if (!isEmpty()) {
			length = exteriorRing.getLength();
			if (interiorRings != null) {
				for (LinearRing interiorRing : interiorRings) {
					length += interiorRing.getLength();
				}
			}
		}
		return length;
	}
797160
public static double vectorLength(double[] vector) {
        double ret = 0;
        if (vector == null)
            return ret;
        else {
            for (int i = 0; i < vector.length; i++) {
                ret += Math.pow(vector[i], 2);
            }

        }
        return ret;
    }
56239
public static int getOccurenceCount(char c, String s) 
    {
        int ret = 0;

        for(int i = 0; i < s.length(); i++)
        {
            if(s.charAt(i) == c)
                ++ret;
        }

        return ret;
    }
903492
public double distance3D(final Coordinate c) {
        final double dx = getX() - c.getX();
        final double dy = getY() - c.getY();
        final double dz = getZ() - c.getZ();
        return Math.sqrt(dx * dx + dy * dy + dz * dz);
    }
637141
public static GeometryIndex getLinearRingIndex(Geometry geometry, Coordinate c) {
		if (Geometry.LINEAR_RING.equals(geometry.getGeometryType())) {
			IndexedLinearRing ring = helper.createLinearRing(geometry);
			if (ring.containsCoordinate(c)) {
				return ring.getIndex();
			}
		} else if (Geometry.POLYGON.equals(geometry.getGeometryType())) {
			IndexedPolygon polygon = helper.createPolygon(geometry);
			for (IndexedLinearRing hole : polygon.getHoles()) {
				if (hole.containsCoordinate(c)) {
					return hole.getIndex();
				}
			}
			if (polygon.getShell().containsCoordinate(c)) {
				return polygon.getShell().getIndex();
			}
		} else if (Geometry.MULTI_POLYGON.equals(geometry.getGeometryType())) {
			IndexedMultiPolygon multipolygon = helper.createMultiPolygon(geometry);
			for (IndexedPolygon polygon : multipolygon.getPolygons()) {
				for (IndexedLinearRing hole : polygon.getHoles()) {
					if (hole.containsCoordinate(c)) {
						return hole.getIndex();
					}
				}
				if (polygon.getShell().containsCoordinate(c)) {
					return polygon.getShell().getIndex();
				}
			}
		}
		return null;
	}
1342811
public double norm_vector(double[] z) {
    double sum = 0;

    for (int i = 0; i < problem.getNumberOfObjectives(); i++) {
      sum += z[i] * z[i];
    }

    return Math.sqrt(sum);
  }