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

WIP: Sort gen eig #8441

Closed
wants to merge 4 commits into from
Closed

WIP: Sort gen eig #8441

wants to merge 4 commits into from

Conversation

axsk
Copy link
Contributor

@axsk axsk commented Sep 22, 2014

No description provided.

@axsk
Copy link
Contributor Author

axsk commented Sep 22, 2014

is this working?
if so please also add the feature to schurfact(A)

schurfact!{T<:BlasFloat}(A::StridedMatrix{T}, B::StridedMatrix{T}) = GeneralizedSchur(LinAlg.LAPACK.gges!('V', 'V', A, B)...)
schurfact{T<:BlasFloat}(A::StridedMatrix{T},B::StridedMatrix{T}) = schurfact!(copy(A),copy(B))
schurfact{TA,TB}(A::StridedMatrix{TA}, B::StridedMatrix{TB}) = (S = promote_type(Float32,typeof(one(TA)/norm(one(TA))),TB); schurfact!(S != TA ? convert(AbstractMatrix{S},A) : copy(A), S != TB ? convert(AbstractMatrix{S},B) : copy(B)))
schurfact!{T<:BlasFloat}(A::StridedMatrix{T}, B::StridedMatrix{T}, sort::Char='N', selctg::Ptr{None}=C_NULL) = GeneralizedSchur(LinAlg.LAPACK.gges!('V', 'V', A, B)...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to expose the sorting possibility at this level. I also don't think that this works as you have changed the signature of gges!. Let's just leave these methods unmodified unless we can actually provide a way of sorting the values.

@jiahao
Copy link
Member

jiahao commented Sep 22, 2014

Thanks for looking into generalizing the Schur factorization. However, we can't accept this pull request as is.

  1. The functionality for wrapping LAPACK should go into base/linalg/lapack.jl.
  2. The functionality for extending schurfact should go into base/linalg/factorization.jl.
  3. Tests go in the test/ directory, not base/linalg. You will also want to make sure that make test runs the tests that you have written. Also, tests should not print anything, they should make use of @test macros in Base.Test to assert that the answers are what are expected.

Does order_eigs_c actually work? The output type of the cfunction doesn't look right.

function gges!(jobvsl::Char, jobvsr::Char, A::StridedMatrix{$elty}, B::StridedMatrix{$elty})
function gges!(jobvsl::Char, jobvsr::Char,
A::StridedMatrix{$elty}, B::StridedMatrix{$elty}),
sort::Char, selctg::Ptr{None})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of the arguments should follow the LAPACK subroutine. It is not necessary to have the sort argument as it can be inferred from the selctg argument. It would be good to add a method without the selctg argument that defaults to selctg = C_NULL.

@jiahao jiahao changed the title Sort gen eig WIP: Sort gen eig Sep 22, 2014
@axsk
Copy link
Contributor Author

axsk commented Sep 24, 2014

i hope to provide the desired functionality implementing matlabs ordschur function, see #8467
should i close this request (i won't maintain it further..)?

@axsk axsk closed this Sep 25, 2014
@cc7768 cc7768 deleted the sort_gen_eig branch January 6, 2015 22:58
@cc7768
Copy link
Contributor

cc7768 commented Jan 6, 2015

Sorry about not having seen or commented on any of this. I worked on this a little (as you could probably tell it was pretty undeveloped) but then got busy with some other things that came up. I must have smashed mark all notifications as read without having noticed this.

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.

4 participants