|
akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
|
forward declaration of polyhedron set More...
#include <polyhedron.hpp>
Public Types | |
| using | ConvexBase = ConvexSet< Meta, Polyhedron< Meta, Child >, Child > |
| bring into scope the type traits from the base class | |
| using | Mat = linalg::Matrix< T, M, N > |
| bring into scope type traits from MatA | |
| using | Bias = linalg::Vector< T, M > |
| using | Space = linalg::Matrix< T, 1, N > |
Public Types inherited from convex::ConvexSet< Meta, Polyhedron< Meta, Child >, Child > | |
| using | BaseT = Atom< Meta, ConvexSet< Meta, Polyhedron< Meta, Child >, Child >, Child > |
| alias to extract type traits from Domain convex set | |
Public Types inherited from convex::Atom< Meta, Derived, Cs > | |
| using | Domain = meta_dom_t< Meta > |
| Atom input domain. | |
| using | Codomain = meta_codom_t< Meta > |
| Atom output codomain. | |
| using | ChildrenT = std::tuple< atom_decay_t< Cs >... > |
| Tuple of decayed child atom types. | |
| using | T = dom_type_t< Domain > |
| Scalar field for the atom domain. | |
| using | PointT = dom_point_t< Domain > |
| Point type accepted by the atom domain. | |
Public Member Functions | |
| constexpr | Polyhedron (const Mat &A_in, const Bias &b_in, const Child &child_in) |
| CTOR for polyhedron set. | |
| constexpr bool | is_well_formed () const |
| is_well_formed implementation | |
| constexpr bool | contains_impl (const PointT &x, T tol) const |
| check if candidate vector is in the set | |
| template<linalg::SquareMatrix Mat> requires (std::same_as<T, linalg::matrix_scalar_t<Mat>> && linalg::mat_cols_v<Mat> == N) | |
| constexpr auto | transform_impl (const affine::AffineMap< Mat > &map) const |
| transform polyhedron by affine map | |
| template<typename Other > | |
| constexpr bool | is_equal_impl (const Other &other) const |
| equality comparison | |
| template<AtomType Type, conic::BuilderLike Builder> | |
| constexpr auto | canonicalize_set (const Builder &builder) const |
| canonicalize impl | |
Public Member Functions inherited from convex::ConvexSet< Meta, Polyhedron< Meta, Child >, Child > | |
| constexpr | ConvexSet (const Child &child_in) |
| CTOR. | |
| constexpr void | validate_domain_impl () const |
| is_well_formed | |
| constexpr bool | contains (const PointT &x, T tol=1e-8) const |
| contains to check if the point lies in the convex set | |
| constexpr auto | transform (const affine::AffineMap< Mat > &map) const |
| transform convex set by affine map | |
| constexpr bool | operator== (const ConvexSet< Meta, OtherDerived, OtherChild > &other) const |
| equality comparison overload | |
| constexpr bool | operator!= (const ConvexSet< Meta, OtherDerived, OtherChild > &other) const |
| inequality comparison overload | |
| constexpr auto | canonicalize_impl (const Builder &builder) const |
| canonicalize | |
| constexpr auto | self () const |
| self function which returns a const ref to the derived object | |
Public Member Functions inherited from convex::Atom< Meta, Derived, Cs > | |
| constexpr | Atom () |
| Construct a leaf atom with no children. | |
| constexpr | Atom (ChildrenT child_in) |
| Construct an atom with normalized children. | |
| constexpr void | validate_fn_domain (const auto &child) const |
| Validate DCP composition for a function child. | |
| constexpr void | validate_domain () const |
| Validate child domains, signs, curvature, and composition rules. | |
| template<AtomType Type, conic::BuilderLike Builder> | |
| constexpr auto | canonicalize (const Builder &builder) const |
| Dispatch canonicalization to the derived atom. | |
| constexpr const Derived & | self () const |
| Return this object as the CRTP-derived atom type. | |
Public Attributes | |
| Mat | A |
| member variables in the polyhedron | |
| Bias | b |
Public Attributes inherited from convex::Atom< Meta, Derived, Cs > | |
| ChildrenT | children |
| Tuple of normalized child atoms. | |
Additional Inherited Members | |
Static Public Attributes inherited from convex::Atom< Meta, Derived, Cs > | |
| static constexpr std::size_t | N = dom_size_v<Domain> |
| Domain dimension. | |
| static constexpr std::size_t | M = dom_size_v<Codomain> |
| Codomain dimension. | |
| static constexpr CurvatureType | Curvature = meta_curv_v<Meta> |
| Curvature declared by atom metadata. | |
| static constexpr VarType | DomSign = dom_vartype_v<Domain> |
| Domain sign declared by atom metadata. | |
| static constexpr VarType | CodomSign = dom_vartype_v<Codomain> |
| Codomain sign declared by atom metadata. | |
forward declaration of polyhedron set
Polyhedron convex set.
P = { x | A x <= b }... deprecating Cx = d in favor of a separate intersection with an affine subspace or additional constraint to be added in the problem space
Definition at line 35 of file polyhedron.hpp.
| using convex::Polyhedron< Meta, Child >::Bias = linalg::Vector<T, M> |
Definition at line 45 of file polyhedron.hpp.
| using convex::Polyhedron< Meta, Child >::ConvexBase = ConvexSet<Meta, Polyhedron<Meta, Child>, Child> |
bring into scope the type traits from the base class
Definition at line 37 of file polyhedron.hpp.
bring into scope type traits from MatA
Definition at line 44 of file polyhedron.hpp.
| using convex::Polyhedron< Meta, Child >::Space = linalg::Matrix<T, 1, N> |
Definition at line 46 of file polyhedron.hpp.
|
inlineexplicitconstexpr |
CTOR for polyhedron set.
| A | basis of vectors describing linear combinations with x to form halfspace |
| b | vector describing halfspace inequality (per row vec in A) |
| child |
Definition at line 56 of file polyhedron.hpp.
|
inlineconstexpr |
canonicalize impl
C = { x | A x <= b }
Direct cone map: -A x + b in R_+^m
Definition at line 144 of file polyhedron.hpp.
References convex::Polyhedron< Meta, Child >::A, convex::Polyhedron< Meta, Child >::b, convex::Atom< Meta, Derived, Cs >::children, convex::dom_size_v, and convex::Atom< Meta, Derived, Cs >::N.
|
inlineconstexpr |
check if candidate vector is in the set
| Vec | X of type T with N elements |
Definition at line 81 of file polyhedron.hpp.
References convex::Polyhedron< Meta, Child >::A, convex::Polyhedron< Meta, Child >::b, convex::Atom< Meta, Derived, Cs >::children, convex::dom_size_v, convex::LH, and convex::Atom< Meta, Derived, Cs >::M.
|
inlineconstexpr |
equality comparison
| convex | set |
Definition at line 129 of file polyhedron.hpp.
References convex::Polyhedron< Meta, Child >::A, convex::Polyhedron< Meta, Child >::b, and convex::dom_size_v.
|
inlineconstexpr |
is_well_formed implementation
Definition at line 65 of file polyhedron.hpp.
References convex::Polyhedron< Meta, Child >::A, convex::Polyhedron< Meta, Child >::b, convex::Atom< Meta, Derived, Cs >::children, convex::dom_size_v, convex::Polyhedron< Meta, Child >::is_well_formed(), convex::LH, and convex::Atom< Meta, Derived, Cs >::M.
Referenced by convex::Polyhedron< Meta, Child >::is_well_formed().
|
inlineconstexpr |
transform polyhedron by affine map
P = { x | Ax <= b, Cx = d } f(x) = U x + t
P' = { y = f(x) | x in P } y = U x + t to x = U^{-1}(y - t)
constraints become: A U^{-1} (y - t) <= b & C U^{-1} (y - t) = d (i) A U^{-1} y <= b + A U^{-1} t (ii) C U^{-1} y = d + C U^{-1} t
Definition at line 109 of file polyhedron.hpp.
References convex::Polyhedron< Meta, Child >::A, convex::Polyhedron< Meta, Child >::b, convex::Atom< Meta, Derived, Cs >::children, and convex::dom_size_v.
member variables in the polyhedron
Definition at line 166 of file polyhedron.hpp.
Referenced by convex::Polyhedron< Meta, Child >::canonicalize_set(), convex::Polyhedron< Meta, Child >::contains_impl(), convex::Polyhedron< Meta, Child >::is_equal_impl(), convex::Polyhedron< Meta, Child >::is_well_formed(), and convex::Polyhedron< Meta, Child >::transform_impl().
Definition at line 167 of file polyhedron.hpp.
Referenced by convex::Polyhedron< Meta, Child >::canonicalize_set(), convex::Polyhedron< Meta, Child >::contains_impl(), convex::Polyhedron< Meta, Child >::is_equal_impl(), convex::Polyhedron< Meta, Child >::is_well_formed(), and convex::Polyhedron< Meta, Child >::transform_impl().