|
|
lucid
0.0.1
Lifting-based Uncertain Control Invariant Dynamics
|
Multidimensional ellipsoid set. More...
#include <EllipseSet.h>
Public Member Functions | |
| EllipseSet (ConstVectorRef center, ConstVectorRef radii) | |
Construct an ellipsoid set from a center and a vector of radii. | |
| EllipseSet (ConstVectorRef center, Scalar radius) | |
Construct an ellipsoid set from a center and a uniform radius. | |
| Dimension | dimension () const override |
| Get read-only access to the dimension of the set \( \texttip{\mathcal{X}}{Polish sample vector space} \). | |
| Matrix | lattice (const VectorI &points_per_dim, bool endpoint) const override |
| Generate a lattice of points in the set. | |
| Matrix | sample (Index num_samples) const override |
| Extract \( N \) elements from \( \texttip{\mathcal{X}}{Polish sample vector space} \) using some kind of random distribution. | |
| bool | operator() (ConstVectorRef x) const override |
| Check if a vector is in \( \texttip{\mathcal{X}}{Polish sample vector space} \). | |
| const Vector & | center () const |
| Get read-only access to the center of the ellipsoid set. | |
| const Vector & | radii () const |
| Get read-only access to the radii of the ellipsoid set. | |
| Vector | general_lower_bound () const override |
| Get read-only access to the lower bound of the smallest rectangular set including the whole set. | |
| Vector | general_upper_bound () const override |
| Get read-only access to the upper bound of the smallest rectangular set including the whole set. | |
| void | change_size (ConstVectorRef delta_size) override |
| Change the size of the set. | |
| std::unique_ptr< Set > | to_rect_set () const override |
| Convert the set to a rectangular set. | |
| std::string | to_string () const override |
| Obtain the string representation of this object. | |
| std::unique_ptr< Set > | clone () const override |
| Clone the set. | |
| void | increase_size_impl (ConstVectorRef size_increase) override |
| Increase the size of the set. | |
| void | change_size (double delta_size) |
| Change the size of the set. | |
Public Member Functions inherited from lucid::Set | |
| Vector | sample () const |
| Extract an element from \( \texttip{\mathcal{X}}{Polish sample vector space} \) using some kind of random distribution. | |
| bool | contains (ConstVectorRef x) const |
| Check if a vector is in \( \texttip{\mathcal{X}}{Polish sample vector space} \). | |
| bool | contains_wrapped (ConstVectorRef x, ConstVectorRef period, Dimension num_periods) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | contains_wrapped (ConstVectorRef x, ConstVectorRef period, const std::vector< Dimension > &num_periods) const |
| Check if a vector is in \( \texttip{\mathcal{X}}{Polish sample vector space} \), having the vector wrapped around a given period. | |
| bool | contains_wrapped (ConstVectorRef x, ConstVectorRef period, Dimension num_periods_below, Dimension num_periods_above) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | contains_wrapped (ConstVectorRef x, ConstVectorRef period, const std::vector< Dimension > &num_periods_below, const std::vector< Dimension > &num_periods_above) const |
| Check if a vector is in \( \texttip{\mathcal{X}}{Polish sample vector space} \), having the vector wrapped around a given period. | |
| bool | contains_wrapped (ConstVectorRef x, ConstVectorRef period) const |
| Check if a vector is in \( \texttip{\mathcal{X}}{Polish sample vector space} \), having the vector wrapped around a given period. | |
| Matrix | include (ConstMatrixRef xs) const |
Filter a set xs, returning only the row vectors that are in \( \texttip{\mathcal{X}}{Polish sample vector space} \). | |
| std::vector< Index > | include_mask (ConstMatrixRef xs) const |
Filter a set xs, returning a mask containing the indices corresponding to the row vectors that are in \( \texttip{\mathcal{X}}{Polish sample vector space} \). | |
| std::vector< Index > | include_mask_wrapped (ConstMatrixRef xs, ConstVectorRef period) const |
Filter a set xs, returning a mask containing the indices corresponding to the row vectors that are in \( \texttip{\mathcal{X}}{Polish sample vector space} \), accounting for wrapping around a given period. | |
| Matrix | exclude (ConstMatrixRef xs) const |
Filter xs, return only the row vectors that are NOT in \( \texttip{\mathcal{X}}{Polish sample vector space} \). | |
| std::vector< Index > | exclude_mask (ConstMatrixRef xs) const |
Filter a set xs, returning a mask containing the indices corresponding to the row vectors that are NOT in \( \texttip{\mathcal{X}}{Polish sample vector space} \). | |
| std::vector< Index > | exclude_mask_wrapped (ConstMatrixRef xs, ConstVectorRef period) const |
Filter a set xs, returning a mask containing the indices corresponding to the row vectors that are NOT in \( \texttip{\mathcal{X}}{Polish sample vector space} \), accounting for wrapping around a given period. | |
| std::pair< std::vector< Index >, std::vector< Index > > | include_exclude_masks (ConstMatrixRef xs) const |
Filter a set xs, returning masks containing the indices corresponding to the row vectors that are in \( \texttip{\mathcal{X}}{Polish sample vector space} \) and NOT in \( \texttip{\mathcal{X}}{Polish sample vector space} \). | |
| std::pair< std::vector< Index >, std::vector< Index > > | include_exclude_masks_wrapped (ConstMatrixRef xs, ConstVectorRef period) const |
Filter a set xs, returning masks containing the indices corresponding to the row vectors that are in \( \texttip{\mathcal{X}}{Polish sample vector space} \) and NOT in \( \texttip{\mathcal{X}}{Polish sample vector space} \), accounting for wrapping around a given period. | |
| std::pair< std::vector< Index >, std::vector< Index > > | include_exclude_masks_wrapped (ConstMatrixRef xs, const RectSet &period) const |
Filter a set xs, returning masks containing the indices corresponding to the row vectors that are in \( \texttip{\mathcal{X}}{Polish sample vector space} \) and NOT in \( \texttip{\mathcal{X}}{Polish sample vector space} \), accounting for wrapping around a given period. | |
| std::unique_ptr< Set > | scale_wrapped (double scale, const RectSet &bounds, bool relative_to_bounds=false) const |
| Scale the set by the given factor while keeping it inside the given bounds. | |
| std::unique_ptr< Set > | scale_wrapped (ConstVectorRef scale, const RectSet &bounds, bool relative_to_bounds=false) const |
| Scale the set by the given factor while keeping it inside the given bounds. | |
| template<bool Inplace = false> requires (!Inplace) | |
| std::unique_ptr< Set > | increase_size (ConstVectorRef size_increase) const |
| Increase the size of the set. | |
| template<bool Inplace = false> requires (Inplace) | |
| void | increase_size (ConstVectorRef size_increase) |
| Increase the size of the set. | |
| void | change_size (double delta_size) |
| Change the size of the set. | |
| Matrix | lattice (Index points_per_dim, bool endpoint=false) const |
| Generate a lattice of points in the set. | |
| virtual std::unique_ptr< Set > | to_anisotropic () const |
| Create a new anisotropic set. | |
| template<class Derived> | |
| Eigen::MatrixBase< Derived > & | operator>> (Eigen::MatrixBase< Derived > &x) const |
| Extract \( N \) elements element from \( \texttip{\mathcal{X}}{Polish sample vector space} \) using some kind of random distribution, where \( N \) is the number of rows in \( \texttip{x}{Element of the vector space} \). | |
Public Attributes | |
| Vector | center_ |
| Center of the ellipsoid. Determines the dimension of the ellipsoid set. | |
| Vector | radii_ |
| Radii for each dimension. | |
Additional Inherited Members | |
Protected Member Functions inherited from lucid::Set | |
| virtual std::unique_ptr< Set > | scale_wrapped_impl (ConstVectorRef scale, const RectSet &bounds, bool relative_to_bounds) const |
| Scale the rectangular set by the given factor while keeping it inside the given bounds. | |
Multidimensional ellipsoid set.
A vector \( \texttip{x}{Element of the vector space} \) is in the set if \( \sum_{i=1}^{d} \left(\frac{x_i - c_i}{r_i}\right)^2 \le 1 \), where \( c \) is the center and \( r \) is the vector of radii. The sampling is uniform over the volume of the ellipse. The samples are generated using an adapted version of the Muller method.
| lucid::EllipseSet::EllipseSet | ( | ConstVectorRef | center, |
| ConstVectorRef | radii ) |
Construct an ellipsoid set from a center and a vector of radii.
The dimension of the space the ellipsoid set lives in is determined by the size of the center vector.
| center | vector representing the center of the ellipsoid |
| radii | vector of radii for each dimension |
| lucid::EllipseSet::EllipseSet | ( | ConstVectorRef | center, |
| Scalar | radius ) |
Construct an ellipsoid set from a center and a uniform radius.
This creates a sphere (all radii are equal). The dimension of the space the ellipsoid set lives in is determined by the size of the center vector.
| center | vector representing the center of the ellipsoid |
| radius | uniform radius for all dimensions |
|
inlinenodiscard |
Get read-only access to the center of the ellipsoid set.
|
overridevirtual |
Change the size of the set.
The size change can be different for each dimension. For example, for a rectangular set, this would change the lower and upper bounds so that the original set sits in the center of the new set, which has its size changed by the specified amounts.
delta_size must be equal to the dimension of the set. | delta_size | vector of amounts to change the size of the set for each dimension |
Reimplemented from lucid::Set.
| void lucid::Set::change_size | ( | double | delta_size | ) |
Change the size of the set.
The size change can be different for each dimension. For example, for a rectangular set, this would change the lower and upper bounds so that the original set sits in the center of the new set, which has its size changed by the specified amounts.
| delta_size | amount to change the size of the set |
|
nodiscardoverridevirtual |
Clone the set.
Create a new instance of the set with the same properties as the current one.
Implements lucid::Set.
|
inlinenodiscardoverridevirtual |
Get read-only access to the dimension of the set \( \texttip{\mathcal{X}}{Polish sample vector space} \).
Implements lucid::Set.
|
nodiscardoverridevirtual |
Get read-only access to the lower bound of the smallest rectangular set including the whole set.
Reimplemented from lucid::Set.
|
nodiscardoverridevirtual |
Get read-only access to the upper bound of the smallest rectangular set including the whole set.
Reimplemented from lucid::Set.
|
overridevirtual |
Increase the size of the set.
The size increase can be different for each dimension. The increase is applied symmetrically around the center of the set such that the total size after the increase is equal to the original size plus size_increase.
scale must be equal to the dimension of the set. | size_increase | amount to increase the size of the set for each dimension |
Reimplemented from lucid::Set.
|
nodiscardoverridevirtual |
Generate a lattice of points in the set.
| points_per_dim | number of points per each dimension |
| endpoint | whether to include the endpoints of the lattice |
Implements lucid::Set.
|
nodiscardoverridevirtual |
Check if a vector is in \( \texttip{\mathcal{X}}{Polish sample vector space} \).
| x | vector to test |
Implements lucid::Set.
|
inlinenodiscard |
Get read-only access to the radii of the ellipsoid set.
|
nodiscardoverridevirtual |
Extract \( N \) elements from \( \texttip{\mathcal{X}}{Polish sample vector space} \) using some kind of random distribution.
num_samples must be greater than 0 | num_samples | number of samples to generate \( N \) |
Implements lucid::Set.
|
nodiscardoverridevirtual |
Convert the set to a rectangular set.
Not all sets can be converted to rectangular sets. If the set cannot be converted, an exception is thrown.
Reimplemented from lucid::Set.
|
nodiscardoverridevirtual |
Obtain the string representation of this object.
Reimplemented from lucid::Set.