-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polytopes: Initial documentation #468
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
26fa27f
Polytopes: Initial documentation
lkastner 0a60df1
adjusted pg_polyhedra.md, moved examples directly to docstring and ad…
alexej-jordan 0e18446
mid-work commit: extended docstrings
alexej-jordan f8607c1
extended docstrings for polyhedra and cones
alexej-jordan df5f0e6
polyhedral doc edits
micjoswig 57fc04d
polyhedral doc edits; minimal info added to global index
micjoswig ef924c6
blank inserted in naviagtion bar of doc
micjoswig 31626b4
fix tests with new headers
alexej-jordan b9a6201
Merge remote-tracking branch 'origin/master' into docs/Polytopes
benlorenz f395494
indent....
benlorenz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
```@meta | ||
CurrentModule = Oscar | ||
``` | ||
|
||
```@setup oscar | ||
using Oscar | ||
``` | ||
|
||
```@contents | ||
Pages = ["pg.md"] | ||
``` | ||
|
||
# Introduction | ||
|
||
The polyhedral geometry part of OSCAR provides functionality for handling | ||
- convex polytopes, unbounded polyhedra and cones | ||
- linear programs | ||
|
||
General textbooks offering details on theory and algorithms include: | ||
- [JT13](@cite) | ||
- [Zie95](@cite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```@meta | ||
CurrentModule = Oscar | ||
``` | ||
|
||
```@setup oscar | ||
using Oscar | ||
``` | ||
|
||
```@contents | ||
Pages = ["pg_cones.md"] | ||
``` | ||
|
||
# Cones | ||
|
||
## Introduction | ||
|
||
## Constructions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
```@meta | ||
CurrentModule = Oscar | ||
``` | ||
|
||
```@setup oscar | ||
using Oscar | ||
``` | ||
|
||
```@contents | ||
Pages = ["pg_linear_programs.md"] | ||
``` | ||
|
||
# Linear programs | ||
|
||
## Introduction | ||
|
||
## Constructions | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
```@meta | ||
CurrentModule = Oscar | ||
``` | ||
|
||
```@setup oscar | ||
using Oscar | ||
``` | ||
|
||
```@contents | ||
Pages = ["pg_polyhedra.md"] | ||
``` | ||
|
||
# Polyhedra | ||
|
||
## Introduction | ||
|
||
A set $P \subseteq \mathbb{R}^n$ is called a (convex) polyhedron if it can be written as the intersection of finitely many closed affine halfspaces in $\mathbb{R}^n$. | ||
That is, there exists a matrix $A$ and a vector $b$ such that | ||
$$P = P(A,b) = \{ x \in \mathbb{R}^n \mid Ax \leq b\}.$$ | ||
Writing $P$ as above is called an $H$-representation of $P$. | ||
|
||
When a polyhedron $P \subset \mathbb{R}^n$ is bounded, it is called a polytope and the fundamental theorem of polytopes states that it may be written as the convex hull of finitely many points. | ||
That is $$P = \textrm{conv}(p_1,\ldots,p_N), p_i \in \mathbb{R}^n.$$ | ||
Writing $P$ in this way is called a $V$-representation. | ||
Polytopes are necessarily compact, i.e., they form convex bodies. | ||
|
||
Each polytope has a unique $V$-representation which is minimal with respect to inclusion (or cardinality). | ||
Conversely, a polyhedron which is full-dimensional, has a unique minimal $H$-representation. | ||
If the polyhedron is not full-dimensional, then there is no canonical choice of an $H$-representation. | ||
|
||
|
||
## Construction | ||
|
||
Based on the definition of an $H$-representation, the constructor of `Polyhedron` can be used: | ||
|
||
```@docs | ||
Polyhedron(A::Union{Oscar.MatElem,AbstractMatrix}, b) | ||
``` | ||
|
||
The following defines a polytope, as a `Polyhedron`, via a $V$-representation by calling the following function: | ||
|
||
```@docs | ||
convex_hull(::AnyVecOrMat) | ||
``` | ||
|
||
### Computing convex hulls | ||
|
||
This is a standard triangle, defined via a (redundant) $V$-representation and its unique minimal $H$-representation: | ||
|
||
```@repl oscar | ||
T = convex_hull([ 0 0 ; 1 0 ; 0 1; 0 1/2 ]) | ||
facets_as_halfspace_matrix_pair(T) | ||
``` | ||
|
||
## `Polyhedron` and `polymake`'s `Polytope` | ||
|
||
Many polyhedral computations are done through `polymake`. | ||
This is visible in the structure `Polyhedron` via a pointer `pm_polytope` to the corresponding `polymake` object. | ||
This allows to apply all functionality of `polymake` by calling a suitable `Polymake.jl` function on this pointer. | ||
|
||
To allow both `Oscar`'s and `polymake`'s functionality to be applicable to a polyhedron object, it can be converted back and forth: | ||
|
||
```@docs | ||
Polyhedron(::Polymake.BigObject) | ||
pm_polytope(::Polyhedron) | ||
``` | ||
|
||
There are several design differences between `polymake` and `Oscar`. | ||
|
||
!!! warning | ||
Polyhedra in `polymake` and `Polymake.jl` use homogeneous coordinates. The polyhedra in `Oscar` use affine coordinates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Welcome to Oscar | ||
|
||
Oscar is a new computer algebra system under development. | ||
Oscar is a new computer algebra system. | ||
While it is still under development it can already be used. | ||
|
||
Oscar features functions for groups, rings, and fields as well as linear and commutative algebra, number theory, algebraic and polyhedral geometry, and more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe its a bot late, but we should think about xA leq b as well - after all, matrices are supposed to be row matrices...