Skip to content

Conversation

@pkofod
Copy link
Contributor

@pkofod pkofod commented Mar 4, 2016

These tests are added to make sure that the linear algebra functions work with SubArrays, as proposed in JuliaLang/LinearAlgebra.jl#299.

  • Added loop over Array and SubArray in eigen.jl, and appropriately define a, asym, apd, asym_sg, a_sg, a1_nsg, and a2_nsg (and a again at the bottom`).
  • Added loop over Array and SubArray in schur.jl and appropriately define a, asym, apd, a1_sf, and a2_sf.

Everything seems to work fine with SubArrays.
Edit: I've seen the whitespace errors, will fix when at a computer.

@pkofod pkofod force-pushed the SubEigenSchur branch 2 times, most recently from 8e7e473 to d98ef63 Compare March 5, 2016 13:02
sum(select) != 0 && @test_approx_eq S[:values][find(select)] O[:values][1:sum(select)]
@test_approx_eq O[:vectors]*O[:Schur]*O[:vectors]' ordschura
@test_throws KeyError f[:A]
Snew = Base.LinAlg.Schur(copy(S.T), copy(S.Z), copy(S.values))
Copy link
Member

Choose a reason for hiding this comment

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

What happens if you remove the copys here and instead adds a copy(Snew) in the next line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like so?

Snew = Base.LinAlg.Schur(S.T, S.Z, S.values)
SchurNew = ordschur!(copy(Snew), select)

It gives me

ERROR: MethodError: no method matching copy(::Base.LinAlg.Schur{Float32,Array{Float32,2}})

Copy link
Member

Choose a reason for hiding this comment

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

I had a suspicion that this would be the result. Would you mind adding the two copy methods for Schur and GeneralizedSchur to this PR? They should be almost trivial.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Keep the suggestions above, and add copys?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. copy inside the ordschur! functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By "add copys" I meant method definitions, but yes, we agree :) I'll probably do it tomorrow.

@pkofod
Copy link
Contributor Author

pkofod commented Mar 8, 2016

Test passed, so it should be 👍 . The reason why it is running again, is because I rebased it.

andreasnoack added a commit that referenced this pull request Mar 8, 2016
Added SubArray tests for linalg/eigen.jl and linalg/schur.jl
@andreasnoack andreasnoack merged commit 91d466a into JuliaLang:master Mar 8, 2016
@pkofod pkofod deleted the SubEigenSchur branch March 8, 2016 19:24
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.

2 participants