Skip to content
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

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

linalg: Matrix norms #885

wants to merge 21 commits into from

Conversation

perazz
Copy link
Contributor

@perazz perazz commented Nov 6, 2024

Address #820 in joint effort with @jalvesz.
Compute matrix norms using LAPACK *LANGE backend.
Array $A$, real or complex, has general rank n>=2.

For higher ranks n>2, user may specify two dimensions dims(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 interface

Key facts

  • The implementations supported by *LANGE are currently provided:

    • 1, '1': 1-norm or "maximum column sum", $\max_j \sum_i{ \left|a_{i,j}\right| }$
    • 2, '2': 2-norm or "maximum singular value", maxval(svdvals(a))
    • 'Euclidean','Frobenius','fro' (or order not provided): Frobenius norm, $\sqrt{\sum_{i,j}{ a_{i,j}^2}} $
    • 'inf', huge(0): $\infty$-norm or "maximum row sum", $\max_i \sum_j{ \left|a_{i,j}\right| }$
  • 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

  • base implementation
  • tests
  • documentation
  • submodule
  • examples

Prior art

  • Numpy: linalg.matrix_norm(x, /, *, keepdims=False, ord='fro')
  • Scipy: norm(a, ord=None, axis=None, keepdims=False, check_finite=True)

cc: @jvdp1 @jalvesz @loiseaujc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant