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

RFC: Lyapunov / Sylvester solver via LAPack xTRSYL #7435

Merged
merged 6 commits into from
Jun 30, 2014

Conversation

mschauer
Copy link
Contributor

As discussed in #5814, solver for the Lyapunov equation
AX + XA' +C = 0
and the Sylvester equation
AX + XB + C = 0

Function name and arguments is oriented at the Matlab neighbors.
lyapchol(A,B) for the cholesky factor of A*X + X*A' + B*B' = 0 is still missing.

@mschauer
Copy link
Contributor Author

Strange, I am missing something. I get
no method trsyl!(Char, Char, Array{Float32,2}, Array{Float32,2}, Array{Float32,2}, Int64) in trsyl! at linalg/lapack.jl:3675
I do not have this error here. Also missing trsyl! within trsyl!?

# AX + XB + C = 0
function sylvester{T<:BlasFloat}(A::StridedMatrix{T},B::StridedMatrix{T},C::StridedMatrix{T})
RA, QA = schur(A)
RB, QB = schur(B')
Copy link
Member

Choose a reason for hiding this comment

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

would be nicer to avoid explicit transpositions (and the resultant matrix copies). Can't you use schur(B) and then compensate with the corresponding opB argument of trysyl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, if QRQ' = B then (QRQ')' = QR'Q' = B' ...

Copy link
Member

Choose a reason for hiding this comment

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

It seems like it is even easier than that, because trysyl allows you to implicitly treat one of the matrices as transposed.

@stevengj
Copy link
Member

Needs documentation too.

@mschauer
Copy link
Contributor Author

Thank you for going through this with me. I did not push the documentation commit, comes in a minute.

@ViralBShah
Copy link
Member

Your tests seem to have changed the indentation on the entire test file. That makes it difficult to see what has changed. Could you fix that?

@ViralBShah
Copy link
Member

Cc: @andreasnoackjensen

@ViralBShah ViralBShah added this to the 0.4 milestone Jun 27, 2014
@mschauer
Copy link
Contributor Author

I followed @stevengj's Tips and restored the skew indentation. One can fix the indentation later.

@mschauer
Copy link
Contributor Author

The test failed in test/sparse.jl, I think that is unrelated, maybe a missing srand(...) and a different state of the random number generator after these commits.

@stevengj
Copy link
Member

Looking good, except for the mysterious test failure.

@ViralBShah
Copy link
Member

Seems safe to include in 0.3. Any reservations?

@ViralBShah ViralBShah modified the milestones: 0.3, 0.4 Jun 29, 2014
@mschauer
Copy link
Contributor Author

Apparently this was an intermittent failure which went away with the last commit.

JeffBezanson added a commit that referenced this pull request Jun 30, 2014
RFC: Lyapunov / Sylvester solver via LAPack xTRSYL
@JeffBezanson JeffBezanson merged commit f16fe99 into JuliaLang:master Jun 30, 2014
@jiahao
Copy link
Member

jiahao commented Jun 30, 2014

Could use a mention in NEWS.md

@ViralBShah
Copy link
Member

@jiahao Good idea. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants