Skip to content

Commit 7ed1d16

Browse files
authored
Revert Base._cat overload (#124)
1 parent 580cc97 commit 7ed1d16

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

.github/workflows/TagBot.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: TagBot
22
on:
3-
schedule:
4-
- cron: '00 00 * * *'
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
57
jobs:
68
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
710
runs-on: ubuntu-latest
811
steps:
912
- uses: JuliaRegistries/TagBot@v1

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "LinearMaps"
22
uuid = "7a12625a-238d-50fd-b39a-03d52299707e"
3-
version = "3.0"
3+
version = "3.0.1"
44

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

src/blockmap.jl

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -442,20 +442,22 @@ for k in 1:8 # is 8 sufficient?
442442
mapargs = ntuple(n ->:($(Symbol(:A, n))), Val(k-1))
443443
# yields (:LinearMap(A1), :LinearMap(A2), ..., :LinearMap(A(k-1)))
444444

445-
@eval function SparseArrays.blockdiag($(Is...), $L, As::MapOrVecOrMat...)
446-
return BlockDiagonalMap(convert_to_lmaps($(mapargs...))...,
447-
$(Symbol(:A, k)),
448-
convert_to_lmaps(As...)...)
449-
end
450-
end
445+
@eval begin
446+
function SparseArrays.blockdiag($(Is...), $L, As::MapOrVecOrMat...)
447+
return BlockDiagonalMap(convert_to_lmaps($(mapargs...))...,
448+
$(Symbol(:A, k)),
449+
convert_to_lmaps(As...)...)
450+
end
451451

452-
# This method is more generic than Base._cat(catdims, A::AbstractArray...), and
453-
# therefore does not override Base/StdLib behavior
454-
function Base._cat(dims, As::MapOrVecOrMat...)
455-
if dims::Dims{2} == (1, 2)
456-
return BlockDiagonalMap(convert_to_lmaps(As...)...)
457-
else
458-
throw(ArgumentError("dims keyword in cat of LinearMaps must be (1,2)"))
452+
function Base.cat($(Is...), $L, As::MapOrVecOrMat...; dims::Dims{2})
453+
if dims == (1,2)
454+
return BlockDiagonalMap(convert_to_lmaps($(mapargs...))...,
455+
$(Symbol(:A, k)),
456+
convert_to_lmaps(As...)...)
457+
else
458+
throw(ArgumentError("dims keyword in cat of LinearMaps must be (1,2)"))
459+
end
460+
end
459461
end
460462
end
461463

@@ -472,8 +474,8 @@ SparseArrays.blockdiag
472474
cat(As::Union{LinearMap,AbstractVecOrMat}...; dims=(1,2))::BlockDiagonalMap
473475
474476
Construct a (lazy) representation of the diagonal concatenation of the arguments.
475-
To avoid fallback to the generic `Base.cat`, there must be a `LinearMap` object
476-
among the arguments, without any restriction on its position.
477+
To avoid fallback to the generic `Base.cat`, there must be a `LinearMap`
478+
object among the first 8 arguments.
477479
"""
478480
Base.cat
479481

0 commit comments

Comments
 (0)