-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
transition linalg to Adjoint/Transpose externally #25083
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a532c1d
Give Adjoint/Transpose ConjRowVector/RowVector's hcat behaviors and t…
Sacha0 a6217c7
Give Adjoint/Transpose ConjRowVector/RowVector's map/broadcast behavi…
Sacha0 12f06a8
Shield linalg/rowvector tests against changes to adjoint(...), transp…
Sacha0 7085271
Transfer definitions not involving RowVector from linalg/rowvector.jl…
Sacha0 f210ae8
Give Adjoint/Transpose ConjRowVector/RowVector's multiplication behav…
Sacha0 b1568fd
Give Adjoint/Transpose ConjRowVector/RowVector's pseudoinversion beha…
Sacha0 49c740d
Give Adjoint/Transpose ConjRowVector/RowVector's left-division behavi…
Sacha0 d72d001
Give Adjoint/Transpose ConjRowVector/RowVector's right-division behav…
Sacha0 c928c29
Export Adjoint and Transpose for forthcoming transition.
Sacha0 50655e9
Strip defs involving RowVector from base/linalg/bidiag.jl and remove …
Sacha0 4c5afcd
Strip defs involving RowVector from base/linalg/diagonal.jl and trans…
Sacha0 d470cad
Strip defs involving RowVector from base/sparse/linalg.jl.
Sacha0 c5d0586
Strip defs involving RowVector from base/linalg/lq.jl, give behaviors…
Sacha0 286f8ca
Strip defs involving RowVector from base/linalg/givens.jl.
Sacha0 80cef64
Strip defs involving RowVector from base/linalg/generic.jl, give beha…
Sacha0 2f69ba8
Strip defs involving RowVector from base/linalg/factorization.jl.
Sacha0 dc79192
Give Adjoint/Transpose ConjRowVector/RowVector's sparse/structured co…
Sacha0 6131f25
Strip defs involving RowVector from base/sparse/higherorderfns.jl, gi…
Sacha0 cce1615
Strip defs involving RowVector from base/linalg/symmetric.jl and touc…
Sacha0 4f02304
Strip defs involving RowVector from base/linalg/triangular.jl.
Sacha0 8244bdf
Transition base to Adjoint/Transpose (flip switch, clean up fallout).
Sacha0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why
getindex
doesn't just solve this for you. Are you trying to return anAdjoint
-wrapped object? If so, why?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, returning an
Adjoint
/Transpose
-wrapped vector from higher order operations overAdjoint
/Transpose
-wrapped vectors is these methods' purpose :).Why? The superficial reason is preservation of
ConjRowVector
/RowVector
's behavior inAdjoint
/Transpose
-wrapped vectors. The reason forConjRowVector
/RowVector
's behavior: Without re-wrapping, the result of these operations is a single-rowMatrix
, which has different semantics fromConjRowVector
/RowVector
. Consequently, for example,foo.(anadjointvector) * avector
would produce a one-by-one matrix rather than a scalar.In other words, re-wrapping preserves 4774 semantics through higher order operations insofar as possible.
Does that clarify? Thoughts? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Sidenote: typo in the comment
operationt
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Thanks! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
Adjoint(map(Adjoint∘f∘Adjoint, parent.(avs)...))
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(so you don't have to create a temporary)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoiding the temporaries would be lovely! Deciphering the above expression is more than I have mental bandwidth for right at the moment though 😄. Perhaps a post-freeze optimization? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timholy, revisiting this rewrite briefly, given
Adjoint
is unary I imagine you instead meant e.g.Adjoint(map((xs...) -> Adjoint(f(Adjoint.(xs)...)), parent.(avs)...))
? Thanks again! :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that looks right.