Skip to content

Commit 8c3994f

Browse files
committed
2 parents 45b5582 + 30af899 commit 8c3994f

File tree

9 files changed

+130
-12
lines changed

9 files changed

+130
-12
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@ jobs:
1414
version:
1515
- '1.6'
1616
- '1'
17+
- '^1.9.0-0'
1718
os:
1819
- ubuntu-latest
1920
- macOS-latest
2021
- windows-latest
2122
arch:
2223
- x64
2324
steps:
24-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2526
- uses: julia-actions/setup-julia@v1
2627
with:
2728
version: ${{ matrix.version }}
2829
arch: ${{ matrix.arch }}
29-
- uses: actions/cache@v1
30+
- uses: actions/cache@v3
3031
env:
3132
cache-name: cache-artifacts
3233
with:
@@ -39,14 +40,14 @@ jobs:
3940
- uses: julia-actions/julia-buildpkg@v1
4041
- uses: julia-actions/julia-runtest@v1
4142
- uses: julia-actions/julia-processcoverage@v1
42-
- uses: codecov/codecov-action@v1
43+
- uses: codecov/codecov-action@v3
4344
with:
4445
file: lcov.info
4546
docs:
4647
name: Documentation
4748
runs-on: ubuntu-latest
4849
steps:
49-
- uses: actions/checkout@v2
50+
- uses: actions/checkout@v3
5051
- uses: julia-actions/setup-julia@v1
5152
with:
5253
version: '1'

.github/workflows/downstream.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: IntegrationTest
2+
on:
3+
push:
4+
branches: [master]
5+
tags: [v*]
6+
pull_request:
7+
paths-ignore:
8+
- 'LICENSE'
9+
- 'README.md'
10+
- '.github/workflows/TagBot.yml'
11+
12+
jobs:
13+
pre_job:
14+
# continue-on-error: true # Uncomment once integration is finished
15+
runs-on: ubuntu-latest
16+
# Map a step output to a job output
17+
outputs:
18+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
19+
steps:
20+
- id: skip_check
21+
uses: fkirc/skip-duplicate-actions@v5
22+
test:
23+
needs: pre_job
24+
if: needs.pre_job.outputs.should_skip != 'true'
25+
name: ${{ matrix.package.group }}/${{ matrix.package.repo }}/${{ matrix.julia-version }}
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: true
29+
matrix:
30+
julia-version: ['1']
31+
os: [ubuntu-latest]
32+
package:
33+
- {repo: BlockArrays.jl, group: JuliaArrays}
34+
- {repo: BandedMatrices.jl, group: JuliaLinearAlgebra}
35+
- {repo: BlockBandedMatrices.jl, group: JuliaLinearAlgebra}
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: julia-actions/setup-julia@v1
40+
with:
41+
version: ${{ matrix.julia-version }}
42+
arch: x64
43+
- uses: julia-actions/julia-buildpkg@latest
44+
- name: Clone Downstream
45+
uses: actions/checkout@v3
46+
with:
47+
repository: ${{ matrix.package.group }}/${{ matrix.package.repo }}
48+
path: downstream
49+
- name: Load this and run the downstream tests
50+
shell: julia --color=yes --project=downstream {0}
51+
run: |
52+
using Pkg
53+
try
54+
# force it to use this PR's version of the package
55+
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
56+
Pkg.update()
57+
Pkg.test(; coverage = true) # resolver may fail with test time deps
58+
catch err
59+
err isa Pkg.Resolve.ResolverError || rethrow()
60+
# If we can't resolve that means this is incompatible by SemVer and this is fine
61+
# It means we marked this as a breaking change, so we don't need to worry about
62+
# Mistakenly introducing a breaking change, as we have intentionally made one
63+
@info "Not compatible with this release. No problem." exception=err
64+
exit(0) # Exit immediately, as a success
65+
end
66+
- uses: julia-actions/julia-processcoverage@v1
67+
- uses: codecov/codecov-action@v3
68+
with:
69+
files: lcov.info

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ArrayLayouts"
22
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
33
authors = ["Sheehan Olver <solver@mac.com>"]
4-
version = "0.8.16"
4+
version = "0.8.18"
55

66
[deps]
77
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"

src/ArrayLayouts.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ using Base.Broadcast: Broadcasted
1515

1616
import Base.Broadcast: BroadcastStyle, broadcastable, instantiate, materialize, materialize!
1717

