Skip to content
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

Use technical term 'centrally symmetric' for 'point symmetric' #588

Merged
merged 2 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/src/assets/interfaces.graphml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<data key="d4"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="28.0" width="254.0" x="236.0" y="9.0"/>
<y:Geometry height="28.0" width="70.0" x="328.0" y="9.0"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="61.49072265625" x="96.254638671875" y="3.0">LazySet<y:LabelModel>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="61.49072265625" x="4.254638671875" y="3.0">LazySet<y:LabelModel>
<y:SmartNodeLabelModel distance="4.0"/>
</y:LabelModel>
<y:ModelParameter>
Expand Down Expand Up @@ -60,10 +60,10 @@
<data key="d4"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="28.0" width="196.0" x="414.16741690653123" y="82.0"/>
<y:Geometry height="28.0" width="222.0" x="408.16741690653123" y="82.0"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="183.34033203125" x="6.329833984375" y="3.0">AbstractPointSymmetric<y:LabelModel>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="211.3525390625" x="5.32373046875" y="3.0">AbstractCentrallySymmetric<y:LabelModel>
<y:SmartNodeLabelModel distance="4.0"/>
</y:LabelModel>
<y:ModelParameter>
Expand All @@ -81,10 +81,10 @@
<data key="d4"/>
<data key="d6">
<y:UMLClassNode>
<y:Geometry height="28.0" width="262.0" x="232.0" y="149.0"/>
<y:Geometry height="28.0" width="286.0" x="220.0" y="149.0"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="247.99755859375" x="7.001220703125" y="3.0">AbstractPointSymmetricPolytope<y:LabelModel>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="276.009765625" x="4.9951171875" y="3.0">AbstractCentrallySymmetricPolytope<y:LabelModel>
<y:SmartNodeLabelModel distance="4.0"/>
</y:LabelModel>
<y:ModelParameter>
Expand Down
Binary file modified docs/src/assets/interfaces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 15 additions & 14 deletions docs/src/lib/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,30 @@ diameter(::LazySet, ::Real)
an_element(::LazySet{Real})
```

## Point symmetric set
## Centrally symmetric set

Point symmetric sets such as balls of different norms are characterized by a
Centrally symmetric sets such as balls of different norms are characterized by a
center.
Note that there is a special interface combination
[Point symmetric polytope](@ref).
[Centrally symmetric polytope](@ref).

```@docs
AbstractPointSymmetric
AbstractCentrallySymmetric
```

This interface defines the following functions:

```@docs
dim(::AbstractPointSymmetric)
an_element(::AbstractPointSymmetric{N}) where {N<:Real}
dim(::AbstractCentrallySymmetric)
an_element(::AbstractCentrallySymmetric{N}) where {N<:Real}
```

## Polytope

A polytope has finitely many vertices (*V-representation*) resp. facets
(*H-representation*).
Note that there is a special interface combination
[Point symmetric polytope](@ref).
[Centrally symmetric polytope](@ref).

```@docs
AbstractPolytope
Expand Down Expand Up @@ -128,25 +128,26 @@ addconstraint!(::AbstractHPolygon{Real}, ::LinearConstraint{Real})
constraints_list(::AbstractHPolygon{Real})
```

### Point symmetric polytope
### Centrally symmetric polytope

A point symmetric polytope is a combination of two other interfaces:
[Point symmetric set](@ref) and [Polytope](@ref).
A centrally symmetric polytope is a combination of two other interfaces:
[Centrally symmetric set](@ref) and [Polytope](@ref).

```@docs
AbstractPointSymmetricPolytope
AbstractCentrallySymmetricPolytope
```

This interface defines the following functions:

```@docs
dim(::AbstractPointSymmetricPolytope)
an_element(::AbstractPointSymmetricPolytope{N}) where {N<:Real}
dim(::AbstractCentrallySymmetricPolytope)
an_element(::AbstractCentrallySymmetricPolytope{N}) where {N<:Real}
```

#### Hyperrectangle

A hyperrectangle is a special point symmetric polytope with axis-aligned facets.
A hyperrectangle is a special centrally symmetric polytope with axis-aligned
facets.

```@docs
AbstractHyperrectangle
Expand Down
4 changes: 2 additions & 2 deletions docs/src/lib/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ Inherited from [`AbstractPolytope`](@ref):
* [`singleton_list`](@ref singleton_list(::AbstractPolytope))
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::AbstractPolytope))

Inherited from [`AbstractPointSymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetricPolytope))
Inherited from [`AbstractCentrallySymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetricPolytope))
* `an_element`

Inherited from [`AbstractHyperrectangle`](@ref):
Expand Down
32 changes: 16 additions & 16 deletions docs/src/lib/representations.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Inherited from [`LazySet`](@ref):
* [`radius`](@ref radius(::LazySet, ::Real))
* [`diameter`](@ref diameter(::LazySet, ::Real))

