Skip to content

Commit

Permalink
fix a few more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Oct 16, 2023
1 parent f26d329 commit 8e97d94
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
8 changes: 4 additions & 4 deletions test/groups/general_linear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ using NLsolve
@test_throws ManifoldDomainError is_vector(
G,
Float64[0 1 1; 0 1 1; 1 0 0],
randn(3, 3),
true,
randn(3, 3);
error=:error,
)
@test is_vector(G, Float64[0 0 1; 0 1 1; 1 1 1], randn(3, 3); error=:error)

Expand Down Expand Up @@ -154,8 +154,8 @@ using NLsolve
@test_throws ManifoldDomainError is_vector(
G,
ComplexF64[im im; im im],
randn(ComplexF64, 2, 2),
true,
randn(ComplexF64, 2, 2);
error=:error,
)
@test is_vector(G, ComplexF64[1 im; im im], randn(ComplexF64, 2, 2); error=:error)

Expand Down
28 changes: 14 additions & 14 deletions test/groups/special_linear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ using NLsolve
@test_throws ManifoldDomainError is_vector(
G,
Float64[2 3 2; 3 1 2; 1 1 1],
randn(3, 3),
true;
randn(3, 3);
error=:error,
atol=1e-6,
)
@test_throws DomainError is_vector(
G,
Float64[2 1 2; 3 2 2; 2 2 1],
Float64[2 1 -1; 2 2 1; 1 1 -1],
true;
Float64[2 1 -1; 2 2 1; 1 1 -1];
error=:error,
atol=1e-6,
)
@test is_vector(
G,
Float64[2 1 2; 3 2 2; 2 2 1],
Float64[-1 -1 -1; 1 -1 2; -1 -1 2],
true;
Float64[-1 -1 -1; 1 -1 2; -1 -1 2];
error=:error,
atol=1e-6,
)

Expand Down Expand Up @@ -130,31 +130,31 @@ using NLsolve
@test_throws DomainError is_point(G, randn(2, 2); error=:error)
@test_throws ManifoldDomainError is_point(
G,
ComplexF64[1 0 im; im 0 0; 0 -1 0],
true,
ComplexF64[1 0 im; im 0 0; 0 -1 0];
error=:error,
)
@test_throws DomainError is_point(G, ComplexF64[1 im; im 1]; error=:error)
@test is_point(G, ComplexF64[im 1; -2 im]; error=:error)
@test is_point(G, Identity(G); error=:error)
@test_throws ManifoldDomainError is_vector(
G,
ComplexF64[-1+im -1; -im 1],
ComplexF64[1-im 1+im; 1 -1+im],
true;
ComplexF64[1-im 1+im; 1 -1+im];
error=:error,
atol=1e-6,
)
@test_throws DomainError is_vector(
G,
ComplexF64[1 1+im; -1+im -1],
ComplexF64[1-im -1-im; -im im],
true;
ComplexF64[1-im -1-im; -im im];
error=:error,
atol=1e-6,
)
@test is_vector(
G,
ComplexF64[1 1+im; -1+im -1],
ComplexF64[1-im 1+im; 1 -1+im],
true;
ComplexF64[1-im 1+im; 1 -1+im];
error=:error,
atol=1e-6,
)

Expand Down
8 changes: 4 additions & 4 deletions test/manifolds/projective_space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ include("../utils.jl")
@test_throws DomainError is_vector(
M,
[1.0 + 0im, 0.0, 0.0],
[1.0 + 0im, 0.0, 0.0],
true,
[1.0 + 0im, 0.0, 0.0];
error=:error,
)
@test_throws DomainError is_vector(
M,
[1.0 + 0im, 0.0, 0.0],
[-0.5im, 0.0, 0.0],
true,
[-0.5im, 0.0, 0.0];
error=:error,
)
@test injectivity_radius(M) == π / 2
@test injectivity_radius(M, ExponentialRetraction()) == π / 2
Expand Down
14 changes: 10 additions & 4 deletions test/manifolds/symplecticstiefel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@ end

@test is_vector(SpSt_6_4, p_6_4, X1; atol=1.0e-12)
@test is_vector(SpSt_6_4, p_6_4, X2; atol=1.0e-6)
@test_throws DomainError is_vector(SpSt_6_4, p_6_4, X2, true; atol=1.0e-12)
@test_throws DomainError is_vector(
SpSt_6_4,
p_6_4,
X2;
error=:error,
atol=1.0e-12,
)
@test is_vector(SpSt_6_4, p_6_4, X1 + X2; atol=1.0e-6)
@test_throws DomainError is_vector(SpSt_6_4, p_6_4, X1 + p_6_4; error=:error)
end
Expand Down Expand Up @@ -223,14 +229,14 @@ end
])
A_6_4_proj = similar(A_6_4)
Manifolds.project!(SpSt_6_4, A_6_4_proj, p_6_4, A_6_4)
@test is_vector(SpSt_6_4, p_6_4, A_6_4_proj, true; atol=2.0e-12)
@test is_vector(SpSt_6_4, p_6_4, A_6_4_proj; error=:error, atol=2.0e-12)
end
@testset "Generate random points/tangent vectors" begin
M_big = SymplecticStiefel(20, 10)
p_big = rand(M_big)
@test is_point(M_big, p_big, true; atol=1.0e-14)
@test is_point(M_big, p_big; error=:error, atol=1.0e-14)
X_big = rand(M_big; vector_at=p_big, hamiltonian_norm=1.0)
@test is_vector(M_big, p_big, X_big, true; atol=1.0e-14)
@test is_vector(M_big, p_big, X_big; error=:error, atol=1.0e-14)
end
@testset "test_manifold(Symplectic(6), ...)" begin
types = [Matrix{Float64}]
Expand Down

0 comments on commit 8e97d94

Please sign in to comment.