18-
using LinearAlgebra: AbstractTriangular, AbstractQ, QRCompactWYQ, QRPackedQ, checksquare,
19-
pinv, tilebufsize, cholcopy,
18+
using LinearAlgebra: AbstractQ, QRCompactWYQ, QRPackedQ, HessenbergQ,
19+
AbstractTriangular, checksquare, pinv, tilebufsize, cholcopy,
2020
norm2, norm1, normInf, normMinusInf,
2121
AdjOrTrans, HermOrSym, RealHermSymComplexHerm, AdjointAbsVec, TransposeAbsVec,
2222
checknonsingular, _apply_ipiv_rows!, ipiv2perm, chkfullrank

src/ldiv.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ macro _layoutldiv(Typ)
135135
LinearAlgebra.ldiv!(A::Factorization, x::$Typ; kwds...) = ArrayLayouts.ldiv!(A,x; kwds...)
136136
LinearAlgebra.ldiv!(A::LU, x::$Typ; kwds...) = ArrayLayouts.ldiv!(A,x; kwds...)
137137
LinearAlgebra.ldiv!(A::Cholesky, x::$Typ; kwds...) = ArrayLayouts.ldiv!(A,x; kwds...)
138+
LinearAlgebra.ldiv!(A::LinearAlgebra.QRCompactWY, x::$Typ; kwds...) = ArrayLayouts.ldiv!(A,x; kwds...)
138139

139140
LinearAlgebra.ldiv!(A::Bidiagonal, B::$Typ; kwds...) = ArrayLayouts.ldiv!(A,B; kwds...)
140141

