From 1756c3ca273eb641fcd5c304efbada9a7f955df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Gauth=C3=A9?= Date: Thu, 14 Nov 2024 09:35:50 -0500 Subject: [PATCH] remove vec --- .../src/lib/GradedAxes/src/gradedunitrangedual.jl | 3 +-- NDTensors/src/lib/GradedAxes/test/test_dual.jl | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/NDTensors/src/lib/GradedAxes/src/gradedunitrangedual.jl b/NDTensors/src/lib/GradedAxes/src/gradedunitrangedual.jl index fc3abbadd5..a16da982f9 100644 --- a/NDTensors/src/lib/GradedAxes/src/gradedunitrangedual.jl +++ b/NDTensors/src/lib/GradedAxes/src/gradedunitrangedual.jl @@ -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)) diff --git a/NDTensors/src/lib/GradedAxes/test/test_dual.jl b/NDTensors/src/lib/GradedAxes/test/test_dual.jl index 71607a7f5c..f2b3072dc1 100644 --- a/NDTensors/src/lib/GradedAxes/test/test_dual.jl +++ b/NDTensors/src/lib/GradedAxes/test/test_dual.jl @@ -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) @@ -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)]