normrow

compas.numerical.normrow(A)[source]

Calculates the 2-norm of each row of matrix A.

Parameters:
Aarray

Matrix A represented as an (m x n) array.

Returns:
array

Column vector (m x 1) of values.

Notes

The calculation is the Euclidean 2-norm, i.e. the square root of the sum of the squares of the elements in each row, this equates to the “length” of the m row vectors.

Examples

>>> normrow(array([[2, -1, 3,], [1, 0, 1], [0, 2, -1]]))
array([[3.74165739],
       [1.41421356],
       [2.23606798]])