-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linalg: Matrix norms #885
linalg: Matrix norms #885
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Jeremie Vandenplas <[email protected]>
Thank you for the review @jvdp1. What do you and @loiseaujc think of the name |
Thanks for this nice work @perazz, LGTM! On my side, no additional remarks. If there are no objections with the naming convention I would say this PR is ready. |
Address #820 in joint effort with @jalvesz.$A$ , real or complex, has general rank
Compute matrix norms using LAPACK
*LANGE
backend.Array
n>=2
.For higher ranks
n>2
, user may specify two dimensionsdims(2)
the norms should be computed along.dims == [1,2]
is otherwise assumed by default.Proposed implementation
na = mnorm(a [, order=1] [, dim=dim] [, err=err])
: function interfaceKey facts
The implementations supported by
*LANGE
are currently provided:1, '1'
: 1-norm or "maximum column sum",2, '2'
: 2-norm or "maximum singular value",maxval(svdvals(a))
'Euclidean','Frobenius','fro'
(or order not provided): Frobenius norm,'inf', huge(0)
:order
can either be an integer (1, huge(0)
) or a character input ('1', '2', 'inf', 'euclidean', ...
). For similarity with NumPy/SciPy, this is an optional argument. If not provided, the Frobenius norm is computed.Progress
Prior art
linalg.matrix_norm(x, /, *, keepdims=False, ord='fro')
norm(a, ord=None, axis=None, keepdims=False, check_finite=True)
cc: @jvdp1 @jalvesz @loiseaujc