Skip to content

Conversation

timholy
Copy link
Member

@timholy timholy commented Jun 10, 2019

#613 didn't have adequate test coverage for solving problems like svd(A) \ v when A is non-square. It worked for the "thin" decomposition, but svd(A; full=Val(true)) \ v failed.

While implementing this I noticed what appeared to be missing support for indexing StaticArrays with SOneTo. This led to a change in one test result (see bea22b4), so this is worth thinking about carefully and is a breaking change.

@coveralls
Copy link

coveralls commented Jun 10, 2019

Coverage Status

Coverage increased (+0.02%) to 81.714% when pulling 8b56c53 on teh/svd_full into 701fda1 on master.

@c42f
Copy link
Member

c42f commented Jun 11, 2019

Oddly, the MacOS build for julia-1.0 failed with a timeout. There wasn't a lot to see in the build log so I've restarted it.

Copy link
Member

@c42f c42f left a comment

Choose a reason for hiding this comment

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

Thanks Tim, the SVD changes look good.

I think the indexing change is fine despite technically being a breaking change. I went ahead and added one small additional test case for this.

@test m[:, 1:2] isa Matrix
@test m[:, [true, false, false]] isa Matrix
@test m[:, SOneTo(2)] isa MMatrix{2, 2, Int}
@test m[:, SOneTo(2)] isa SMatrix{2, 2, Int}
Copy link
Member

Choose a reason for hiding this comment

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

I think this new behavior is preferable because it's more consistent. It's technically breaking, but I think the chances of this breaking the average user of StaticArrays are low.


# SOneTo
@testinf sm[SOneTo(1),:] === @SMatrix [1 3]
@testinf sm[:,SOneTo(1)] === @SMatrix [1;2]
Copy link
Member

Choose a reason for hiding this comment

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

Could you add an equivalent test for MMatrix just to assert the MMatrix type is preserved?

[edit - I went ahead and added this]

@timholy timholy merged commit 83e134a into master Jun 11, 2019
@timholy timholy deleted the teh/svd_full branch June 11, 2019 21:33
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.

3 participants