Skip to content

Commit

Permalink
Fix #199 (#200)
Browse files Browse the repository at this point in the history
* Fix get_vectors.

* add a test that power of product works fine.
  • Loading branch information
kellertuer authored Aug 11, 2024
1 parent 1bf8149 commit 8469ef9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
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

2 comments on commit 8469ef9

@kellertuer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/112900

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.15.13 -m "<description of version>" 8469ef9c5c6d5a896042d0d7486afc006b93bcba
git push origin v0.15.13

Please sign in to comment.