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

factorize_tridiag_matrix asking for len(b) [and proposed solution] #37

Open
berna1111 opened this issue Jun 9, 2015 · 0 comments
Open

Comments

@berna1111
Copy link

Function factorize_tridiag_matrix receives only an argument (A), but the very first line asks len(b), which is undefined in this scope.

Seeing as it is called in solve_tridiag_linear_system (which receives A and b arguments), I propose b is included in the arguments of factorize_tridiag_matrix.

Alternatively one could use A.shape[0], which should return the same value, however, further down the function the line c[0] = b[0]pops up. And again, if b is not passed as an argument, it is undefined (or ill-defined) in this context.

So, the full changes for this to work are:

  • in solve_tridiag_linear_system change c, d = factorize_tridiag_matrix(A) to c, d = factorize_tridiag_matrix(A, b)
  • in factorize_tridiag_matrix change def factorize_tridiag_matrix(A): to def factorize_tridiag_matrix(A, b):

Best regards

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

1 participant