Inherited from [`AbstractPointSymmetric`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetric))
Inherited from [`AbstractCentrallySymmetric`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetric))
* `an_element`

### Infinity norm ball
Expand All @@ -50,8 +50,8 @@ Inherited from [`AbstractPolytope`](@ref):
* [`singleton_list`](@ref singleton_list(::AbstractPolytope))
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::AbstractPolytope))

Inherited from [`AbstractPointSymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetricPolytope))
Inherited from [`AbstractCentrallySymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetricPolytope))
* `an_element`

Inherited from [`AbstractHyperrectangle`](@ref):
Expand All @@ -78,8 +78,8 @@ Inherited from [`AbstractPolytope`](@ref):
* [`singleton_list`](@ref singleton_list(::AbstractPolytope))
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::AbstractPolytope))

Inherited from [`AbstractPointSymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetricPolytope))
Inherited from [`AbstractCentrallySymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetricPolytope))
* `an_element`

### p-norm ball
Expand All @@ -95,8 +95,8 @@ Inherited from [`LazySet`](@ref):
* [`radius`](@ref radius(::LazySet, ::Real))
* [`diameter`](@ref diameter(::LazySet, ::Real))

Inherited from [`AbstractPointSymmetric`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetric))
Inherited from [`AbstractCentrallySymmetric`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetric))
* `an_element`

## Ellipsoid
Expand All @@ -112,8 +112,8 @@ Inherited from [`LazySet`](@ref):
* [`radius`](@ref radius(::LazySet, ::Real))
* [`diameter`](@ref diameter(::LazySet, ::Real))

Inherited from [`AbstractPointSymmetric`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetric))
Inherited from [`AbstractCentrallySymmetric`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetric))
* `an_element`

## Empty set
Expand Down Expand Up @@ -182,8 +182,8 @@ Inherited from [`AbstractPolytope`](@ref):
* [`singleton_list`](@ref singleton_list(::AbstractPolytope))
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::AbstractPolytope))

Inherited from [`AbstractPointSymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetricPolytope))
Inherited from [`AbstractCentrallySymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetricPolytope))
* `an_element`

Inherited from [`AbstractHyperrectangle`](@ref):
Expand Down Expand Up @@ -389,8 +389,8 @@ Inherited from [`LazySet`](@ref):
Inherited from [`AbstractPolytope`](@ref):
* [`singleton_list`](@ref singleton_list(::AbstractPolytope))

Inherited from [`AbstractPointSymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetricPolytope))
Inherited from [`AbstractCentrallySymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetricPolytope))

Inherited from [`AbstractHyperrectangle`](@ref):
* [`norm`](@ref norm(::AbstractHyperrectangle, ::Real))
Expand Down Expand Up @@ -457,6 +457,6 @@ Inherited from [`LazySet`](@ref):
Inherited from [`AbstractPolytope`](@ref):
* [`singleton_list`](@ref singleton_list(::AbstractPolytope))

