Hyperrectangle is a manifold with corners [Joy10], and also a subset of the real Euclidean manifold. It is useful for box-constrained optimization, for example it is implicitly used in the classic L-BFGS-B algorithm.


This is a manifold with corners. Some parts of its interface specific to this property are experimental and may change without a breaking release.

Manifolds.Hyperrectangle โ€” Type
Hyperrectangle{T} <: AbstractManifold{โ„}

Hyperrectangle, also known as orthotope or box. This is a manifold with corners [Joy10] with the standard Euclidean metric.


Hyperrectangle(lb::AbstractArray, ub::AbstractArray)

Generate the hyperrectangle of arrays such that each element of the array is between lower and upper bound with the same index.

Base.exp โ€” Method
exp(M::Hyperrectangle, p, X)

Compute the exponential map on the Hyperrectangle manifold M from p in direction X, which in this case is just

\[\exp_p X = p + X.\]

Base.log โ€” Method
log(M::Hyperrectangle, p, q)

Compute the logarithmic map on the Hyperrectangle M from p to q, which in this case is just

\[\log_p q = q-p.\]

LinearAlgebra.norm โ€” Method
norm(M::Hyperrectangle, p, X)

Compute the norm of a tangent vector X at p on the Hyperrectangle M, i.e. since every tangent space can be identified with M itself in this case, just the (Frobenius) norm of X.

ManifoldsBase.Weingarten โ€” Method
Y = Weingarten(M::Hyperrectangle, p, X, V)
Weingarten!(M::Hyperrectangle, Y, p, X, V)

Compute the Weingarten map $\mathcal W_p$ at p on the Hyperrectangle 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.

ManifoldsBase.distance โ€” Method
distance(M::Hyperrectangle, p, q)

Compute the euclidean distance between two points on the Hyperrectangle manifold M, i.e. for vectors it's just the norm of the difference, for matrices and higher order arrays, the matrix and tensor Frobenius norm, respectively.

ManifoldsBase.embed โ€” Method
embed(M::Hyperrectangle, p, X)

Embed the tangent vector X at point p in M. Equivalent to an identity map.

ManifoldsBase.inner โ€” Method
inner(M::Hyperrectangle, p, X, Y)

Compute the inner product on the Hyperrectangle M, which is just the inner product on the real-valued vector space of arrays (or tensors) of size $n_1 ร— n_2 ร— โ€ฆ ร— n_i$, i.e.

\[g_p(X,Y) = \sum_{k โˆˆ I} X_{k} Y_{k},\]

where $I$ is the set of vectors $k โˆˆ โ„•^i$, such that for all

$i โ‰ค j โ‰ค i$ it holds $1 โ‰ค k_j โ‰ค n_j$.

For the special case of $i โ‰ค 2$, i.e. matrices and vectors, this simplifies to

\[g_p(X,Y) = \operatorname{tr}(X^{\mathrm{T}}Y),\]

where $โ‹…^{\mathrm{T}}$ denotes transposition.

ManifoldsBase.project โ€” Method
project(M::Hyperrectangle, p, X)

Project an arbitrary vector X into the tangent space of a point p on the Hyperrectangle M, which is just the identity, since any tangent space of M can be identified with all of M.

ManifoldsBase.vector_transport_to โ€” Method
vector_transport_to(M::Hyperrectangle, p, X, q, ::AbstractVectorTransportMethod)

Transport the vector X from the tangent space at p to the tangent space at q on the Hyperrectangle M, which simplifies to the identity.