Implements an ellipsoidal convex set represented as an affine scaling of the unit ball {Bu + center | |u|₂ ≤ 1}.
B must be a square matrix.
Compare this with an alternative parametrization of the ellipsoid: {x | (x-center)ᵀAᵀA(x-center) ≤ 1}, which utilizes a quadratic form. The two representations are related by B = A⁻¹ if A and B are invertible.
The quadratic form parametrization is implemented in Hyperellipsoid. It can represent unbounded sets, but not sets along a lower-dimensional affine subspace. The AffineBall parametrization can represent sets along a lower-dimensional affine subspace, but not unbounded sets.
An AffineBall can never be empty – it always contains its center. This includes the zero-dimensional case.
|
| | AffineBall () |
| | Constructs a default (zero-dimensional, nonempty) set.
|
| | AffineBall (const Eigen::Ref< const Eigen::MatrixXd > &B, const Eigen::Ref< const Eigen::VectorXd > ¢er) |
| | Constructs the ellipsoid from a transformation matrix B and translation center.
|
| | AffineBall (const Hyperellipsoid &ellipsoid) |
| | Constructs an AffineBall from a Hyperellipsoid.
|
| | ~AffineBall () final |
| const Eigen::MatrixXd & | B () const |
| | Returns the affine transformation matrix B.
|
| const Eigen::VectorXd & | center () const |
| | Returns the center of the ellipsoid.
|
| template<typename Archive> |
| void | Serialize (Archive *a) |
| | Passes this object to an Archive.
|
| bool | IsBounded (Parallelism parallelism=Parallelism::None()) const |
| | Every AffineBall is bounded by construction.
|
| | AffineBall (const AffineBall &)=default |
| AffineBall & | operator= (const AffineBall &)=default |
| | AffineBall (AffineBall &&)=default |
| AffineBall & | operator= (AffineBall &&)=default |
| virtual | ~ConvexSet () |
| std::unique_ptr< ConvexSet > | Clone () const |
| | Creates a unique deep copy of this set.
|
| int | ambient_dimension () const |
| | Returns the dimension of the vector space in which the elements of this set are evaluated.
|
| bool | IntersectsWith (const ConvexSet &other) const |
| | Returns true iff the intersection between this and other is non-empty.
|
| bool | IsBounded (Parallelism parallelism=Parallelism::None()) const |
| | Returns true iff the set is bounded, e.g., there exists an element-wise finite lower and upper bound for the set.
|
| bool | IsEmpty () const |
| | Returns true iff the set is empty.
|
| std::optional< Eigen::VectorXd > | MaybeGetPoint () const |
| | If this set trivially contains exactly one point, returns the value of that point.
|
| std::optional< Eigen::VectorXd > | MaybeGetFeasiblePoint () const |
| | Returns a feasible point within this convex set if it is nonempty, and nullopt otherwise.
|
| bool | PointInSet (const Eigen::Ref< const Eigen::VectorXd > &x, double tol=0) const |
| | Returns true iff the point x is contained in the set.
|
| std::pair< VectorX< symbolic::Variable >, std::vector< solvers::Binding< solvers::Constraint > > > | AddPointInSetConstraints (solvers::MathematicalProgram *prog, const Eigen::Ref< const solvers::VectorXDecisionVariable > &vars) const |
| | Adds a constraint to an existing MathematicalProgram enforcing that the point defined by vars is inside the set.
|
| std::vector< solvers::Binding< solvers::Constraint > > | AddPointInNonnegativeScalingConstraints (solvers::MathematicalProgram *prog, const Eigen::Ref< const solvers::VectorXDecisionVariable > &x, const symbolic::Variable &t) const |
| | Let S be this convex set.
|
| std::vector< solvers::Binding< solvers::Constraint > > | AddPointInNonnegativeScalingConstraints (solvers::MathematicalProgram *prog, const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::VectorXd > &b, const Eigen::Ref< const Eigen::VectorXd > &c, double d, const Eigen::Ref< const solvers::VectorXDecisionVariable > &x, const Eigen::Ref< const solvers::VectorXDecisionVariable > &t) const |
| | Let S be this convex set.
|
| std::pair< std::unique_ptr< Shape >, math::RigidTransformd > | ToShapeWithPose () const |
| | Constructs a Shape and a pose of the set in the world frame for use in the SceneGraph geometry ecosystem.
|
| double | CalcVolume () const |
| | Computes the exact volume for the convex set.
|
| SampledVolume | CalcVolumeViaSampling (RandomGenerator *generator, const double desired_rel_accuracy=1e-2, const int max_num_samples=1e4) const |
| | Calculates an estimate of the volume of the convex set using sampling and performing Monte Carlo integration.
|
| std::optional< std::pair< std::vector< double >, Eigen::MatrixXd > > | Projection (const Eigen::Ref< const Eigen::MatrixXd > &points) const |
| | Computes in the L₂ norm the distance and the nearest point in this convex set to every column of points.
|
| bool | has_exact_volume () const |
| | Returns true if the exact volume can be computed for this convex set instance.
|
|
| static AffineBall | MakeAxisAligned (const Eigen::Ref< const Eigen::VectorXd > &radius, const Eigen::Ref< const Eigen::VectorXd > ¢er) |
| | Constructs an axis-aligned AffineBall with the implicit form (x₀-c₀)²/r₀² + (x₁-c₁)²/r₁² + ... + (x_N - c_N)²/r_N² ≤ 1, where c is shorthand for center and r is shorthand for radius.
|
| static AffineBall | MakeHypersphere (double radius, const Eigen::Ref< const Eigen::VectorXd > ¢er) |
| | Constructs a hypersphere with radius and center.
|
| static AffineBall | MakeUnitBall (int dim) |
| | Constructs the L₂-norm unit ball in dim dimensions, {x | |x|₂ <= 1 }.
|
| static AffineBall | MinimumVolumeCircumscribedEllipsoid (const Eigen::Ref< const Eigen::MatrixXd > &points, double rank_tol=1e-6) |
| | Constructs the minimum-volume ellipsoid which contains all of the given points.
|
| static AffineBall | MakeAffineBallFromLineSegment (const Eigen::Ref< const Eigen::VectorXd > &x_1, const Eigen::Ref< const Eigen::VectorXd > &x_2, const double epsilon=1e-3) |
| | Constructs an affine ball such that its main diameter is the line segment from x_1 to x_2, and the length of all other diameters are 2 * epsilon.
|