Squared L2 norm: see {@link #norm2(String, SDVariable, boolean, int...)}
773549
public SDVariable squaredNorm(SDVariable x, boolean keepDims, int... dimensions) {
        return squaredNorm(null, x, keepDims, dimensions);
    }
1090450
private static final void x_to_y2(long10 t, long10 y2, long10 x) {
		sqr(t, x);
		mul_small(y2, x, 486662);
		add(t, t, y2);
		t._0++;
		mul(y2, t, x);
	}
532141
public final void normalize() {
		double norm;

		norm = (this.x*this.x + this.y*this.y + this.z*this.z + this.w*this.w);

		if (norm > 0f) {
			norm = 1f / Math.sqrt(norm);
			this.x *= norm;
			this.y *= norm;
			this.z *= norm;
			this.w *= norm;
		} else {
			this.x = 0f;
			this.y = 0f;
			this.z = 0f;
			this.w = 0f;
		}
	}
52675
private double normPDF(double x) {
        return Math.exp(-x*x / 2) / (Math.sqrt(2 * Math.PI));
    }
273738
private void normalize(DoubleVector v) {
        double magnitude = 0;
        for (int i = 0; i < v.length(); ++i)
            magnitude += Math.pow(v.get(i), 2);
        if (magnitude == 0)
            return;

        magnitude = Math.sqrt(magnitude);
        for (int i = 0; i < v.length(); ++i)
            v.set(i, v.get(i)/magnitude);
    }
1174731
def _norm_squared(args: Dict[str, Any]) -> float:
    """"""
    state = _state_shard(args)
    return np.sum(np.abs(state) ** 2)
933955
public static double norm_inf(float[] a) {
    double max = Double.NEGATIVE_INFINITY;
    for (int i = 0; i < a.length; i++) {
      if (Math.abs(a[i]) > max) {
        max = Math.abs(a[i]);
      }
    }
    return max;
  }
1008769
private function hqr2 () {
		//  Initialize
		$nn = $this->n;
		$n  = $nn - 1;
		$low = 0;
		$high = $nn - 1;
		$eps = pow(2.0, -52.0);
		$exshift = 0.0;
		$p = $q = $r = $s = $z = 0;
		// Store roots isolated by balanc and compute matrix norm
		$norm = 0.0;

		for ($i = 0; $i < $nn; ++$i) {
			if (($i < $low) OR ($i > $high)) {
				$this->d[$i] = $this->H[$i][$i];
				$this->e[$i] = 0.0;
			}
			for ($j = max($i-1, 0); $j < $nn; ++$j) {
				$norm = $norm + abs($this->H[$i][$j]);
			}
		}
17782
def l2_norm(x, filters=None, epsilon=1e-6, name=None, reuse=None):
  """"""
  if filters is None:
    filters = shape_list(x)[-1]
  with tf.variable_scope(name, default_name="l2_norm", values=[x], reuse=reuse):
    scale = tf.get_variable(
        "l2_norm_scale", [filters], initializer=tf.ones_initializer())
    bias = tf.get_variable(
        "l2_norm_bias", [filters], initializer=tf.zeros_initializer())
    epsilon, scale, bias = [cast_like(t, x) for t in [epsilon, scale, bias]]
    mean = tf.reduce_mean(x, axis=[-1], keepdims=True)
    l2norm = tf.reduce_sum(
        tf.squared_difference(x, mean), axis=[-1], keepdims=True)
    norm_x = (x - mean) * tf.rsqrt(l2norm + epsilon)
    return norm_x * scale + bias
434493
def norm_squared(x, Mx=None, inner_product=ip_euclid):
    ''''''
    assert(len(x.shape) == 2)
    if Mx is None:
        rho = inner_product(x, x)
    else:
        assert(len(Mx.shape) == 2)
        rho = inner_product(x, Mx)

    if rho.shape == (1, 1):
        if abs(rho[0, 0].imag) > abs(rho[0, 0])*1e-10 or rho[0, 0].real < 0.0:
            raise InnerProductError(('<x,Mx> = %g. Is the inner product '
                                     'indefinite?') % rho[0, 0])

    return numpy.linalg.norm(rho, 2)
1348093
def compare (v1, v2):
    """"""
    v1_norm = normalize(v1)
    v2_norm = normalize(v2)
    if v1_norm < v2_norm:
        return -1
    if v1_norm > v2_norm:
        return 1
    return 0
996483
def l2_norm(arr):
    
    arr = np.asarray(arr)
    return np.sqrt(np.dot(arr.ravel().squeeze(), arr.ravel().squeeze()))
602380
public static float cs_norm(Scs A) {
        int p, j, n, Ap[];
        float Ax[], norm = 0, s;
        if (!Scs_util.CS_CSC(A) || A.x == null)
            return (-1); /* check inputs */
        n = A.n;
        Ap = A.p;
        Ax = A.x;
        for (j = 0; j < n; j++) {
            for (s = 0, p = Ap[j]; p < Ap[j + 1]; p++)
                s += Math.abs(Ax[p]);
            norm = Math.max(norm, s);
        }
        return (norm);
    }
396093
function norm(arr, p) {
    var nnorm = 0,
    i = 0;
    // check the p-value of the norm, and set for most common case
    if (isNaN(p)) p = 2;
    // check if multi-dimensional array, and make vector correction
    if (isUsable(arr[0])) arr = arr[0];
    // vector norm
    for (; i < arr.length; i++) {
      nnorm += Math.pow(Math.abs(arr[i]), p);
    }
    return Math.pow(nnorm, 1 / p);
  }
980677
public static double norm(double[] a) {
    double squaredSum = 0;
    for (double anA : a) {
      squaredSum += anA * anA;
    }
    return Math.sqrt(squaredSum);
  }
1326860
def norm(point):
    
    if isinstance(point, PoseStamped):
        x = point.pose.position.x
        y = point.pose.position.y
        z = point.pose.position.z
    elif isinstance(point, Pose):
        x = point.position.x
        y = point.position.y
        z = point.position.z
    else:
        x = point[0][0]
        y = point[0][1]
        z = point[0][2]
    return sqrt(x * x + y * y + z * z)
545540
private void sety2(double[] x, double[] y) {
        double p, qn, sig, un;
        double[] u = new double[n - 1];

        y2[0] = u[0] = 0.0;

        for (int i = 1; i < n - 1; i++) {
            sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]);
            p = sig * y2[i - 1] + 2.0;
            y2[i] = (sig - 1.0) / p;
            u[i] = (y[i + 1] - y[i]) / (x[i + 1] - x[i]) - (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
            u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p;
        }

        qn = un = 0.0;
        y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0);
        for (int k = n - 2; k >= 0; k--) {
            y2[k] = y2[k] * y2[k + 1] + u[k];
        }
    }