Skip to content

Commit

Permalink
Merge pull request #2 from jagot/fix-AdjOrTransDenseMatrix
Browse files Browse the repository at this point in the history
Rename AdjOrTransStridedOrTriangularMatrix -> AdjOrTransDenseMatrix
  • Loading branch information
rasmushenningsson authored Feb 9, 2021
2 parents f017f63 + 6af9b20 commit 8d878b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ThreadedSparseArrays"
uuid = "59d54670-b8ac-4d81-ab7a-bb56233e17ab"
authors = ["Stefanos Carlström <[email protected]>"]
version = "0.1.0"
version = "0.1.1"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
15 changes: 10 additions & 5 deletions src/ThreadedSparseArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ module ThreadedSparseArrays
using LinearAlgebra
import LinearAlgebra: mul!
using SparseArrays
import SparseArrays: AdjOrTransStridedOrTriangularMatrix, getcolptr
import SparseArrays: getcolptr
const AdjOrTransDenseMatrix = if VERSION < v"1.7.0-DEV.499"
SparseArrays.AdjOrTransStridedOrTriangularMatrix
else
SparseArrays.AdjOrTransDenseMatrix
end

# * Threading utilities
struct RangeIterator
Expand Down Expand Up @@ -48,7 +53,7 @@ for f in [:rowvals, :nonzeros, :getcolptr]
@eval SparseArrays.$(f)(A::ThreadedSparseMatrixCSC) = SparseArrays.$(f)(A.A)
end

function mul!(C::StridedVecOrMat, A::ThreadedSparseMatrixCSC, B::Union{StridedVector,AdjOrTransStridedOrTriangularMatrix}, α::Number, β::Number)
function mul!(C::StridedVecOrMat, A::ThreadedSparseMatrixCSC, B::Union{StridedVector,AdjOrTransDenseMatrix}, α::Number, β::Number)
size(A, 2) == size(B, 1) || throw(DimensionMismatch())
size(A, 1) == size(C, 1) || throw(DimensionMismatch())
size(B, 2) == size(C, 2) || throw(DimensionMismatch())
Expand All @@ -70,7 +75,7 @@ function mul!(C::StridedVecOrMat, A::ThreadedSparseMatrixCSC, B::Union{StridedVe
C
end

function mul!(C::StridedVecOrMat, adjA::Adjoint{<:Any,<:ThreadedSparseMatrixCSC}, B::AdjOrTransStridedOrTriangularMatrix, α::Number, β::Number)
function mul!(C::StridedVecOrMat, adjA::Adjoint{<:Any,<:ThreadedSparseMatrixCSC}, B::AdjOrTransDenseMatrix, α::Number, β::Number)
A = adjA.parent
size(A, 2) == size(C, 1) || throw(DimensionMismatch())
size(A, 1) == size(B, 1) || throw(DimensionMismatch())
Expand Down Expand Up @@ -118,7 +123,7 @@ function mul!(C::StridedVecOrMat, adjA::Adjoint{<:Any,<:ThreadedSparseMatrixCSC}
C
end

function mul!(C::StridedVecOrMat, transA::Transpose{<:Any,<:ThreadedSparseMatrixCSC}, B::AdjOrTransStridedOrTriangularMatrix, α::Number, β::Number)
function mul!(C::StridedVecOrMat, transA::Transpose{<:Any,<:ThreadedSparseMatrixCSC}, B::AdjOrTransDenseMatrix, α::Number, β::Number)
A = transA.parent
size(A, 2) == size(C, 1) || throw(DimensionMismatch())
size(A, 1) == size(B, 1) || throw(DimensionMismatch())
Expand Down Expand Up @@ -164,7 +169,7 @@ function mul!(C::StridedVecOrMat, transA::Transpose{<:Any,<:ThreadedSparseMatrix
C
end

function mul!(C::StridedVecOrMat, X::AdjOrTransStridedOrTriangularMatrix, A::ThreadedSparseMatrixCSC, α::Number, β::Number)
function mul!(C::StridedVecOrMat, X::AdjOrTransDenseMatrix, A::ThreadedSparseMatrixCSC, α::Number, β::Number)
mX, nX = size(X)
nX == size(A, 1) || throw(DimensionMismatch())
mX == size(C, 1) || throw(DimensionMismatch())
Expand Down

2 comments on commit 8d878b9

@rasmushenningsson
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Patch notes:

Compatibility fix for Julia nightly.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/29730

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.1 -m "<description of version>" 8d878b97b78cef3ce6bacaaf9372a3be3f50a2bc
git push origin v0.1.1

Please sign in to comment.