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

BUG: fix corner case bugs in power_method_opnorm #495

Merged
merged 1 commit into from
Jul 15, 2016

Conversation

adler-j
Copy link
Member

@adler-j adler-j commented Jul 14, 2016

Fixes some inconsistencies as reported by @niinimaki.

return sqrt(x.norm())
x_norm = x.norm()
if x_norm == 0:
raise ValueError('reached ``x=0``')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity: when does this occur?

Copy link
Member Author

@adler-j adler-j Jul 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an test for exactly this further down. Basically when you have an matrix like

[[0, 1],
 [0, 0]]

and if you start with [1, 1], you then get [1, 0], and then [0, 0].

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some reading material here

@adler-j adler-j force-pushed the fix_powermethod_opnorm_bug branch from 94d8c9f to 6e39a28 Compare July 14, 2016 13:58
@adler-j adler-j added the merge? label Jul 14, 2016
@adler-j adler-j merged commit 6386682 into master Jul 15, 2016
@adler-j adler-j deleted the fix_powermethod_opnorm_bug branch July 15, 2016 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants