-
Notifications
You must be signed in to change notification settings - Fork 29
1.10 enablement #330
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
1.10 enablement #330
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,14 @@ if VERSION < v"1.10.0-DEV.1365" | |
end | ||
|
||
# triangular | ||
if isdefined(LinearAlgebra, :generic_trimatmul!) # VERSION >= v"1.10-DEVXYZ" | ||
# multiplication | ||
LinearAlgebra.generic_trimatmul!(c::oneStridedVector{T}, uploc, isunitc, tfun::Function, A::oneStridedMatrix{T}, b::AbstractVector{T}) where {T<:onemklFloat} = | ||
trmv!(uploc, tfun === identity ? 'N' : tfun === transpose ? 'T' : 'C', isunitc, A, c === b ? c : copyto!(c, b)) | ||
# division | ||
LinearAlgebra.generic_trimatdiv!(C::oneStridedVector{T}, uploc, isunitc, tfun::Function, A::oneStridedMatrix{T}, B::AbstractVector{T}) where {T<:onemklFloat} = | ||
trsv!(uploc, tfun === identity ? 'N' : tfun === transpose ? 'T' : 'C', isunitc, A, C === B ? C : copyto!(C, B)) | ||
else | ||
## direct multiplication/division | ||
for (t, uploc, isunitc) in ((:LowerTriangular, 'L', 'N'), | ||
(:UnitLowerTriangular, 'L', 'U'), | ||
|
@@ -183,6 +191,7 @@ for (t, uploc, isunitc) in ((:LowerTriangular, 'U', 'N'), | |
trsv!($uploc, 'C', $isunitc, parent(parent(A)), B) | ||
end | ||
end | ||
end # VERSION | ||
|
||
|
||
# | ||
|
@@ -254,23 +263,34 @@ end | |
end # VERSION | ||
|
||
# triangular | ||
if isdefined(LinearAlgebra, :generic_trimatmul!) # VERSION >= v"1.10-DEVXYZ" | ||
LinearAlgebra.generic_trimatmul!(C::oneStridedMatrix{T}, uploc, isunitc, tfun::Function, A::oneStridedMatrix{T}, B::oneStridedMatrix{T}) where {T<:onemklFloat} = | ||
trmm!('L', uploc, tfun === identity ? 'N' : tfun === transpose ? 'T' : 'C', isunitc, one(T), A, C === B ? C : copyto!(C, B)) | ||
LinearAlgebra.generic_mattrimul!(C::oneStridedMatrix{T}, uploc, isunitc, tfun::Function, A::oneStridedMatrix{T}, B::oneStridedMatrix{T}) where {T<:onemklFloat} = | ||
trmm!('R', uploc, tfun === identity ? 'N' : tfun === transpose ? 'T' : 'C', isunitc, one(T), B, C === A ? C : copyto!(C, A)) | ||
LinearAlgebra.generic_trimatdiv!(C::oneStridedMatrix{T}, uploc, isunitc, tfun::Function, A::oneStridedMatrix{T}, B::oneStridedMatrix{T}) where {T<:onemklFloat} = | ||
trsm!('L', uploc, tfun === identity ? 'N' : tfun === transpose ? 'T' : 'C', isunitc, one(T), A, C === B ? C : copyto!(C, B)) | ||
LinearAlgebra.generic_mattridiv!(C::oneStridedMatrix{T}, uploc, isunitc, tfun::Function, A::oneStridedMatrix{T}, B::oneStridedMatrix{T}) where {T<:onemklFloat} = | ||
trsm!('R', uploc, tfun === identity ? 'N' : tfun === transpose ? 'T' : 'C', isunitc, one(T), B, C === A ? C : copyto!(C, A)) | ||
else | ||
## direct multiplication/division | ||
for (t, uploc, isunitc) in ((:LowerTriangular, 'L', 'N'), | ||
(:UnitLowerTriangular, 'L', 'U'), | ||
(:UpperTriangular, 'U', 'N'), | ||
(:UnitUpperTriangular, 'U', 'U')) | ||
@eval begin | ||
# Multiplication | ||
LinearAlgebra.lmul!(A::$t{T,<:oneStridedVecOrMat}, | ||
B::oneStridedVecOrMat{T}) where {T<:onemklFloat} = | ||
trmm!('L', $uploc, 'N', $isunitc, one(T), parent(A), B, B) | ||
LinearAlgebra.rmul!(A::oneStridedVecOrMat{T}, | ||
B::$t{T,<:oneStridedVecOrMat}) where {T<:onemklFloat} = | ||
trmm!('R', $uploc, 'N', $isunitc, one(T), parent(B), A, A) | ||
Comment on lines
-264
to
-269
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the signature of |
||
LinearAlgebra.lmul!(A::$t{T,<:oneStridedMatrix}, | ||
B::oneStridedMatrix{T}) where {T<:onemklFloat} = | ||
trmm!('L', $uploc, 'N', $isunitc, one(T), parent(A), B) | ||
LinearAlgebra.rmul!(A::oneStridedMatrix{T}, | ||
B::$t{T,<:oneStridedMatrix}) where {T<:onemklFloat} = | ||
trmm!('R', $uploc, 'N', $isunitc, one(T), parent(B), A) | ||
|
||
# Left division | ||
LinearAlgebra.ldiv!(A::$t{T,<:oneStridedVecOrMat}, | ||
B::oneStridedVecOrMat{T}) where {T<:onemklFloat} = | ||
LinearAlgebra.ldiv!(A::$t{T,<:oneStridedMatrix}, | ||
B::oneStridedMatrix{T}) where {T<:onemklFloat} = | ||
trsm!('L', $uploc, 'N', $isunitc, one(T), parent(A), B) | ||
end | ||
end | ||
end # VERSION |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1100,7 +1100,7 @@ function trmm(side::Char, | |
alpha::Number, | ||
A::oneStridedMatrix{T}, | ||
B::oneStridedMatrix{T}) where T | ||
trmm!(side, uplo, transa, diag, alpha, A, B) | ||
trmm!(side, uplo, transa, diag, alpha, A, copy(B)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was oversight, and the corresponding test required an according change. |
||
end | ||
function trsm(side::Char, | ||
uplo::Char, | ||
|
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.
This adds
rdiv!
-functionality, which could be included in the "old" branch below.