m3sh.linalg.

unit_inplace#

unit_inplace(u)#

In-place vector normalization.

Convenience function to normalize a vector.

Parameters:
undarray, shape (n,)

Vector with n components.

Returns:
ndarray, shape (n,)

The normalized input vector (not a normalized copy).

Warning

This function modifies the input argument!

Notes

No error checking (division by zero, etc) is performed. Trying to normalize the zero vector results in a vector of nan values.