Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #199 #200

Merged
merged 2 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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.13] 10/08/2024

### Changed

* Fixed a small bug that caused calling `get_vectors` on PowerManifolds
to sometimes cause an error, cf [#199](https://github.com/JuliaManifolds/ManifoldsBase.jl/issues/199).

## [0.15.12] 03/08/2024

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ManifoldsBase"
uuid = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>", "Antoine Levitt <[email protected]>"]
version = "0.15.12"
version = "0.15.13"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
2 changes: 1 addition & 1 deletion src/PowerManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ function _get_vectors(
for i in get_iterator(M)
b_i = _access_nested(M, B.data.bases, i)
p_i = _read(M, rep_size, p, i)
for v in b_i.data
for v in get_vectors(M.manifold, p_i, b_i) #a bit safer than just b_i.data
new_v = copy(M, p, zero_tv)
copyto!(M.manifold, _write(M, rep_size, new_v, i), p_i, v)
push!(vs, new_v)
Expand Down
13 changes: 13 additions & 0 deletions test/power.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ using ManifoldsBase:
using StaticArrays
using LinearAlgebra
using Random
using RecursiveArrayTools

s = @__DIR__
!(s in LOAD_PATH) && (push!(LOAD_PATH, s))
Expand Down Expand Up @@ -472,4 +473,16 @@ end
fill!(P2, p, NAR)
@test P2 == [1.0 1.0; 2.0 2.0; 3.0 3.0]
end

@testset "get vectors on Power of product" begin
N = ManifoldsBase.DefaultManifold(1) × ManifoldsBase.DefaultManifold(1)
M = PowerManifold(N, NestedPowerRepresentation(), 2)
p = [ArrayPartition([1.0], [2.0]), ArrayPartition([3.0], [4.0])]
B = get_basis(M, p, DefaultOrthonormalBasis())
V = get_vectors(M, p, B)
for v in V
@test is_vector(M, p, v)
@test norm(M, p, v) == 1
end
end
end
Loading