Skip to content

Commit 1756c3c

Browse files
committed
remove vec
1 parent 60adbee commit 1756c3c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

NDTensors/src/lib/GradedAxes/src/gradedunitrangedual.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ end
9191
function dual_axes(v::BlockVector)
9292
# dual both v elements and v axes
9393
block_axes = dual.(axes(v))
94-
flipped = mortar(dual.(vec.(blocks(v))), block_axes)
95-
return flipped
94+
return mortar(dual.(blocks(v)), block_axes)
9695
end
9796

9897
Base.axes(a::GradedUnitRangeDual) = axes(nondual(a))

NDTensors/src/lib/GradedAxes/test/test_dual.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ end
219219
@test label(ad[Block(2)]) == U1(-1)
220220
@test label(ad[Block(2)[1:1]]) == U1(-1)
221221

222-
v = ad[mortar([Block(2)[1:1]])]
222+
v = ad[[Block(2)[1:1]]]
223223
@test v isa AbstractVector{LabelledInteger{Int64,U1}}
224224
@test length(v) == 1
225225
@test label(first(v)) == U1(-1)
@@ -228,16 +228,16 @@ end
228228
@test isdual(axes(v, 1))
229229
@test blocklabels(axes(v, 1)) == [U1(-1)]
230230

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

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

0 commit comments

Comments
 (0)