Infinity Norm

This documentation was generated with the assistance of AI. Please report any inaccuracies.

InfinityNormComputer computes the infinity norm (maximum norm, uniform norm, supremum norm) of a matrix. For a matrix, it is the maximum absolute row sum:

The name "infinity norm" comes from the fact that, for a vector, it is the limit of the general p-norm family (see the one norm) as p tends to infinity, which converges to the maximum absolute element — the reason it is also called the maximum or supremum norm:

Instances are obtained through NormComputer.create(NormType.INFINITY_NORM), and Utils.normInf is built directly on this class.

Its unit ball (the set of vectors with norm exactly 1) is the axis-aligned square below, in contrast with the diamond of the one norm (p = 1) and the circle of the Euclidean/Frobenius norm (p = 2):

Unit balls for the 1-norm 2-norm 4-norm and infinity-norm showing the infinity norm’s square shape

Behavior on arrays

This library represents an array as a single column matrix (one column, as many rows as elements), and InfinityNormComputer follows that convention literally: as documented on the class itself, each row of a column matrix holds exactly one element, so norm(double[]) returns the absolute value of the first element of the array, rather than the maximum absolute value across all of its elements. Callers that need the conventional vector infinity norm (the maximum absolute element) should compute it directly rather than relying on this method for arrays of length greater than one.

Usage

The getNorm instance methods implement the abstract NormComputer contract; static norm methods are also available for direct use without instantiating the class:

import com.irurueta.algebra.InfinityNormComputer;
import com.irurueta.algebra.Matrix;
import com.irurueta.algebra.NormComputer;
import com.irurueta.algebra.NormType;

Matrix a = new Matrix(2, 2);
// ... fill a with data ...

// static usage
double norm = InfinityNormComputer.norm(a);

// through the NormComputer factory
NormComputer computer = NormComputer.create(NormType.INFINITY_NORM);
double sameNorm = computer.getNorm(a);

A norm(double[], Matrix jacobian) overload also computes the norm’s 1xN Jacobian with respect to the input array.

Utils.normInf(Matrix) and Utils.normInf(double[]) are convenience wrappers around this class.

Error handling

The Jacobian overload throws WrongSizeException if the provided Jacobian matrix is not 1xN, where N is the length of the input array.