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

LQPackedQ postmultiplication fixup #23813

Merged
merged 1 commit into from
Sep 26, 2017
Merged

Conversation

Sacha0
Copy link
Member

@Sacha0 Sacha0 commented Sep 22, 2017

In #23803 I incorrectly extended LQPackedQ's context-dependent multiplication behavior to some methods that should not have that behavior. This pull request makes LQPackedQ's postmultiplication behavior context-dependent only where necessary, and adds additional commentary describing the intended behavior. Best!

@Sacha0 Sacha0 added bugfix This change fixes an existing bug linear algebra Linear algebra labels Sep 22, 2017
@test Ac_mul_B(C, implicitQ) ≈ Ac_mul_B(zeroextCdown, explicitQ)
@test Ac_mul_Bc(C, implicitQ) ≈ Ac_mul_Bc(zeroextCdown, explicitQ)
Copy link
Member

Choose a reason for hiding this comment

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

This only deletes tests – are there any tests that could be added that would have caught this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Excellent point, and yes! :) I've added @test_throws making certain those shape combinations now yield DimensionMismatchs. Thanks!

#
# (2) the inner dimension in the multiplication is the LQPackedQ's first dimension.
# in this case, the LQPackedQ behaves like either its square/full form or its
# thin form depending on the shape of the other object in the multiplication.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it should be pointed out that thin actually means wide in the case of LQ`.

Copy link
Member

Choose a reason for hiding this comment

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

Why?!? Can it be renamed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. Though the "thin" decomposition/factorization terminology inherited from QR seems the most widespread, I have also seen "reduced" and "truncated" decomposition/factorization, both of which seem like better choices when applied to orthogonal decompositions/factorizations generally (and particularly "truncated" for its descriptiveness). Perhaps we should select one of the latter terms (and an equivalent term for the "full" or "complete" decomposition/factorization) and use that term consistently for all orthogonal decompositions/factorizations? If so, perhaps opening a separate issue for that change would be best? Best!

Copy link
Member

Choose a reason for hiding this comment

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

Why?!? Can it be renamed?

The LQ is simply QR transposed so when Q is thin in QR it is actually wide in LQ. There are two cases here: the comment and the keyword. Here I just thought of extending the comment to point out that the matrix is wide. For the keyword, notice that you only use when materializing a dense Q so it is not really relevant when you just use the factorization. However, it is a bit unfortunate that thin means wide in lq. Maybe we should negate the argument and have a square keyword instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Considerations for future work in any case? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I extended the docstring with a note briefly describing the somewhat confusing "thin"/"tall", "wide"/"short", "truncated"/"reduced" situation, and revised the language in the code comments to use the hopefully less confusing "truncated" and "square". Thoughts? Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Should we just use "truncated" consistently?

Copy link
Member Author

Choose a reason for hiding this comment

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

#23813 (comment) :). That change sounds like work for a future pull request though. Best!

Copy link
Member

Choose a reason for hiding this comment

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

I agree. We should consider changing the language here but in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Sacha0
Copy link
Member Author

Sacha0 commented Sep 26, 2017

Thanks all! :)

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

Successfully merging this pull request may close these issues.

3 participants