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

implement norms for matrices #1763

Closed
aghitza opened this issue Jan 12, 2008 · 9 comments
Closed

implement norms for matrices #1763

aghitza opened this issue Jan 12, 2008 · 9 comments

Comments

@aghitza
Copy link

aghitza commented Jan 12, 2008

Add functionality to implement various types of norms on matrices; for starters, see
http://en.wikipedia.org/wiki/Matrix_norm

CC: @haraldschilly

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/1763

@dfdeshom
Copy link

Attachment: trac_1763via2512.patch.gz

@dfdeshom
Copy link

comment:2

This patch adds the most common norm used for matrices: 1,2,\inf and Frobenius (and "entry-wise norm"). 2 points:

  • I don't believe there's a general formula for the p-norm, although I hear estimations can be computed. I could be wrong though.
  • I stuck this in matrix2.pyx and arbitrarily chose to use convert anything to RDF matrices since RDF matrices actually have a SVD method (which is needed for the 2-norm). I'd like to hear people comments on that.

@aghitza
Copy link
Author

aghitza commented Apr 1, 2008

apply after the above patch

@aghitza
Copy link
Author

aghitza commented Apr 1, 2008

comment:4

Attachment: 1763-2.patch.gz

Hi Didier,

I have a few concerns about the patch:

  1. as it is, it only returns an RDF if p=2, and some other type depending on the coefficient of the matrix otherwise; it would be preferable to have a uniform behavior

  2. for vectors, the syntax for the inf-norm is norm(Infinity), whereas here it is norm('inf'); it would be better to be consistent about this

  3. there are a bunch of trivial typos in the docstring and comments

  4. being a number theorist, to me 'frob' is much more suggestive of Frobenius than 'fro'.

Since all of this is fairly straightforward, I went ahead and put up an add-on patch.

@aghitza aghitza changed the title implement norms for matrices [with additional patch] implement norms for matrices Apr 1, 2008
@robertwb
Copy link
Contributor

robertwb commented Apr 6, 2008

comment:5

This doesn't handle matrices with negative or complex entries correctly, it should be taking absolute values in several places.

+1 to AlexGhitza's changes though.

@robertwb robertwb changed the title [with additional patch] implement norms for matrices [with additional patch, with negative review] implement norms for matrices Apr 6, 2008
@aghitza
Copy link
Author

aghitza commented Apr 9, 2008

apply instead of the other patches

@aghitza
Copy link
Author

aghitza commented Apr 9, 2008

comment:6

Attachment: 1763-replacement.patch.gz

I modified the previous patches so that norm() works correctly on matrices with negative and/or complex entries. I also added a conjugate() function for conjugating a complex matrix.

1763-replacement.patch should be applied instead of the previous patches.

@aghitza aghitza changed the title [with additional patch, with negative review] implement norms for matrices implement norms for matrices Apr 9, 2008
@mwhansen
Copy link
Contributor

comment:7

Looks good to me.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Apr 15, 2008

comment:8

Merged in Sage 3.0.alpha5

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

No branches or pull requests

5 participants