Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Jan 1, 2025
1 parent e250212 commit b052267
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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.10.11] - unreleased
## [0.10.11] - 2025-01-02

### Added

Expand Down
23 changes: 21 additions & 2 deletions src/manifolds/InvertibleMatrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ end
embed(::InvertibleMatrices, p) = p
embed(::InvertibleMatrices, p, X) = X

function get_coordinates(
::InvertibleMatrices{ℝ,<:Any},
p,
X,
::DefaultOrthonormalBasis{ℝ,TangentSpaceType},
)
return vec(X)
end

function get_coordinates!(

Check warning on line 71 in src/manifolds/InvertibleMatrices.jl

View check run for this annotation

Codecov / codecov/patch

src/manifolds/InvertibleMatrices.jl#L71

Added line #L71 was not covered by tests
::InvertibleMatrices{ℝ,<:Any},
Xⁱ,
p,
X,
::DefaultOrthonormalBasis{ℝ,TangentSpaceType},
)
return copyto!(Xⁱ, X)

Check warning on line 78 in src/manifolds/InvertibleMatrices.jl

View check run for this annotation

Codecov / codecov/patch

src/manifolds/InvertibleMatrices.jl#L78

Added line #L78 was not covered by tests
end

function get_embedding(::InvertibleMatrices{𝔽,TypeParameter{Tuple{n}}}) where {n,𝔽}
return Euclidean(n, n; field=𝔽)
end
Expand All @@ -68,7 +87,7 @@ function get_embedding(M::InvertibleMatrices{𝔽,Tuple{Int}}) where {𝔽}
end

function get_vector(
M::InvertibleMatrices{<:Any,ℝ},
M::InvertibleMatrices{ℝ,<:Any},
p,
Xⁱ,
::DefaultOrthonormalBasis{ℝ,TangentSpaceType},
Expand All @@ -78,7 +97,7 @@ function get_vector(
end

function get_vector!(

Check warning on line 99 in src/manifolds/InvertibleMatrices.jl

View check run for this annotation

Codecov / codecov/patch

src/manifolds/InvertibleMatrices.jl#L99

Added line #L99 was not covered by tests
::InvertibleMatrices{<:Any,ℝ},
::InvertibleMatrices{ℝ,<:Any},
X,
p,
Xⁱ,
Expand Down
6 changes: 5 additions & 1 deletion test/manifolds/invertible_matrices.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using LinearAlgebra, Manifolds, ManifoldsBase, Test
using LinearAlgebra, Manifolds, ManifoldsBase, Test, Random

@testset "Invertible matrices" begin
M = InvertibleMatrices(3, ℝ)
Expand Down Expand Up @@ -26,7 +26,11 @@ using LinearAlgebra, Manifolds, ManifoldsBase, Test
@test Weingarten(M, A, A, A) == zero(A)

@test is_point(M, rand(M))
@test is_point(M, rand(Random.MersenneTwister(), M))
@test is_vector(M, A, rand(M; vector_at=A))

@test get_coordinates(M, A, A, DefaultOrthonormalBasis()) == vec(A)
@test get_vector(M, A, vec(A), DefaultOrthonormalBasis()) == A
end
@testset "Complex invertible matrices" begin
@test repr(Mc) == "InvertibleMatrices(3, ℂ)"
Expand Down

0 comments on commit b052267

Please sign in to comment.