Skip to content

Commit

Permalink
remove vec
Browse files Browse the repository at this point in the history
  • Loading branch information
ogauthe committed Nov 14, 2024
1 parent 60adbee commit 1756c3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions NDTensors/src/lib/GradedAxes/src/gradedunitrangedual.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ end
function dual_axes(v::BlockVector)
# dual both v elements and v axes
block_axes = dual.(axes(v))
flipped = mortar(dual.(vec.(blocks(v))), block_axes)
return flipped
return mortar(dual.(blocks(v)), block_axes)
end

Base.axes(a::GradedUnitRangeDual) = axes(nondual(a))
Expand Down
10 changes: 5 additions & 5 deletions NDTensors/src/lib/GradedAxes/test/test_dual.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ end
@test label(ad[Block(2)]) == U1(-1)
@test label(ad[Block(2)[1:1]]) == U1(-1)

v = ad[mortar([Block(2)[1:1]])]
v = ad[[Block(2)[1:1]]]
@test v isa AbstractVector{LabelledInteger{Int64,U1}}
@test length(v) == 1
@test label(first(v)) == U1(-1)
Expand All @@ -228,16 +228,16 @@ end
@test isdual(axes(v, 1))
@test blocklabels(axes(v, 1)) == [U1(-1)]

v = ad[[Block(2)]]
v = ad[mortar([Block(2)[1:1]])]
@test v isa AbstractVector{LabelledInteger{Int64,U1}}
@test isdual(axes(v, 1)) # used in view(::BlockSparseVector, [Block(1)])
@test isdual(axes(v, 1)) # used in view(::BlockSparseVector, [Block(1)[1:1]])
@test label(first(v)) == U1(-1)
@test unlabel(first(v)) == 3
@test blocklabels(axes(v, 1)) == [U1(-1)]

v = ad[mortar([Block(2)[1:1]])]
v = ad[[Block(2)]]
@test v isa AbstractVector{LabelledInteger{Int64,U1}}
@test isdual(axes(v, 1)) # used in view(::BlockSparseVector, [Block(1)[1:1]])
@test isdual(axes(v, 1)) # used in view(::BlockSparseVector, [Block(1)])
@test label(first(v)) == U1(-1)
@test unlabel(first(v)) == 3
@test blocklabels(axes(v, 1)) == [U1(-1)]
Expand Down

0 comments on commit 1756c3c

Please sign in to comment.