Skip to content

Commit 88d042e

Browse files
committed
PseudoBlock -> Blocked
1 parent 67a2504 commit 88d042e

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

src/banded/infbanded.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ sub_materialize(_, V, ::Tuple{BlockedOneTo{Int,<:InfRanges}}) = V
385385
sub_materialize(::AbstractBlockLayout, V, ::Tuple{BlockedOneTo{Int,<:InfRanges}}) = V
386386
function sub_materialize(::PaddedColumns, v::AbstractVector{T}, ax::Tuple{BlockedOneTo{Int,<:InfRanges}}) where T
387387
dat = paddeddata(v)
388-
PseudoBlockVector(Vcat(sub_materialize(dat), Zeros{T}(∞)), ax)
388+
BlockedVector(Vcat(sub_materialize(dat), Zeros{T}(∞)), ax)
389389
end
390390

391391
##

src/blockbanded/blockbanded.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ BroadcastStyle(::Type{<:SubArray{T,N,Arr,<:NTuple{N,BlockSlice{BlockRange{1,Tupl
6868

6969
# TODO: generalise following
7070
BroadcastStyle(::Type{<:BlockArray{T,N,<:AbstractArray{<:AbstractArray{T,N},N},<:NTuple{N,BlockedOneTo{Int,<:InfRanges}}}}) where {T,N} = LazyArrayStyle{N}()
71-
# BroadcastStyle(::Type{<:PseudoBlockArray{T,N,<:AbstractArray{T,N},<:NTuple{N,BlockedOneTo{Int,<:InfRanges}}}}) where {T,N} = LazyArrayStyle{N}()
71+
# BroadcastStyle(::Type{<:BlockedArray{T,N,<:AbstractArray{T,N},<:NTuple{N,BlockedOneTo{Int,<:InfRanges}}}}) where {T,N} = LazyArrayStyle{N}()
7272
BroadcastStyle(::Type{<:BlockArray{T,N,<:AbstractArray{<:AbstractArray{T,N},N},<:NTuple{N,BlockedOneTo{Int,<:RangeCumsum{Int,<:InfRanges}}}}}) where {T,N} = LazyArrayStyle{N}()
73-
# BroadcastStyle(::Type{<:PseudoBlockArray{T,N,<:AbstractArray{T,N},<:NTuple{N,BlockedOneTo{Int,<:RangeCumsum{Int,<:InfRanges}}}}}) where {T,N} = LazyArrayStyle{N}()
73+
# BroadcastStyle(::Type{<:BlockedArray{T,N,<:AbstractArray{T,N},<:NTuple{N,BlockedOneTo{Int,<:RangeCumsum{Int,<:InfRanges}}}}}) where {T,N} = LazyArrayStyle{N}()
7474

7575

7676
###

src/infql.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function blocktailiterate(c,a,b, d=c, e=a)
174174
d̃,ẽ = QLPackedQ(F.factors[1:n,n+1:2n],F.τ[1:n])*d̃,QLPackedQ(F.factors[1:n,n+1:2n],F.τ[1:n])*# undo last rotation
175175
if (d̃, d; atol=1E-10) && (ẽ, e; atol=1E-10)
176176
X[1:n,1:n] = d̃; X[1:n,n+1:2n] =
177-
return PseudoBlockArray(X,fill(n,2), fill(n,3)), F.τ[n+1:2n]
177+
return BlockedArray(X,fill(n,2), fill(n,3)), F.τ[n+1:2n]
178178
end
179179
d,e = d̃,ẽ
180180
end

src/infqr.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function partialqr!(F::AdaptiveQRData{<:Any,<:BlockSkylineMatrix}, N::Block{1})
7878
zero!(τ)
7979
else
8080
factors = view(F.data.data,Ñ+1:N+l,Ñ+1:N+u);
81-
_blockbanded_qr!(factors, PseudoBlockVector(τ, (axes(factors,2)[Block(1):(N-Ñ)],)), N-Ñ)
81+
_blockbanded_qr!(factors, BlockedVector(τ, (axes(factors,2)[Block(1):(N-Ñ)],)), N-Ñ)
8282
end
8383
F.ncols = n
8484
end
@@ -197,7 +197,7 @@ function resizedata_chop!(v::CachedVector, tol)
197197
v
198198
end
199199

200-
function resizedata_chop!(v::PseudoBlockVector, tol)
200+
function resizedata_chop!(v::BlockedVector, tol)
201201
c = paddeddata(v.blocks)
202202
n = length(c)
203203
k_tol = choplength(c, tol)
@@ -252,7 +252,7 @@ function materialize!(M::MatLmulVec{<:AdjQRPackedQLayout{<:AdaptiveLayout},<:Abs
252252
resizedata_chop!(B, tolerance)
253253
end
254254

255-
function resizedata!(B::PseudoBlockVector, M::Block{1})
255+
function resizedata!(B::BlockedVector, M::Block{1})
256256
resizedata!(B.blocks, last(axes(B,1)[M]))
257257
B
258258
end
@@ -267,7 +267,7 @@ function materialize!(M::MatLmulVec{<:QRPackedQLayout{<:AdaptiveLayout{<:Abstrac
267267
A,B_in = M.A,M.B
268268
sB = length(paddeddata(B_in))
269269
ax1,ax2 = axes(A.factors.data.data)
270-
B = PseudoBlockVector(B_in, (ax2,))
270+
B = BlockedVector(B_in, (ax2,))
271271
SB = findblock(ax2, sB)
272272
partialqr!(A.factors.data,SB)
273273
JR = Block(1):SB
@@ -285,7 +285,7 @@ function materialize!(M::MatLmulVec{<:AdjQRPackedQLayout{<:AdaptiveLayout{<:Abst
285285
T = eltype(M)
286286
COLGROWTH = 300 # rate to grow columns
287287
ax1,ax2 = axes(A.factors.data.data)
288-
B = PseudoBlockVector(B_in, (ax1,))
288+
B = BlockedVector(B_in, (ax1,))
289289

290290
SB = findblock(ax1, length(paddeddata(B_in)))
291291
MA, NA = blocksize(A.factors.data.data.array)
@@ -334,7 +334,7 @@ function ldiv!(R::UpperTriangular{<:Any,<:AdaptiveQRFactors}, B::CachedVector{<:
334334
end
335335

336336

337-
function ldiv!(R::UpperTriangular{<:Any,<:AdaptiveQRFactors}, B::PseudoBlockArray)
337+
function ldiv!(R::UpperTriangular{<:Any,<:AdaptiveQRFactors}, B::BlockedArray)
338338
n = B.blocks.datasize[1]
339339
N = findblock(axes(R,1),n)
340340
partialqr!(parent(R).data, N)

test/runtests.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end
2929
A = randn(5, 5)
3030
@test chop([A zeros(5, 2); zeros(2, 5) zeros(2, 2)], eps()) == A
3131

32-
c = PseudoBlockArray([randn(5); zeros(10)], (blockedrange(1:5),))
32+
c = BlockedArray([randn(5); zeros(10)], (blockedrange(1:5),))
3333
d = chop!(c, 0)
3434
@test length(d) == 6
3535

@@ -66,7 +66,7 @@ include("test_infbanded.jl")
6666

6767
@test blockedrange(Vcat(2, Fill(3, ∞))) isa BlockedOneTo{<:Any,<:InfiniteArrays.InfStepRange}
6868

69-
c = PseudoBlockArray(1:∞, Vcat(2, Fill(3, ∞)))
69+
c = BlockedArray(1:∞, Vcat(2, Fill(3, ∞)))
7070
@test c[Block.(2:∞)][Block.(2:10)] == c[Block.(3:11)]
7171

7272
@test length(axes(b, 1)) ℵ₀
@@ -91,8 +91,8 @@ include("test_infbanded.jl")
9191
end
9292

9393
@testset "padded" begin
94-
c = PseudoBlockArray([1; zeros(∞)], Vcat(2, Fill(3, ∞)))
95-
@test c + c isa PseudoBlockVector
94+
c = BlockedArray([1; zeros(∞)], Vcat(2, Fill(3, ∞)))
95+
@test c + c isa BlockedVector
9696
end
9797

9898
@testset "concat" begin
@@ -174,7 +174,7 @@ include("test_infbanded.jl")
174174
@test axes(v) isa Tuple{BlockedOneTo{Int,ArrayLayouts.RangeCumsum{Int64,Base.OneTo{Int64}}}}
175175
@test @allocated(axes(v)) 40
176176

177-
dest = PseudoBlockArray{Float64}(undef, axes(v))
177+
dest = BlockedArray{Float64}(undef, axes(v))
178178
@test copyto!(dest, v) == v
179179
@test @allocated(copyto!(dest, v)) 40
180180

@@ -210,14 +210,14 @@ include("test_infbanded.jl")
210210
KR = Block.(Base.OneTo(N))
211211
V = view(dat, Block.(Base.OneTo(N)), :)
212212
@test MemoryLayout(V) isa LazyArrays.ApplyLayout{typeof(hcat)}
213-
@test PseudoBlockArray(V)[Block.(1:5), :] == dat[Block.(1:5), :]
213+
@test BlockedArray(V)[Block.(1:5), :] == dat[Block.(1:5), :]
214214
V = view(dat', :, Block.(Base.OneTo(N)))
215215
@test MemoryLayout(V) isa LazyArrays.ApplyLayout{typeof(vcat)}
216216
a = dat.arrays[1]'
217217
N = 100
218218
KR = Block.(Base.OneTo(N))
219219
v = view(a, :, KR)
220-
@time r = PseudoBlockArray(v)
220+
@time r = BlockedArray(v)
221221
@test v == r
222222
end
223223

@@ -262,7 +262,7 @@ include("test_infbanded.jl")
262262
@testset "blockdiag" begin
263263
D = Diagonal(mortar(Fill.((-(0:∞) - (0:∞) .^ 2), 1:2:∞)))
264264
x = [randn(5); zeros(∞)]
265-
= PseudoBlockArray(x, (axes(D, 1),))
265+
= BlockedArray(x, (axes(D, 1),))
266266
@test (D*x)[1:10] == (D*x̃)[1:10]
267267
end
268268

test/test_infqr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ import SemiseparableMatrices: AlmostBandedLayout, VcatAlmostBandedLayout
275275

276276
x,y = 0.1,0.2
277277
θ,φ = acos(x),acos(y)
278-
@test u[Block.(1:50)] isa PseudoBlockArray
278+
@test u[Block.(1:50)] isa BlockedArray
279279
@test (sin.((1:50) .* φ)/sin(φ))' * InvDiagTrav(u[Block.(1:50)]) * sin.((1:50) .* θ)/sin(θ) 1/(x+y-4)
280280
@test (L*u)[1:10] [1; zeros(9)]
281281

0 commit comments

Comments
 (0)