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

Internal error on eigenvalues of zero matrices. #50

Open
dantswain opened this issue Nov 19, 2013 · 1 comment
Open

Internal error on eigenvalues of zero matrices. #50

dantswain opened this issue Nov 19, 2013 · 1 comment

Comments

@dantswain
Copy link

I noticed some errors on computing the eigenvalues of zero matrices (matrices consisting of all zeros).

Test definitions:

IN> numeric.eig([0]) 
OUT> {lambda: {x: [0], y: [0]},
      E: {x: [1], y: [0]}}
IN> numeric.eig([[0, 0], [0, 0]]) 
OUT> {lambda: {x: [0, 0], y: [0, 0]}, 
      E: {x: [[1, 0], [0, 1]],
          y: [[0, 0], [0, 0]] }}
IN> numeric.eig([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) 
OUT> {lambda: {x: [0, 0, 0], y: [0, 0, 0]}, 
      E: {x: [[1, 0, 0], [0, 1, 0], [0, 0, 1]],
          y: [[0, 0, 0], [0, 0, 0], [0, 0, 0]] }}

Results:

132 FAIL numeric.eig([0])==>Error:numeric:toUpperHessenberg()onlyworksonsquarematrices!=={lambda:{x:[0],y:[0]},E:{x:[1],y:[0]}}
133 FAIL numeric.eig([[0,0],[0,0]])==>{lambda:{x:[0,0],y:},E:{x:[[1,1],[0,0]],y:}}!=={lambda:{x:[0,0],y:[0,0]},E:{x:[[1,0],[0,1]],y:[[0,0],[0,0]]}}
134 FAIL numeric.eig([[0,0,0],[0,0,0],[0,0,0]])==>Error:eig:internalerror!=={lambda:{x:[0,0,0],y:[0,0,0]},E:{x:[[1,0,0],[0,1,0],[0,0,1]],y:[[0,0,0],[0,0,0],[0,0,0]]}}

The size 1 case is degenerate, but should still work. The size 2 case correctly identifies the eigenvalues as zero (multiplicity 2) but doesn't choose eigenvalues to span the space. The size 3 case fails on an error in the house function. All cases could probably be handled by checking if the matrix is a zero matrix and then just returning zeros as the eigenvalues and the identity matrix as the eigenvector generator.

@sloisel
Copy link
Owner

sloisel commented Nov 19, 2013

There's a bug with matrices with repeated eigenvalues. I haven't had the
time to fix it.

On Tue, Nov 19, 2013 at 2:57 AM, Dan [email protected] wrote:

I noticed some errors on computing the eigenvalues of zero matrices
(matrices consisting of all zeros).

Test definitions:

IN> numeric.eig([0])
OUT> {lambda: {x: [0], y: [0]},
E: {x: [1], y: [0]}}
IN> numeric.eig([[0, 0], [0, 0]])
OUT> {lambda: {x: [0, 0], y: [0, 0]},
E: {x: [[1, 0], [0, 1]],
y: [[0, 0], [0, 0]] }}
IN> numeric.eig([[0, 0, 0], [0, 0, 0], [0, 0, 0]])
OUT> {lambda: {x: [0, 0, 0], y: [0, 0, 0]},
E: {x: [[1, 0, 0], [0, 1, 0], [0, 0, 1]],
y: [[0, 0, 0], [0, 0, 0], [0, 0, 0]] }}

Results:

132 FAIL numeric.eig([0])==>Error:numeric:toUpperHessenberg()onlyworksonsquarematrices!=={lambda:{x:[0],y:[0]},E:{x:[1],y:[0]}}
133 FAIL numeric.eig([[0,0],[0,0]])==>{lambda:{x:[0,0],y:},E:{x:[[1,1],[0,0]],y:}}!=={lambda:{x:[0,0],y:[0,0]},E:{x:[[1,0],[0,1]],y:[[0,0],[0,0]]}}
134 FAIL numeric.eig([[0,0,0],[0,0,0],[0,0,0]])==>Error:eig:internalerror!=={lambda:{x:[0,0,0],y:[0,0,0]},E:{x:[[1,0,0],[0,1,0],[0,0,1]],y:[[0,0,0],[0,0,0],[0,0,0]]}}

The size 1 case is degenerate, but should still work. The size 2 case
correctly identifies the eigenvalues as zero (multiplicity 2) but doesn't
choose eigenvalues to span the space. The size 3 case fails on an error in
the house function. All cases could probably be handled by checking if
the matrix is a zero matrix and then just returning zeros as the
eigenvalues and the identity matrix as the eigenvector generator.


Reply to this email directly or view it on GitHubhttps://github.com//issues/50
.

Sébastien Loisel
Department of Mathematics
Heriot-Watt University
Riccarton EH14 4AS
United Kingdom
web: http://www.ma.hw.ac.uk/~loisel/
email: S.Loisel at hw.ac.uk
phone: +44 131 451 3234
fax: +44 131 451 3249

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

No branches or pull requests

2 participants