-
Notifications
You must be signed in to change notification settings - Fork 41
Left vector multiply #100
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
Merged
Merged
Left vector multiply #100
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3feab93
Left vector multiply
JeffFessler e45289d
Update README and bump version
JeffFessler 57d78c4
Support mul! for left vectors
JeffFessler c97d467
Suspend testing 1.0 for now
JeffFessler f87cdcd
Add mul! to test
JeffFessler 16caf90
Restore 1.0 test
JeffFessler 0775fa3
Abandon pre 1.4
JeffFessler 702f4bb
Working version (!) with VecOut = AbstractVecOrMat
JeffFessler afc6b8f
Nix useless VecOut
JeffFessler 4c770c4
Try 1.0 again
JeffFessler d006c82
Narrow 1.0 exclusion
JeffFessler e8f57bb
minor fixes
dkarrasch 1fbcae1
For codecov
JeffFessler 46489e1
Oops, lost a paren
JeffFessler 22b6fc9
add dimension checking tests
dkarrasch ad2d33e
include left matrix multiply and some fixes
dkarrasch b760a46
final tweaks, don't bump version number (yet)
dkarrasch 7fff78d
don't announce in README (yet)
dkarrasch 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# left.jl | ||
# "special cases" related left vector multiplication like x = y'*A | ||
# The subtlety is that y' is a AdjointAbsVec or a TransposeAbsVec | ||
# which is a subtype of AbstractMatrix but it is really "vector like" | ||
# so we want handle it like a vector (Issue#99) | ||
# So this is an exception to the left multiplication rule by a AbstractMatrix | ||
# that usually makes a WrappedMap. | ||
# The "transpose" versions may be of dubious use, but the adjoint versions | ||
# are useful for ensuring that (y'A)*x ≈ y'*(A*x) are both scalars. | ||
|
||
import LinearAlgebra: AdjointAbsVec, TransposeAbsVec | ||
|
||
Base.:(*)(y::AdjointAbsVec, A::LinearMap) = adjoint(*(A', y')) | ||
Base.:(*)(y::TransposeAbsVec, A::LinearMap) = transpose(transpose(A) * transpose(y)) | ||
|
||
# mul!(x, y', A) | ||
LinearAlgebra.mul!(x::AdjointAbsVec, y::AdjointAbsVec, A::LinearMap) = | ||
mul!(x, y, A, true, false) | ||
|
||
# not sure if we need bounds checks and propagate inbounds stuff here | ||
|
||
# mul!(x, y', A, α, β) | ||
function LinearAlgebra.mul!(x::AdjointAbsVec, y::AdjointAbsVec, A::LinearMap, | ||
α::Number, β::Number) | ||
check_dim_mul(x, y, A) | ||
mul!(x, A', y', α, β) | ||
return conj!(x) | ||
end | ||
|
||
# mul!(x, transpose(y), A, α, β) | ||
function LinearAlgebra.mul!(x::TransposeAbsVec, y::TransposeAbsVec, A::LinearMap, | ||
α::Number, β::Number) | ||
check_dim_mul(x, y, A) | ||
return mul!(x, transpose(A), transpose(y), α, β) | ||
end |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.