Skip to content

Commit

Permalink
avoid gradedunitrangedual_getindices_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ogauthe committed Nov 6, 2024
1 parent c60c080 commit 0216abc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions NDTensors/src/lib/GradedAxes/src/gradedunitrangedual.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,12 @@ function BlockArrays.blocklengths(a::GradedUnitRangeDual)
return dual.(blocklengths(nondual(a)))
end

function gradedunitrangedual_getindices_blocks(a::GradedUnitRangeDual, indices)
a_indices = getindex(nondual(a), indices)
return mortar([label_dual(b) for b in blocks(a_indices)])
end

# TODO: Move this to a `BlockArraysExtensions` library.
function blockedunitrange_getindices(
a::GradedUnitRangeDual, indices::Vector{<:BlockIndexRange{1}}
)
return gradedunitrangedual_getindices_blocks(a, indices)
a_indices = getindex(nondual(a), indices)
return mortar([label_dual(b) for b in blocks(a_indices)])
end

function blockedunitrange_getindices(
Expand Down

0 comments on commit 0216abc

Please sign in to comment.