Enum Norm

java.lang.Object
java.lang.Enum<Norm>
org.apache.commons.numbers.core.Norm
All Implemented Interfaces:
Serializable, Comparable<Norm>

public enum Norm extends Enum<Norm>
Norm functions.

The implementations provide increased numerical accuracy. Algorithms primary source is the 2005 paper Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput.

  • Enum Constant Details

  • Method Details

    • values

      public static Norm[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Norm valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public final double of(double x, double y)
      Computes the norm.

      Special cases:

      Parameters:
      x - Argument.
      y - Argument.
      Returns:
      the norm.
    • of

      public final double of(double x, double y, double z)
      Computes the norm.

      Special cases:

      Parameters:
      x - Argument.
      y - Argument.
      z - Argument.
      Returns:
      the norm.
    • of

      public final double of(double[] v)
      Computes the norm.

      Special cases:

      Parameters:
      v - Argument.
      Returns:
      the norm.
      Throws:
      IllegalArgumentException - if the array is empty.