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

test 1x1 cases #89

Closed
stevengj opened this issue Aug 23, 2022 · 5 comments
Closed

test 1x1 cases #89

stevengj opened this issue Aug 23, 2022 · 5 comments

Comments

@stevengj
Copy link
Member

I notice that several of your tests are currently only testing 2x2 and larger matrices. They should be fixed to ensure that 1x1 works too.

(The trivial 1x1 case does not need to be optimized, but it should still work. I'm not sure if you were confused by this in JuliaLang/julia#84 — I suggested removing the n==1 special case from the code to simplify the code paths and to remove an apparently superfluous optimization … the generic implementation should ideally be written in such a way as to work for n==1 without modifiction.)

@smataigne
Copy link
Collaborator

smataigne commented Aug 23, 2022

I added the case n==1 to all tests, except for those for tridiag.jl . For this one it is a bit more touchy because the sub-diagonal must be an empty complex array and I am not sure yet that everything works for that case.
For example, dot(x, A, y) doesn't work. However it doesn't work either for A SymTridiagonal because the implementation suppose the access to the 2 first elements of x.

@smataigne
Copy link
Collaborator

I notice that several of your tests are currently only testing 2x2 and larger matrices. They should be fixed to ensure that 1x1 works too.

(The trivial 1x1 case does not need to be optimized, but it should still work. I'm not sure if you were confused by this in JuliaLang/julia#84 — I suggested removing the n==1 special case from the code to simplify the code paths and to remove an apparently superfluous optimization … the generic implementation should ideally be written in such a way as to work for n==1 without modifiction.)

I understand very well the philosophy.

@stevengj
Copy link
Member Author

stevengj commented Aug 23, 2022

However it doesn't work either for A SymTridiagonal because the implementation suppose the access to the 2 first elements of x.

That's a bug, I've filed an issue JuliaLang/LinearAlgebra.jl#945.

In the meantime you could always disable that particular check for n == 1, or write a special check.

@smataigne
Copy link
Collaborator

I fixed dot and mul! for the n==1 case

@stevengj
Copy link
Member Author

Just your friendly periodic reminder to mention the issue (#89) in any PR and/or commit message that addresses it, so that it will be linked here.

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

2 participants