Skip to content

Commit

Permalink
fix PowerManifold
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Aug 27, 2024
1 parent cc35541 commit 682717d
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/PowerManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ end

Base.@propagate_inbounds @inline function _read(
M::AbstractPowerManifold,
rep_size::Tuple,
rep_size::Union{Tuple,Nothing},
x::AbstractArray,
i::Int,
)
Expand All @@ -1328,7 +1328,7 @@ end

Base.@propagate_inbounds @inline function _read(
::Union{PowerManifoldNested,PowerManifoldNestedReplacing},
rep_size::Tuple,
rep_size::Union{Tuple,Nothing},
x::AbstractArray,
i::Tuple,
)
Expand Down Expand Up @@ -1765,15 +1765,25 @@ function Weingarten!(M::AbstractPowerManifold, Y, p, X, V)
return Y
end

@inline function _write(M::AbstractPowerManifold, rep_size::Tuple, x::AbstractArray, i::Int)
@inline function _write(
M::AbstractPowerManifold,
rep_size::Union{Tuple,Nothing},
x::AbstractArray,
i::Int,
)
return _write(M, rep_size, x, (i,))
end

@inline function _is_nested_write_getindex(::PowerManifoldNested, x)
return !isbitstype(eltype(x))
end

@inline function _write(M::PowerManifoldNested, ::Tuple, x::AbstractArray, i::Tuple)
@inline function _write(
M::PowerManifoldNested,
::Union{Tuple,Nothing},
x::AbstractArray,
i::Tuple,
)
if _is_nested_write_getindex(M, x)
return x[i...]
else
Expand Down

0 comments on commit 682717d

Please sign in to comment.