src/mul.jl

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,21 @@ check_mul_axes(A) = nothing
8888
_check_mul_axes(::Number, ::Number) = nothing
8989
_check_mul_axes(::Number, _) = nothing
9090
_check_mul_axes(_, ::Number) = nothing
91-
_check_mul_axes(A, B) = axes(A,2) == axes(B,1) || throw(DimensionMismatch("Second axis of A, $(axes(A,2)), and first axis of B, $(axes(B,1)) must match"))
91+
_check_mul_axes(A, B) = axes(A, 2) == axes(B, 1) || throw(DimensionMismatch("Second axis of A, $(axes(A,2)), and first axis of B, $(axes(B,1)) must match"))
92+
# we need to special case AbstractQ as it allows non-compatiple multiplication
93+
const FlexibleLeftQs = Union{QRCompactWYQ,QRPackedQ,HessenbergQ}
94+
_check_mul_axes(::FlexibleLeftQs, ::Number) = nothing
95+
_check_mul_axes(Q::FlexibleLeftQs, B) =
96+
axes(Q.factors, 1) == axes(B, 1) || axes(Q.factors, 2) == axes(B, 1) ||
97+
throw(DimensionMismatch("First axis of B, $(axes(B,1)) must match either axes of A, $(axes(Q.factors))"))
98+
_check_mul_axes(::Number, ::AdjointQtype{<:Any,<:FlexibleLeftQs}) = nothing
99+
function _check_mul_axes(A, adjQ::AdjointQtype{<:Any,<:FlexibleLeftQs})
100+
Q = parent(adjQ)
101+
axes(A, 2) == axes(Q.factors, 1) || axes(A, 2) == axes(Q.factors, 2) ||
102+
throw(DimensionMismatch("Second axis of A, $(axes(A,2)) must match either axes of B, $(axes(Q.factors))"))
103+
end
104+
_check_mul_axes(Q::FlexibleLeftQs, adjQ::AdjointQtype{<:Any,<:FlexibleLeftQs}) =
105+
invoke(_check_mul_axes, Tuple{Any,Any}, Q, adjQ)
92106
function check_mul_axes(A, B, C...)
93107
_check_mul_axes(A, B)
94108
check_mul_axes(B, C...)
@@ -118,8 +132,6 @@ mul!(dest::AbstractArray, A::AbstractArray, B::AbstractArray, α::Number, β::Nu
118132

119133
broadcastable(M::Mul) = M
120134

121-
const FlexibleLeftQs = Union{LinearAlgebra.HessenbergQ, LinearAlgebra.QRCompactWYQ, LinearAlgebra.QRPackedQ}
122-
123135
macro veclayoutmul(Typ)
124136
ret = quote
125137
(*)(A::AbstractMatrix, B::$Typ) = ArrayLayouts.mul(A,B)
@@ -139,6 +151,7 @@ macro veclayoutmul(Typ)
139151
ret = quote
140152
$ret
141153

154+
const FlexibleLeftQs = Union{LinearAlgebra.HessenbergQ, LinearAlgebra.QRCompactWYQ, LinearAlgebra.QRPackedQ}
142155
# disambiguation for flexible left-mul Qs
143156
(*)(A::FlexibleLeftQs, B::$Typ) = ArrayLayouts.mul(A,B)
144157
# flexible right-mul/adjoint left-mul Qs
@@ -213,6 +226,7 @@ macro layoutmul(Typ)
213226
ret = quote
214227
$ret
215228

229+
const FlexibleLeftQs = Union{LinearAlgebra.HessenbergQ, LinearAlgebra.QRCompactWYQ, LinearAlgebra.QRPackedQ}
216230
# disambiguation for flexible left-mul/adjoint right-mul Qs
217231
(*)(A::FlexibleLeftQs, B::$Typ) = ArrayLayouts.mul(A,B)
218232
(*)(A::$Typ, B::LinearAlgebra.AdjointQ{<:Any,<:FlexibleLeftQs}) = ArrayLayouts.mul(A,B)

test/test_layoutarray.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,16 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
129129

130130
@testset "ldiv!" begin
131131
c = MyVector(randn(5))
132-
@test_broken ldiv!(lu(A), MyVector(copy(c))) A \ c
133-
@test_throws ErrorException ldiv!(qr(A), MyVector(copy(c)))
132+
if VERSION < v"1.9-"
133+
@test_broken ldiv!(lu(A), MyVector(copy(c))) A \ c
134+
else
135+
@test ldiv!(lu(A), MyVector(copy(c))) A \ c
136+
end
137+
if VERSION < v"1.9-" || VERSION >= v"1.10-"
138+
@test_throws ErrorException ldiv!(qr(A), MyVector(copy(c)))
139+
else
140+
@test_throws MethodError ldiv!(qr(A), MyVector(copy(c)))
141+
end
134142
@test_throws ErrorException ldiv!(eigen(randn(5,5)), c)
135143
@test ArrayLayouts.ldiv!(svd(A.A), copy(c)) ArrayLayouts.ldiv!(similar(c), svd(A.A), c) A \ c
136144
if VERSION v"1.8"

test/test_muladd.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,9 +615,12 @@ Random.seed!(0)
615615
Q = qr(randn(5,5)).Q
616616
b = randn(5)
617617
B = randn(5,5)
618+
@test Q*1.0 == ArrayLayouts.lmul!(Q, Matrix{Float64}(I, 5, 5))
618619
@test Q*b == ArrayLayouts.lmul!(Q, copy(b)) == mul(Q,b)
619620
@test Q*B == ArrayLayouts.lmul!(Q, copy(B)) == mul(Q,B)
620621
@test B*Q == ArrayLayouts.rmul!(copy(B), Q) == mul(B,Q)
622+
@test 1.0*Q ArrayLayouts.rmul!(Matrix{Float64}(I, 5, 5), Q)
623+
@test 1.0*Q' ArrayLayouts.rmul!(Matrix{Float64}(I, 5, 5), Q')
621624
@test Q*Q mul(Q,Q)
622625
@test Q'*b == ArrayLayouts.lmul!(Q', copy(b)) == mul(Q',b)
623626
@test Q'*B == ArrayLayouts.lmul!(Q', copy(B)) == mul(Q',B)
@@ -627,6 +630,21 @@ Random.seed!(0)
627630
@test Q'*Q mul(Q',Q)
628631
@test Q*UpperTriangular(B) mul(Q, UpperTriangular(B))
629632
@test UpperTriangular(B)*Q mul(UpperTriangular(B), Q)
633+
634+
Q = qr(randn(7,5)).Q
635+
b = randn(5)
636+
B = randn(5,5)
637+
@test Q*1.0 == ArrayLayouts.lmul!(Q, Matrix{Float64}(I, 7, 7))
638+
@test Q*b == mul(Q,b)
639+
@test Q*B == mul(Q,B)
640+
@test 1.0*Q ArrayLayouts.rmul!(Matrix{Float64}(I, 7, 7), Q)
641+
@test Q*Q mul(Q,Q)
642+
@test B*Q' == mul(B,Q')
643+
@test Q*Q' mul(Q,Q')
644+
@test Q'*Q' mul(Q',Q')
645+
@test Q'*Q mul(Q',Q)
646+
VERSION >= v"1.8-" && @test Q*UpperTriangular(B) mul(Q, UpperTriangular(B))
647+
@test UpperTriangular(B)*Q' mul(UpperTriangular(B), Q')
630648
end
631649

632650
@testset "Mul" begin

0 commit comments

Comments
 (0)