Skip to content

Commit 0b37017

Browse files
authored
Drop support for Julia 1.6 and make 1.10 the new minimum (#346)
1 parent 4fc2230 commit 0b37017

5 files changed

Lines changed: 37 additions & 52 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
# MutableArithmetics doesn't have any binary dependencies, so just test
1919
# on Linux, LTS and current release, 64-bit and 32-bit.
2020
include:
21-
- version: '1.6'
21+
- version: '1.10'
2222
os: ubuntu-latest
2323
arch: x86
24-
- version: '1.6'
24+
- version: '1.10'
2525
os: ubuntu-latest
2626
arch: x64
2727
- version: '1'

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v6
1313
- uses: julia-actions/setup-julia@latest
1414
with:
15-
version: '1.6'
15+
version: '1.10'
1616
- name: Install dependencies
1717
run: julia --project=docs/ --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
1818
- name: Build and deploy

.github/workflows/downstream.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
julia-version: ['1.6', '1']
13+
julia-version: ['1.10', '1']
1414
os: ['ubuntu-latest']
1515
package:
1616
- {user: jump-dev, repo: JuMP.jl}

Project.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
name = "MutableArithmetics"
22
uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0"
3-
authors = ["Gilles Peiffer", "Benoît Legat", "Sascha Timme"]
43
version = "1.6.7"
4+
authors = ["Gilles Peiffer", "Benoît Legat", "Sascha Timme"]
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
88
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
99
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1010

1111
[compat]
12-
LinearAlgebra = "<0.0.1, 1.6"
12+
LinearAlgebra = "1"
1313
OffsetArrays = "1"
14-
Random = "<0.0.1, 1.6"
15-
SparseArrays = "<0.0.1, 1.6"
16-
Test = "<0.0.1, 1.6"
17-
julia = "1.6"
14+
Random = "1"
15+
SparseArrays = "1"
16+
Test = "1"
17+
julia = "1.10"
1818

1919
[extras]
2020
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"

src/dispatch.jl

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -372,33 +372,30 @@ for f_A in _MatrixLike, f_B in vcat(_MatrixLike, T -> StridedVector{<:T})
372372
end
373373
end
374374

375-
# See https://github.com/JuliaLang/julia/pull/37898
376-
# The default fallback only used `promote_type` so it may get its wrong, e.g.,
377-
# for JuMP and MultivariatePolynomials.
378-
if VERSION >= v"1.7.0-DEV.1284"
379-
using LinearAlgebra: StridedMaybeAdjOrTransMat
380-
_mat_mat_scalar(A, B, γ) = operate!!(*, operate(*, A, B), γ)
381-
function LinearAlgebra.mat_mat_scalar(
382-
A::StridedMaybeAdjOrTransMat{<:AbstractMutable},
383-
B::StridedMaybeAdjOrTransMat,
384-
γ,
385-
)
386-
return _mat_mat_scalar(A, B, γ)
387-
end
388-
function LinearAlgebra.mat_mat_scalar(
389-
A::StridedMaybeAdjOrTransMat,
390-
B::StridedMaybeAdjOrTransMat{<:AbstractMutable},
391-
γ,
392-
)
393-
return _mat_mat_scalar(A, B, γ)
394-
end
395-
function LinearAlgebra.mat_mat_scalar(
396-
A::StridedMaybeAdjOrTransMat{<:AbstractMutable},
397-
B::StridedMaybeAdjOrTransMat{<:AbstractMutable},
398-
γ,
399-
)
400-
return _mat_mat_scalar(A, B, γ)
401-
end
375+
_mat_mat_scalar(A, B, γ) = operate!!(*, operate(*, A, B), γ)
376+
377+
function LinearAlgebra.mat_mat_scalar(
378+
A::LinearAlgebra.StridedMaybeAdjOrTransMat{<:AbstractMutable},
379+
B::LinearAlgebra.StridedMaybeAdjOrTransMat,
380+
γ,
381+
)
382+
return _mat_mat_scalar(A, B, γ)
383+
end
384+
385+
function LinearAlgebra.mat_mat_scalar(
386+
A::LinearAlgebra.StridedMaybeAdjOrTransMat,
387+
B::LinearAlgebra.StridedMaybeAdjOrTransMat{<:AbstractMutable},
388+
γ,
389+
)
390+
return _mat_mat_scalar(A, B, γ)
391+
end
392+
393+
function LinearAlgebra.mat_mat_scalar(
394+
A::LinearAlgebra.StridedMaybeAdjOrTransMat{<:AbstractMutable},
395+
B::LinearAlgebra.StridedMaybeAdjOrTransMat{<:AbstractMutable},
396+
γ,
397+
)
398+
return _mat_mat_scalar(A, B, γ)
402399
end
403400

404401
# Base doesn't define efficient fallbacks for sparse array arithmetic involving
@@ -614,18 +611,6 @@ end
614611
# the type by default.
615612
Base.zero(x::AbstractMutable) = zero(typeof(x))
616613

617-
# This was fixed in https://github.com/JuliaLang/julia/pull/36194 but then
618-
# reverted. Fixed again in https://github.com/JuliaLang/julia/pull/38789/.
619-
if VERSION >= v"1.7.0-DEV.872"
620-
# `AbstractMutable` objects are more likely to implement `iszero` than `==`
621-
# with `Int`.
622-
LinearAlgebra.iszerodefined(::Type{<:AbstractMutable}) = true
623-
else
624-
# To determine whether the funtion is zero preserving, `LinearAlgebra` calls
625-
# `zero` on the `eltype` of the broadcasted object and then check `_iszero`.
626-
# `_iszero(x)` redirects to `iszero(x)` for numbers and to `x == 0`
627-
# otherwise.
628-
# `x == 0` returns false for types that implement `iszero` but not `==` such
629-
# as `DummyBigInt` and MOI functions.
630-
LinearAlgebra._iszero(x::AbstractMutable) = iszero(x)
631-
end
614+
# `AbstractMutable` objects are more likely to implement `iszero` than `==`
615+
# with `Int`.
616+
LinearAlgebra.iszerodefined(::Type{<:AbstractMutable}) = true

0 commit comments

Comments
 (0)