Inherited from [`AbstractPointSymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractPointSymmetricPolytope))
Inherited from [`AbstractCentrallySymmetricPolytope`](@ref):
* [`dim`](@ref dim(::AbstractCentrallySymmetricPolytope))
* `an_element`
8 changes: 4 additions & 4 deletions docs/src/man/set_operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ The table entries have the following meaning.
| `LazySet` | | | | | |
| `AHPolygon` | | | | x | x |
| `AHyperrectangle` | x | x | x | (x) | x |
| `APointSymmetric` | | | | x | |
| `APointSymmetricPolytope` | | | | x | |
| `ACentrallySymmetric` | | | | x | |
| `ACentrallySymmetricPolytope`| | | | x | |
| `APolygon` | | | | | |
| `APolytope` | | | | | |
| `ASingleton` | (x) | (x) | (x) | x | x |
Expand Down Expand Up @@ -198,8 +198,8 @@ The table entries consist of subsets of the following list of operations.
| `LazySet` | | | ⊆ | | | | |(⊆),∩=∅| | | (⊆) | | | | | | (⊆) | (⊆) | | (⊆) | | | | | | | | | | | | | | (⊆) |
| `AHPolygon` | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |
| `AHyperrectangle` | (⊆) | (⊆) |{⊆},∩=∅|(⊆)| (⊆) | (⊆) | (⊆) |[⊆,∩=∅]| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)|(⊆,∩=∅)|(⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |
| `APointSymmetric` | | | (⊆) | | | | |(⊆,∩=∅)| | | | | | | | | |(⊆,∩=∅)| |(⊆,∩=∅)| | | | | | | | | | | | | | |
| `APointSymmetricPolytope` | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |
| `ACentrallySymmetric` | | | (⊆) | | | | |(⊆,∩=∅)| | | | | | | | | |(⊆,∩=∅)| |(⊆,∩=∅)| | | | | | | | | | | | | | |
| `ACentrallySymmetricPolytope`| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |
| `APolygon` | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |
| `APolytope` | ⊆ | (⊆) | [⊆] | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |(⊆,∩=∅)| (⊆) |(⊆,∩=∅)| (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) | (⊆) |
| `ASingleton` |{⊆},∩=∅|(⊆,∩=∅)|[⊆,∩=∅]|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|[⊆,∩=∅]|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|((⊆,∩=∅))|(⊆,∩=∅)|((⊆,∩=∅))|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|(⊆,∩=∅)|
Expand Down
60 changes: 60 additions & 0 deletions src/AbstractCentrallySymmetric.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
export AbstractCentrallySymmetric,
center,
an_element

"""
AbstractCentrallySymmetric{N<:Real} <: LazySet{N}

Abstract type for centrally symmetric sets.

### Notes

Every concrete `AbstractCentrallySymmetric` must define the following functions:

- `center(::AbstractCentrallySymmetric{N})::Vector{N}` -- return the center
point

```jldoctest
julia> subtypes(AbstractCentrallySymmetric)
3-element Array{Any,1}:
Ball2
Ballp
Ellipsoid
```
"""
abstract type AbstractCentrallySymmetric{N<:Real} <: LazySet{N} end


"""
dim(S::AbstractCentrallySymmetric)::Int

Return the ambient dimension of a centrally symmetric set.

### Input

- `S` -- set

### Output

The ambient dimension of the set.
"""
@inline function dim(S::AbstractCentrallySymmetric)::Int
return length(center(S))
end

"""
an_element(S::AbstractCentrallySymmetric{N})::Vector{N} where {N<:Real}

Return some element of a centrally symmetric set.

### Input

- `S` -- centrally symmetric set

### Output

The center of the centrally symmetric set.
"""
function an_element(S::AbstractCentrallySymmetric{N})::Vector{N} where {N<:Real}
return center(S)
end
78 changes: 78 additions & 0 deletions src/AbstractCentrallySymmetricPolytope.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
export AbstractCentrallySymmetricPolytope,
center,
an_element,
vertices_list,
singleton_list

"""
AbstractCentrallySymmetricPolytope{N<:Real} <: AbstractPolytope{N}

Abstract type for centrally symmetric, polytopic sets.
It combines the `AbstractCentrallySymmetric` and `AbstractPolytope` interfaces.
Such a type combination is necessary as long as Julia does not support
[multiple inheritance](https://github.com/JuliaLang/julia/issues/5).

### Notes

Every concrete `AbstractCentrallySymmetricPolytope` must define the following
functions:
- from `AbstractCentrallySymmetric`:
- `center(::AbstractCentrallySymmetricPolytope{N})::Vector{N}` -- return the
center point
- from `AbstractPolytope`:
- `vertices_list(::AbstractCentrallySymmetricPolytope{N})::Vector{Vector{N}}`
-- return a list of all vertices

```jldoctest
julia> subtypes(AbstractCentrallySymmetricPolytope)
5-element Array{Any,1}:
AbstractHyperrectangle
Ball1
Interval
LineSegment
Zonotope
```
"""
abstract type AbstractCentrallySymmetricPolytope{N<:Real} <: AbstractPolytope{N}
end


# --- common AbstractCentrallySymmetric functions (copy-pasted) ---


"""
dim(P::AbstractCentrallySymmetricPolytope)::Int

Return the ambient dimension of a centrally symmetric set.

### Input

- `P` -- set

### Output

The ambient dimension of the set.
"""
@inline function dim(P::AbstractCentrallySymmetricPolytope)::Int
return length(center(P))
end


"""
an_element(P::AbstractCentrallySymmetricPolytope{N})::Vector{N}
where {N<:Real}

Return some element of a centrally symmetric polytope.

### Input

- `P` -- centrally symmetric polytope

### Output

The center of the centrally symmetric polytope.
"""
function an_element(P::AbstractCentrallySymmetricPolytope{N}
)::Vector{N} where {N<:Real}
return center(P)
end
4 changes: 2 additions & 2 deletions src/AbstractHyperrectangle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export AbstractHyperrectangle,
radius_hyperrectangle

"""
AbstractHyperrectangle{N<:Real} <: AbstractPointSymmetricPolytope{N}
AbstractHyperrectangle{N<:Real} <: AbstractCentrallySymmetricPolytope{N}

Abstract type for hyperrectangular sets.

Expand All @@ -25,7 +25,7 @@ julia> subtypes(AbstractHyperrectangle)
SymmetricIntervalHull
```
"""
abstract type AbstractHyperrectangle{N<:Real} <: AbstractPointSymmetricPolytope{N}
abstract type AbstractHyperrectangle{N<:Real} <: AbstractCentrallySymmetricPolytope{N}
end


Expand Down
Loading