Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 736f807

Browse files
authoredMar 8, 2024
Merge pull request #4 from HoBeZwe/master
remove beta-only merged_add! + reintroduce precompilation
2 parents e1c54df + 309cd59 commit 736f807

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed
 

‎Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
authors = ["Yutaka Masuda <yutaka@uga.edu>"]
22
name = "SparseMatrixDicts"
33
uuid = "5cb6c4b0-9b79-11e8-24c9-f9621d252589"
4-
version = "0.2.8"
4+
version = "0.3.0"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

‎src/SparseMatrixDicts.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
__precompile__(false)
3-
42
# sparse matrix with dictionary (a.k.a. hash matrix)
53

64
# The sparse dictionary matrix (smd) is assumed to be used as
@@ -212,7 +210,7 @@ end
212210

213211
"""
214212
merged_add!(A,B)
215-
merged_add!(A,B, β=1.0)
213+
merged_add!(A,B, α=1.0)
216214
merged_add!(A,B, α=1.0,β=1.0)
217215
218216
It updates `A` by `αA + βB` (i.e., performing `A = αA + βB`). The default (α,β) is (1.0,1.0), which results in `A + B`.
@@ -227,9 +225,6 @@ function merged_add!(A::SparseMatrixDict{Tv,Ti}, B::SparseMatrixDict{Tv,Ti}, α:
227225
A[idx] = A[idx] + β*B[idx]
228226
end
229227
end
230-
function merged_add!(A::SparseMatrixDict{Tv,Ti}, B::SparseMatrixDict{Tv,Ti}, β::Tv=1.0) where {Tv,Ti<:Integer}
231-
merged_add!(A,B,1.0,β)
232-
end
233228

234229
# setindex
235230

‎test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ end
228228
@test typeof(sC) == typeof(sB)
229229
@test dC Matrix(sC)
230230

231-
α = 1.0
232-
β = 1.5
231+
α = 1.5
232+
β = 1.0
233233
dC = α*dA + β*dB
234234
sC = copy(sA)
235-
merged_add!(sC,sB,β)
235+
merged_add!(sC,sB,α)
236236
@test dC Matrix(sC)
237237
sC = copy(sA)
238238
merged_add!(sC,sB,α,β)

2 commit comments

Comments
 (2)

masuday commented on Mar 8, 2024

@masuday
OwnerAuthor

JuliaRegistrator commented on Mar 8, 2024

@JuliaRegistrator

Registration pull request created: JuliaRegistries/General/102514

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.3.0 -m "<description of version>" 736f807a406be8e65bf4891aeb411ef0ec482a2d
git push origin v0.3.0
Please sign in to comment.