Skip to content

Commit

Permalink
Improved performance of power manifold creation and some cases of `ge…
Browse files Browse the repository at this point in the history
…t_component` on product manifold
  • Loading branch information
mateuszbaran committed Aug 2, 2024
1 parent 2ac6a52 commit 83a5648
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.15.12] unreleased

### Changed

* Improved performance of power manifold creation and some cases of `get_component` on product manifold.

## [0.15.11] 28/07/2024

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Access the element(s) at index `i` of a point `p` on a [`ProductManifold`](@ref)
linear indexing.
See also [Array Indexing](https://docs.julialang.org/en/v1/manual/arrays/#man-array-indexing-1) in Julia.
"""
Base.@propagate_inbounds function Base.getindex(
@inline Base.@propagate_inbounds function Base.getindex(
p::ArrayPartition,
M::ProductManifold,
i::Union{Integer,Colon,AbstractVector,Val},
Expand Down
6 changes: 3 additions & 3 deletions src/PowerManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function _parameter_symbol(
return :type
end

function PowerManifold(
Base.@constprop :aggressive function PowerManifold(
M::AbstractManifold{𝔽},
::TPR,
size::Integer...;
Expand All @@ -109,15 +109,15 @@ function PowerManifold(
size_w = wrap_type_parameter(parameter, size)
return PowerManifold{𝔽,typeof(M),typeof(size_w),TPR}(M, size_w)
end
function PowerManifold(
Base.@constprop :aggressive function PowerManifold(
M::PowerManifold{𝔽,TM,TSize,TPR},
size::Integer...;
parameter::Symbol = _parameter_symbol(M),
) where {𝔽,TM<:AbstractManifold{𝔽},TSize,TPR<:AbstractPowerRepresentation}
size_w = wrap_type_parameter(parameter, (get_parameter(M.size)..., size...))
return PowerManifold{𝔽,TM,typeof(size_w),TPR}(M.manifold, size_w)
end
function PowerManifold(
Base.@constprop :aggressive function PowerManifold(
M::PowerManifold{𝔽,TM},
::TPR,
size::Integer...;
Expand Down
2 changes: 1 addition & 1 deletion src/ProductManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ end
Get the `i`th component of a point `p` on a [`ProductManifold`](@ref) `M`.
"""
function get_component(M::ProductManifold, p, i)
@inline function get_component(M::ProductManifold, p, i)
return submanifold_component(M, p, i)
end

Expand Down

0 comments on commit 83a5648

Please sign in to comment.