hplgit / scitools

Additional scientific computing functionality in Python - extensions to NumPy/SciPy++
http://hplgit.github.io/scitools/doc/web/index.html
Other
64 stars 30 forks source link

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

Open berna1111 opened 9 years ago

berna1111 commented 9 years ago

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:

Best regards