Skip to content

Commit 7f94ae9

Browse files
authored
Vector indexing a PseudoBlockArray of a FillArray (#378)
1 parent d2a05fe commit 7f94ae9

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BlockArrays"
22
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
3-
version = "0.16.43"
3+
version = "0.16.44-dev"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/pseudo_blockarray.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,9 @@ Base.replace_in_print_matrix(f::PseudoBlockVecOrMat, i::Integer, j::Integer, s::
356356

357357

358358
LinearAlgebra.norm(A::PseudoBlockArray, p::Real=2) = norm(A.blocks, p)
359+
360+
###########################
361+
# FillArrays interface #
362+
###########################
363+
364+
FillArrays.getindex_value(P::PseudoBlockArray) = FillArrays.getindex_value(P.blocks)

test/test_blockarrays.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,13 @@ end
555555
@test BLAS.gemv!('N', 2.0, A, x, 0.0, y) 2A*x
556556
end
557557

558+
@testset "FillArrays interface" begin
559+
P = PseudoBlockArray(Fill(3,4,4), [1,3], [1,3])
560+
@test P[1:3, 2:3] === Fill(3,3,2)
561+
@test P[1:3, 1] == Fill(3,3)
562+
@test P[2, 1:3] == Fill(3,3)
563+
end
564+
558565
@testset "lmul!/rmul!" begin
559566
A = PseudoBlockArray{Float64}(undef, 1:3)
560567
@test fill!(A, NaN) === A

0 commit comments

Comments
 (0)