Skip to content

Commit

Permalink
Merge pull request #193 from GillesBareilles/master
Browse files Browse the repository at this point in the history
Bug in check_manifold_point for FixedRankMatrices
  • Loading branch information
mateuszbaran authored Jun 25, 2020
2 parents 0797a54 + 5b36e05 commit 0a38e9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Manifolds"
uuid = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>", "Antoine Levitt <[email protected]>"]
version = "0.3.2"
version = "0.3.3"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
8 changes: 4 additions & 4 deletions src/manifolds/FixedRankMatrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ function check_manifold_point(
),
)
end
if !isapprox(x.U' * x.U, one(zeros(n, n)); kwargs...)
if !isapprox(x.U' * x.U, one(zeros(k, k)); kwargs...)
return DomainError(
norm(x.U' * x.U - one(zeros(n, n))),
norm(x.U' * x.U - one(zeros(k, k))),
string(s, " since U is not orthonormal/unitary."),
)
end
if !isapprox(x.Vt' * x.Vt, one(zeros(n, n)); kwargs...)
if !isapprox(x.Vt * x.Vt', one(zeros(k, k)); kwargs...)
return DomainError(
norm(x.Vt' * x.Vt - one(zeros(n, n))),
norm(x.Vt * x.Vt' - one(zeros(k, k))),
string(s, " since V is not orthonormal/unitary."),
)
end
Expand Down
3 changes: 3 additions & 0 deletions test/fixed_rank.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ include("utils.jl")

@testset "fixed Rank" begin
M = FixedRankMatrices(3, 2, 2)
M2 = FixedRankMatrices(3, 2, 1)
Mc = FixedRankMatrices(3, 2, 2, ℂ)
x = SVDMPoint([1.0 0.0; 0.0 1.0; 0.0 0.0])
x2 = SVDMPoint([1.0 0.0; 0.0 1.0; 0.0 0.0], 1)
v = UMVTVector([0.0 0.0; 0.0 0.0; 1.0 1.0], [1.0 0.0; 0.0 1.0], zeros(2, 2))
@test repr(M) == "FixedRankMatrices(3, 2, 2, ℝ)"
@test repr(Mc) == "FixedRankMatrices(3, 2, 2, ℂ)"
Expand Down Expand Up @@ -51,6 +53,7 @@ include("utils.jl")
SVDMPoint([1.0 0.0; 0.0 0.0], 2),
true,
)
@test is_manifold_point(M2, x2)

@test !is_tangent_vector(
M,
Expand Down

2 comments on commit 0a38e9f

@kellertuer
Copy link
Member

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/16967

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.3.3 -m "<description of version>" 0a38e9f0eed97c3c3f51ecd7eeeb0ca8370edfff
git push origin v0.3.3

Please sign in to comment.