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 bug for input with int elements #102

Merged
merged 1 commit into from
Nov 24, 2014
Merged

Conversation

oyamad
Copy link
Member

@oyamad oyamad commented Nov 24, 2014

I found the same bug as in the Julia version. For an input matrix with integer elements, gth_solve returns a wrong answer:

>>> P = [[-3, 3], [4, -4]]  # Transition rate matrix
>>> gth_solve(P)
array([ 0.5,  0.5])

The correct answer is [4/7, 3/7].
(My choice of the instance was not clever so that the test failed to detect this bug...)

The current code now converts the input to float.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 493ab6e on oyamad:gth_solve into 42b4344 on QuantEcon:master.

@jstac
Copy link
Contributor

jstac commented Nov 24, 2014

@oyamad Well spotted, many thanks.

jstac added a commit that referenced this pull request Nov 24, 2014
BUG: Fix bug for input with int elements
@jstac jstac merged commit bb4e9a7 into QuantEcon:master Nov 24, 2014
@oyamad oyamad deleted the gth_solve branch August 8, 2015 02:35
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.

None yet

3 participants