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

Add polynomial zonotope #184

Merged
merged 11 commits into from
Feb 14, 2018
Merged

Add polynomial zonotope #184

merged 11 commits into from
Feb 14, 2018

Conversation

mforets
Copy link
Member

@mforets mforets commented Jan 23, 2018


Abstract type for non-convex sets.
"""
abstract type AbstractNonConvexSet{N} end
Copy link
Member

Choose a reason for hiding this comment

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

Let us do this properly in a separate PR:

  1. Move to a new file (and maybe rename to AbstractSet or even Set or LazySet).¹
  2. Make LazySet inherit from this new type and rename to AbstractConvexSet or just ConvexSet.¹ This basically means changing every file, so better merge most PRs first.
  3. Make UnionSet inherit from this new type and include it (there are already some unit tests).

Since this is a breaking change, we should probably do it before releasing 1.1.0.

¹This will be something we and the user will write a lot, so a short name would be preferable.

Copy link
Member

Choose a reason for hiding this comment

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

outsourced to #185

Copy link
Member Author

Choose a reason for hiding this comment

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

Since this is a breaking change, we should probably do it before releasing 1.1.0.

2.0 iiuc since that would be an incompatible API change (https://semver.org/)

Copy link
Member Author

Choose a reason for hiding this comment

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

ok i've updated to <: LazySet{N}, what i should have done in the 1st place, at least 'till we resolve the approach for #185.

Copy link
Member

Choose a reason for hiding this comment

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

#185 was created for this issue (only later). You could not have done that before ;)


- `c` -- starting point
- `E` -- multi-indexed generators such that *all* indices have the same value
- `F` -- multi-indexed generators such that *not all* indices are the same value
Copy link
Member

Choose a reason for hiding this comment

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

"are" → "have"


### Notes

Polynomial zonotope were introduced by M. Althoff in *Reachability analysis of nonlinear
Copy link
Member

Choose a reason for hiding this comment

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

"zonotope" → "zonotopes"

abstract type AbstractNonConvexSet{N} end

"""
PolynomialZonotope{N<:Real} <: AbstractNonConvexSet{N}
Copy link
Member

Choose a reason for hiding this comment

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

Here you have N<:Real, but not in the actual struct definition.


- `pz` -- polynomial zonotope
"""
dim(pz::PolynomialZonotope) = length(pz.c)
Copy link
Member

Choose a reason for hiding this comment

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

Add output docs and output type?

The polynomial order, defined as the maximal power of the scalar factors ``β_i``.
Usually denoted ``η``.
"""
polynomial_order(pz::PolynomialZonotope) = length(pz.E)
Copy link
Member

Choose a reason for hiding this comment

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

Add output type?


## Output

The polynomial order, defined as the number of generators divided by the ambient
Copy link
Member

Choose a reason for hiding this comment

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

Drop "polynomial".

The polynomial order, defined as the number of generators divided by the ambient
dimension.
"""
function order(pz::PolynomialZonotope)
Copy link
Member

Choose a reason for hiding this comment

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

Add output type?

@mforets
Copy link
Member Author

mforets commented Jan 24, 2018

To-do:

@mforets mforets force-pushed the mforets/polynomial_zonotope branch from 9b66fb1 to c9a5be6 Compare February 2, 2018 20:02
@mforets mforets added this to the v1.2.0 milestone Feb 13, 2018
@mforets mforets changed the title [WIP] add polynomial zonotope Add polynomial zonotope Feb 13, 2018
Copy link
Member

@schillic schillic left a comment

Choose a reason for hiding this comment

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

LGTM, although I did not check the maths :)


### Input

- `α` -- polynomial zonotope
Copy link
Member

Choose a reason for hiding this comment

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

scalar factor?

Copy link
Member Author

Choose a reason for hiding this comment

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


## Output

Polynomial zonotope such that its center and generators are multiples of those
Copy link
Member

Choose a reason for hiding this comment

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

Above you called the center "starting point".


Polynomial zonotope.
"""
function minkowski_sum(pz::PolynomialZonotope, z::Zonotope)
Copy link
Member

Choose a reason for hiding this comment

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

Add the symmetric method? It can fall back to this one.

Copy link
Member Author

Choose a reason for hiding this comment

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

good. i imagine some macro for lazy people (like us) used as:

@symmetric function minkowski_sum(pz::PolynomialZonotope, z::Zonotope)
    c = pz.c + z.center
    G = [G z.generators]
    return PolynomialZonotope(c, pz.E, pz.F, G)
end

and builds the new symmetric function using this one.


# type-specific concrete methods
scale(N(0.5), p)
linear_map(N[1.0 2.0; 2.0 5.0], p)
Copy link
Member

Choose a reason for hiding this comment

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

Add a unit test for minkowski_sum?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok. i plan to add proper @test's when with #230 gets in

@schillic
Copy link
Member

I added "support vector" to the open tasks list above - do not forget it ;)

@mforets mforets merged commit f4c5600 into master Feb 14, 2018
@mforets mforets deleted the mforets/polynomial_zonotope branch February 14, 2018 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants