Internal documentation
This page documents the internal types and methods of Manifolds.jl's that might be of use for writing your own manifold.
Functions
Manifolds.eigen_safe — Functioneigen_safe(x)Compute the eigendecomposition of x. If x is a StaticMatrix, it is converted to a Matrix before the decomposition.
Manifolds.get_parameter_type — Functionget_parameter_type(M::AbstractManifold)Get parameter argument of the constructor of manifold M. Returns either :field or :type.
See also
get_parameter, TypeParameter
Manifolds.isnormal — Functionisnormal(x; kwargs...) -> BoolCheck if the matrix or number x is normal, that is, if it commutes with its adjoint:
\[x x^\mathrm{H} = x^\mathrm{H} x.\]
By default, this is an equality check. Provide kwargs for isapprox to perform an approximate check.
Manifolds.log_safe — Functionlog_safe(x)Compute the matrix logarithm of x. If x is a StaticMatrix, it is converted to a Matrix before computing the log.
Manifolds.log_safe! — Functionlog_safe!(y, x)Compute the matrix logarithm of x. If the eltype of y is real, then the imaginary part of x is ignored, and a DomainError is raised if real(x) has no real logarithm.
Manifolds.mul!_safe — Functionmul!_safe(Y, A, B) -> YCall mul! safely, that is, A and/or B are permitted to alias with Y.
Manifolds.nzsign — Functionnzsign(z[, absz])Compute a modified sign(z) that is always nonzero, i.e. where
\[\operatorname(nzsign)(z) = \begin{cases} 1 & \text{if } z = 0\\ \frac{z}{|z|} & \text{otherwise} \end{cases}\]
Note that the condition absz == 0 would be incorrectly handled by ForwardDiff.jl.
Manifolds.realify — Functionrealify(X::AbstractMatrix{T𝔽}, 𝔽::AbstractNumbers) -> Y::AbstractMatrix{<:Real}Given a matrix $X ∈ 𝔽^{n×n}$, compute $Y ∈ ℝ^{m×m}$, where $m = n \operatorname{dim}_𝔽$, and $\operatorname{dim}_𝔽$ is the real_dimension of the number field $𝔽$, using the map $ϕ \colon X ↦ Y$, that preserves the matrix product, so that for all $C,D ∈ 𝔽^{n×n}$,
\[ϕ(C) ϕ(D) = ϕ(CD).\]
See realify! for an in-place version, and unrealify! to compute the inverse of $ϕ$.
Manifolds.realify! — Functionrealify!(Y::AbstractMatrix{<:Real}, X::AbstractMatrix{T𝔽}, 𝔽::AbstractNumbers)In-place version of realify.
realify!(Y::AbstractMatrix{<:Real}, X::AbstractMatrix{<:Complex}, ::typeof(ℂ))Given a complex matrix $X = A + iB ∈ ℂ^{n×n}$, compute its realified matrix $Y ∈ ℝ^{2n×2n}$, written where
\[Y = \begin{pmatrix}A & -B \\ B & A \end{pmatrix}.\]
Manifolds.symmetrize — Functionsymmetrize(X)Given a square matrix X compute 1/2 .* (X' + X).
Manifolds.symmetrize! — Functionsymmetrize!(Y, X)Given a square matrix X compute 1/2 .* (X' + X) in place of Y.
Manifolds.unrealify! — Functionunrealify!(X::AbstractMatrix{T𝔽}, Y::AbstractMatrix{<:Real}, 𝔽::AbstractNumbers[, n])Given a real matrix $Y ∈ ℝ^{m×m}$, where $m = n \operatorname{dim}_𝔽$, and $\operatorname{dim}_𝔽$ is the real_dimension of the number field $𝔽$, compute in-place its equivalent matrix $X ∈ 𝔽^{n×n}$. Note that this function does not check that $Y$ has a valid structure to be un-realified.
See realify! for the inverse of this function.
Manifolds.usinc — Functionusinc(θ::Real)Unnormalized version of sinc function, i.e. $\operatorname{usinc}(θ) = \frac{\sin(θ)}{θ}$. This is equivalent to sinc(θ/π).
Note that ForwardDiff.jl would return wrong answer at θ=0 if a simple equality was used.
Manifolds.usinc_from_cos — Functionusinc_from_cos(x::Real)Unnormalized version of sinc function, i.e. $\operatorname{usinc}(θ) = \frac{\sin(θ)}{θ}$, computed from $x = cos(θ)$.
Manifolds.vec2skew! — Functionvec2skew!(X, v, k)Create a skew symmetric matrix in-place in X of size $k×k$ from a vector v, for example for v=[1,2,3] and k=3 this yields
[ 0 1 2;
-1 0 3;
-2 -3 0
]