Skip to content

Commit

Permalink
Hyperrectangle (#720)
Browse files Browse the repository at this point in the history
* Hyperrectangle

* make qN work

* news and bump version

* docs

* update CI codecov settings

* improve coverage

* tests

* tolerance

* improve coverage

* fix injectivity radius

* fix old forgotten convention

* address review

* manifold with corners

* Add some docs
  • Loading branch information
mateuszbaran authored Apr 22, 2024
1 parent 4cbf30f commit 32744d6
Show file tree
Hide file tree
Showing 15 changed files with 743 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ jobs:
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./lcov.info
name: codecov-umbrella
fail_ci_if_error: false
if: ${{ matrix.os =='ubuntu-latest' }}
8 changes: 7 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ 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.9.16] – unreleased
## [0.9.17] – unreleased

### Added

* `Hyperrectangle` manifold with boundary.

## [0.9.16] – 2024-04-01

### Changed

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Manifolds"
uuid = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
authors = ["Seth Axen <seth.axen@gmail.com>", "Mateusz Baran <mateuszbaran89@gmail.com>", "Ronny Bergmann <manopt@ronnybergmann.net>", "Antoine Levitt <antoine.levitt@gmail.com>"]
version = "0.9.16"
version = "0.9.17"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ makedocs(;
"Grassmann" => "manifolds/grassmann.md",
"Hamiltonian" => "manifolds/hamiltonian.md",
"Hyperbolic space" => "manifolds/hyperbolic.md",
"Hyperrectangle" => "manifolds/hyperrectangle.md",
"Lorentzian manifold" => "manifolds/lorentz.md",
"Multinomial doubly stochastic matrices" => "manifolds/multinomialdoublystochastic.md",
"Multinomial matrices" => "manifolds/multinomial.md",
Expand Down
3 changes: 1 addition & 2 deletions docs/src/manifolds/grassmann.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ Pages = ["manifolds/GrassmannProjector.jl"]
Order = [:type,:function]
```


## Literature

```@bibliography
Pages = ["grassmann.md"]
Canonical=false
```
```
20 changes: 20 additions & 0 deletions docs/src/manifolds/hyperrectangle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# [Hyperrectangle](@id HyperrectangleSection)

Hyperrectangle is a manifold with corners [Joyce:2010](@cite), and also a subset of the real [Euclidean](@ref Main.Manifolds.Euclidean) manifold.
It is useful for box-constrained optimization, for example it is implicitly used in the classic L-BFGS-B algorithm.

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

```@autodocs
Modules = [Manifolds]
Pages = ["manifolds/Hyperrectangle.jl"]
Order = [:type,:function]
```

## Literature

```@bibliography
Pages = ["hyperrectangle.md"]
Canonical=false
```
9 changes: 9 additions & 0 deletions docs/src/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,15 @@ @article{JourneeBachAbsilSepulchre:2010
TITLE = {Low-Rank Optimization on the Cone of Positive Semidefinite Matrices},
JOURNAL = {SIAM Journal on Optimization}
}

@misc{Joyce:2010,
TITLE = {On manifolds with corners},
DOI = {10.48550/arXiv.0910.3518},
AUTHOR = {Joyce, Dominic},
YEAR = {2010},
EPRINT = {0910.3518},
EPRINTTYPE = {arXiv}
}
#
# K
# ----------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions src/Manifolds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ include("manifolds/FlagStiefel.jl")
include("manifolds/GeneralizedGrassmann.jl")
include("manifolds/GeneralizedStiefel.jl")
include("manifolds/Hyperbolic.jl")
include("manifolds/Hyperrectangle.jl")
include("manifolds/MultinomialDoublyStochastic.jl")
include("manifolds/MultinomialSymmetric.jl")
include("manifolds/MultinomialSymmetricPositiveDefinite.jl")
Expand Down Expand Up @@ -645,6 +646,7 @@ export Euclidean,
HamiltonianMatrices,
HeisenbergGroup,
Hyperbolic,
Hyperrectangle,
KendallsPreShapeSpace,
KendallsShapeSpace,
Lorentz,
Expand Down
11 changes: 5 additions & 6 deletions src/manifolds/Euclidean.jl
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ where ``I`` is the set of vectors ``k ∈ ℕ^i``, such that for all
For the special case of ``i ≤ 2``, i.e. matrices and vectors, this simplifies to
````math
g_p(X,Y) = X^{\mathrm{H}}Y,
g_p(X,Y) = \operatorname{tr}(X^{\mathrm{H}}Y),
````
where ``⋅^{\mathrm{H}}`` denotes the Hermitian, i.e. complex conjugate transposed.
Expand Down Expand Up @@ -745,7 +745,6 @@ end
Compute the Riemann tensor ``R(X,Y)Z`` at point `p` on [`Euclidean`](@ref) manifold `M`.
Its value is always the zero tangent vector.
````
"""
riemann_tensor(M::Euclidean, p, X, Y, Z)

Expand Down Expand Up @@ -894,13 +893,13 @@ Weingarten(::Euclidean, p, X, V)
Weingarten!(::Euclidean, Y, p, X, V) = fill!(Y, 0)

"""
zero_vector(M::Euclidean, x)
zero_vector(M::Euclidean, p)
Return the zero vector in the tangent space of `x` on the [`Euclidean`](@ref)
`M`, which here is just a zero filled array the same size as `x`.
Return the zero vector in the tangent space of `p` on the [`Euclidean`](@ref)
`M`, which here is just a zero filled array the same size as `p`.
"""
zero_vector(::Euclidean, ::Any...)
zero_vector(::Euclidean{TypeParameter{Tuple{}}}, p::Number) = zero(p)
zero_vector(::Euclidean{Tuple{}}, p::Number) = zero(p)

zero_vector!(::Euclidean, v, ::Any) = fill!(v, 0)
zero_vector!(::Euclidean, X, ::Any) = fill!(X, 0)
Loading

4 comments on commit 32744d6

@mateuszbaran
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Added

  • Hyperrectangle manifold with boundary.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105478

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.17 -m "<description of version>" 32744d68eaf51bf7b2ae962ae6539df6df9a3b55
git push origin v0.9.17

@mateuszbaran
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Added

  • Hyperrectangle manifold with boundary.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/105478

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.17 -m "<description of version>" 32744d68eaf51bf7b2ae962ae6539df6df9a3b55
git push origin v0.9.17

Please sign in to comment.