# [SciPy-dev] band matrix wrapping ready for inclusion

Nils Wagner nwagner at iam.uni-stuttgart.de
Fri Jun 30 08:36:17 CDT 2006

```Arnd Baecker wrote:
> On Fri, 30 Jun 2006, Nils Wagner wrote:
>
> [...]
>
>
>> Did you check general band matrices ?
>>
>
> No.
>
>
>> If you need a test for real nonsymmetric band matrices
>>
>
> Not this time - the wrapped routines are for symmetric or
> Hermetian routines only.
>
>
>> from scipy import linalg, diag, arange, linspace, sort
>> def sylvester(n):
>> #
>> #  Sylvester matrix
>> #
>>    tmp = diag(arange(1,n),1)+diag(arange(n-1,0,-1),-1)
>>    return tmp
>>
>> n = 9
>> A = sylvester(n)
>> w1=linalg.eigvals(A)
>> w1=sort(w1.real)
>> #
>> # Exact eigenvalues
>> #
>> w_ex = linspace(-(n-1),n-1,n,endpoint=True)
>> print linalg.norm(w1-w_ex)
>>
>> Nils
>>
>> _______________________________________________
>> Scipy-dev mailing list
>> Scipy-dev at scipy.org
>> http://projects.scipy.org/mailman/listinfo/scipy-dev
>>
>>
>>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>
OK, do you intend to add support for non-hermitian matrices in the near
future ?

eig_banded(a_band, lower=0, eigvals_only=0, overwrite_a_band=0,
select='a', select_range=None, max_ev=0)
Solve real symmetric or complex hermetian band matrix problem.
eigvals_banded(a_band, lower=0, overwrite_a_band=0, select='a',
select_range=None)
Return eigenvalues of hermitean or real symmetric matrix.

It should be Hermitian instead of hermetian/hermitean  ;-)
http://en.wikipedia.org/wiki/Hermitian_matrix

Nils

```