Class DenseRingVectorNorms

java.lang.Object
org.flag4j.linalg.ops.dense.ring_ops.DenseRingVectorNorms

public final class DenseRingVectorNorms extends Object
This utility class contains methods for computing norms of dense Ring Vectors.
  • Method Details

    • norm

      public static <T extends Ring<T>> double norm(T... src)
      Computes the 2-norm of a vector.
      Parameters:
      src - Entries of the vector (or non-zero data if vector is sparse).
      Returns:
      The 2-norm of the vector.
    • norm

      public static <T extends Ring<T>> double norm(T[] src, double p)
      Computes the p-norm of a vector.
      Parameters:
      src - Entries of the vector (or non-zero data if vector is sparse).
      p - The p value in the p-norm.
      - If p is Double.POSITIVE_INFINITY, then this method computes the maximum/infinite norm.
      - If p is Double.NEGATIVE_INFINITY, then this method computes the minimum norm.
      Warning, if p is large in absolute value, overflow errors may occur.
      Returns:
      The p-norm of the vector.