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

Add 3-arg * methods #37898

Merged
merged 32 commits into from
Jun 7, 2021
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2ed51d6
add 3-arg star
Oct 6, 2020
14fa53e
also handle 3 matrices
Oct 6, 2020
b0c33f4
a few more cases, and tests
Oct 6, 2020
1981525
two scalars + one array
Oct 6, 2020
71dfbb0
avoid dot dispatch
Oct 6, 2020
be5eee3
add some array-of-array tests
Oct 6, 2020
8e9bcd5
fix order of multiplication
Oct 6, 2020
cfa28cb
add a docstring
Oct 6, 2020
93d03b8
preserve order in fallbacks
Oct 6, 2020
b04b3a5
opt-in, take 1
Oct 6, 2020
1a29b74
remove two-scalar methods
Oct 6, 2020
6c3c9c0
fewer adjoint = less chance of spurious dimensions
Oct 6, 2020
a1ddb42
Update stdlib/LinearAlgebra/src/matmul.jl
mcabbott Oct 7, 2020
ea98220
four-argument *, why not
Oct 8, 2020
d6954e0
one more case
Oct 8, 2020
ffbb4b8
rm ambiguity
Oct 8, 2020
f0b3648
use 3-arg dot only when length(x)<64
Oct 17, 2020
1c92294
more explicit name for _SafeMatrix
Oct 17, 2020
0a71d33
don't use 3-arg dot at all
Oct 18, 2020
fb3b7da
use RealOrComplex for eltypes, too
Oct 27, 2020
f005fb5
better fallback for mat_vec_scalar
Nov 17, 2020
eac95e7
remove a now-duplicate definition of StridedMaybeAdjOrTransMat
Nov 20, 2020
2f39e33
Apply suggestions from code review
mcabbott Dec 11, 2020
d9b456e
constrain adjoint eltypes
Dec 11, 2020
766368f
two tiny fixes
mcabbott May 14, 2021
15f9f21
optimise dot(x,A,y)-like cases based on whether A is transposed
mcabbott May 16, 2021
5ef2922
two tests
mcabbott May 28, 2021
f778a00
Update stdlib/LinearAlgebra/test/matmul.jl
mcabbott May 28, 2021
eacc11b
change zero(γ) -> false as suggested
mcabbott Jun 7, 2021
ebb52fb
better docstring
mcabbott Jun 7, 2021
e7aa4ad
wording, plus examples
mcabbott Jun 7, 2021
468d19b
docstring
mcabbott Jun 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
better fallback for mat_vec_scalar
  • Loading branch information
Michael Abbott authored and mcabbott committed May 13, 2021
commit f005fb584da196504b154d9c67b2615768477034
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ end
# Fast path for two arrays * one scalar is opt-in, via mat_vec_scalar and mat_mat_scalar.
mcabbott marked this conversation as resolved.
Show resolved Hide resolved
StridedMaybeAdjOrTransMat{T} = Union{StridedMatrix{T}, Adjoint{T, <:StridedMatrix}, Transpose{T, <:StridedMatrix}}
dkarrasch marked this conversation as resolved.
Show resolved Hide resolved

mat_vec_scalar(A, x, γ) = (A*x) .* γ # fallback
mat_vec_scalar(A, x, γ) = A * (x .* γ) # fallback
mat_vec_scalar(A::StridedMaybeAdjOrTransMat, x::StridedVector, γ) = _mat_vec_scalar(A, x, γ)
mat_vec_scalar(A::AdjOrTransAbsVec, x::StridedVector, γ) = (A * x) * γ

Expand Down