fvec_alpha_norm method

double fvec_alpha_norm(
  1. Pointer<fvec_t> v,
  2. double p
)

computes the p-norm of a vector

Computes the p-norm of a vector for \f$ p = \alpha \f$

\f$ L^p = ||x||_p = (|x_1|^p + |x_2|^p + ... + |x_n|^p ) ^ \frac{1}{p} \f$

If p = 1, the result is the Manhattan distance.

If p = 2, the result is the Euclidean distance.

As p tends towards large values, \f$ L^p \f$ tends towards the maximum of the input vector.

References:

\param v vector to compute norm from \param p order of the computed norm

\return the p-norm of v

Implementation

double fvec_alpha_norm(
  ffi.Pointer<fvec_t> v,
  double p,
) {
  return _fvec_alpha_norm(
    v,
    p,
  );
}