Internal documentation

This page documents the internal types and methods of Manifolds.jl's that might be of use for writing your own manifold.

Types

Manifolds.SizedAbstractArray — Type
SizedAbstractArray{Tuple{dims...}}(array)

Wraps an AbstractArray with a static size, so to take advantage of the (faster) methods defined by the static array package. The size is checked once upon construction to determine if the number of elements (length) match, but the array may be reshaped.

source

Functions

Manifolds._gradient — Function
_gradient(f, p::Number, backend = adbackend()) -> Number
_gradient(f, p::Array, backend = adbackend()) -> Array

Compute gradient of function f at x using AD backend backend.

source
Manifolds._jacobian — Function
_jacobian(f, p, backend = adbackend()) -> Array

Compute Jacobian matrix of function f at p using AD backend backend. Inputs and outputs of f are vectorized.

source
Manifolds.eigen_safe — Function
eigen_safe(x)

Compute the eigendecomposition of x. If x is a StaticMatrix, it is converted to a Matrix before the decomposition.

source
Manifolds.find_pv — Function
find_pv(x...)

A = find_pv(x...) returns the first ProductArray among the arguments.

source
Manifolds.log_safe — Function
log_safe(x)

Compute the matrix logarithm of x. If x is a StaticMatrix, it is converted to a Matrix before computing the log.

source
Manifolds.size_to_tuple — Function
size_to_tuple(::Type{S}) where S<:Tuple

Converts a size given by Tuple{N, M, ...} into a tuple (N, M, ...).

source
Manifolds.select_from_tuple — Function
select_from_tuple(t::NTuple{N, Any}, positions::Val{P})

Selects elements of tuple t at positions specified by the second argument. For example select_from_tuple(("a", "b", "c"), Val((3, 1, 1))) returns ("c", "a", "a").

source
Manifolds.usinc — Function
usinc(θ::Real)

Unnormalized version of sinc function, i.e. $\operatorname{usinc}(θ) = \frac{\sin(θ)}{θ}$. This is equivalent to sinc(θ/π).

source
Manifolds.usinc_from_cos — Function
usinc_from_cos(x::Real)

Unnormalized version of sinc function, i.e. $\operatorname{usinc}(θ) = \frac{\sin(θ)}{θ}$, computed from $x = cos(θ)$.

source
Manifolds.ziptuples — Function
ziptuples(a, b[, c[, d[, e]]])

Zips tuples a, b, and remaining in a fast, type-stable way. If they have different lengths, the result is trimmed to the length of the shorter tuple.

source