Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
  • Loading branch information
kellertuer and mateuszbaran authored Aug 29, 2023
1 parent e2ebffe commit ff0818d
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/manifolds/Euclidean.jl
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ end
Compute the Weingarten map ``\mathcal W_p`` at `p` on the [`Euclidean`](@ref) `M` with respect to the
tangent vector ``X \in T_p\mathcal M`` and the normal vector ``V \in N_p\mathcal M``.
Since this a flat space by itself, the result is always the zero tangent vector
Since this a flat space by itself, the result is always the zero tangent vector.
"""
Weingarten(::Euclidean, p, X, V)

Expand Down
4 changes: 2 additions & 2 deletions src/manifolds/FixedRankMatrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,9 @@ riemannian_Hessian(M::FixedRankMatrices, p, G, H, X)

function riemannian_Hessian!(M::FixedRankMatrices, Y, p, G, H, X)
project!(M, Y, p, H)
T1 = (G * X.Vt) / diagm(p.S)
T1 = (G * X.Vt) / Diagonal(p.S)
Y.U .+= T1 - p.U * (p.U' * T1)
T2 = (G' * X.U) / diagm(p.S)
T2 = (G' * X.U) / Diagonal(p.S)
Y.Vt .+= (T2 - p.Vt' * (p.Vt * T2))
return Y

Check warning on line 576 in src/manifolds/FixedRankMatrices.jl

View check run for this annotation

Codecov / codecov/patch

src/manifolds/FixedRankMatrices.jl#L570-L576

Added lines #L570 - L576 were not covered by tests
end
Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/PowerManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ end
Y = Weingarten(M::AbstractPowerManifold, p, X, V)
Weingarten!(M::AbstractPowerManifold, Y, p, X, V)
Since the metric decouples, also the computation of the weingarten map
Since the metric decouples, also the computation of the Weingarten map
``\mathcal W_p`` can be computed elementwise on the single elements of the [`PowerManifold`](https://juliamanifolds.github.io/ManifoldsBase.jl/stable/manifolds/#sec-power-manifold) `M`.
"""
Weingarten(::AbstractPowerManifold, p, X, V)
Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/ProductManifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ end
Y = Weingarten(M::ProductManifold, p, X, V)
Weingarten!(M::ProductManifold, Y, p, X, V)
Since the metric decouples, also the computation of the weingarten map
Since the metric decouples, also the computation of the Weingarten map
``\mathcal W_p`` can be computed elementwise on the single elements of the [`ProductManifold`](@ref) `M`.
"""
Weingarten(::ProductManifold, p, X, V)
Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/Rotations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function Base.show(io::IO, ::Rotations{n}) where {n}
end

@doc raw"""
riemannian_Hessian(M::Rotations, p, G, H, X)
riemannian_Hessian(M::Rotations, p, G, H, X)
The Riemannian Hessian can be computed by adopting Eq. (5.6) [Nguyen:2023](@cite),
so very similar to the Stiefel manifold.
Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/SkewHermitian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ end
Compute the Weingarten map ``\mathcal W_p`` at `p` on the [`SkewSymmetricMatrices`](@ref) `M` with respect to the
tangent vector ``X \in T_p\mathcal M`` and the normal vector ``V \in N_p\mathcal M``.
Since this a flat space by itself, the result is always the zero tangent vector
Since this a flat space by itself, the result is always the zero tangent vector.
"""
Weingarten(::SkewSymmetricMatrices, p, X, V)

Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/Sphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ The formula is due to [AbsilMahonyTrumpf:2013](@cite) given by
Weingarten(::Sphere, p, X, V)

function Weingarten!(::Sphere, Y, p, X, V)
Y .= -X * (p'V)
Y .= -dot(p, V) .* X
return Y

Check warning on line 533 in src/manifolds/Sphere.jl

View check run for this annotation

Codecov / codecov/patch

src/manifolds/Sphere.jl#L531-L533

Added lines #L531 - L533 were not covered by tests
end

Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/Symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ end
Compute the Weingarten map ``\mathcal W_p`` at `p` on the [`SymmetricMatrices`](@ref) `M` with respect to the
tangent vector ``X \in T_p\mathcal M`` and the normal vector ``V \in N_p\mathcal M``.
Since this a flat space by itself, the result is always the zero tangent vector
Since this a flat space by itself, the result is always the zero tangent vector.
"""
Weingarten(::SymmetricMatrices, p, X, V)

Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/Unitary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ show(io::IO, ::UnitaryMatrices{n,ℂ}) where {n} = print(io, "UnitaryMatrices($(
show(io::IO, ::UnitaryMatrices{n,ℍ}) where {n} = print(io, "UnitaryMatrices($(n), ℍ)")

@doc raw"""
riemannian_Hessian(M::UnitaryMatrices, p, G, H, X)
riemannian_Hessian(M::UnitaryMatrices, p, G, H, X)
The Riemannian Hessian can be computed by adopting Eq. (5.6) [Nguyen:2023](@cite),
so very similar to the complex Stiefel manifold.
Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/VectorBundle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ end
Compute the Weingarten map ``\mathcal W_p`` at `p` on the [`VectorSpaceAtPoint`](@ref) `M` with respect to the
tangent vector ``X \in T_p\mathcal M`` and the normal vector ``V \in N_p\mathcal M``.
Since this a flat space by itself, the result is always the zero tangent vector
Since this a flat space by itself, the result is always the zero tangent vector.
"""
Weingarten(::VectorSpaceAtPoint, p, X, V)

Expand Down

0 comments on commit ff0818d

Please sign in to comment.