akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
Loading...
Searching...
No Matches
convex::ConvexSet< Meta, Derived, Child > Struct Template Reference

forward declaration of convex set More...

#include <convex_set.hpp>

Inheritance diagram for convex::ConvexSet< Meta, Derived, Child >:
[legend]

Public Types

using BaseT = Atom< Meta, ConvexSet< Meta, Derived, Child >, Child >
 alias to extract type traits from Domain convex set
 
- Public Types inherited from convex::Atom< Meta, ConvexSet< Meta, Derived, Child >, Child >
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 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
 
template<linalg::MatrixContainer Mat>
constexpr auto transform (const affine::AffineMap< Mat > &map) const
 transform convex set by affine map
 
template<typename OtherDerived , typename OtherChild >
constexpr bool operator== (const ConvexSet< Meta, OtherDerived, OtherChild > &other) const
 equality comparison overload
 
template<typename OtherDerived , typename OtherChild >
constexpr bool operator!= (const ConvexSet< Meta, OtherDerived, OtherChild > &other) const
 inequality comparison overload
 
template<AtomType Type, conic::BuilderLike Builder>
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, ConvexSet< Meta, Derived, Child >, Child >
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.
 
constexpr auto canonicalize (const Builder &builder) const
 Dispatch canonicalization to the derived atom.
 
constexpr const ConvexSet< Meta, Derived, Child > & self () const
 Return this object as the CRTP-derived atom type.
 

Additional Inherited Members

- Public Attributes inherited from convex::Atom< Meta, ConvexSet< Meta, Derived, Child >, Child >
ChildrenT children
 Tuple of normalized child atoms.
 
- Static Public Attributes inherited from convex::Atom< Meta, ConvexSet< Meta, Derived, Child >, Child >
static constexpr std::size_t N
 Domain dimension.
 
static constexpr std::size_t M
 Codomain dimension.
 
static constexpr CurvatureType Curvature
 Curvature declared by atom metadata.
 
static constexpr VarType DomSign
 Domain sign declared by atom metadata.
 
static constexpr VarType CodomSign
 Codomain sign declared by atom metadata.
 

Detailed Description

template<typename Meta, typename Derived, typename Child>
struct convex::ConvexSet< Meta, Derived, Child >

forward declaration of convex set

Base convex set class CRTP.

Restricting domain to R^n for the time being

Templated by a vector space and derived class

Definition at line 25 of file convex_set.hpp.

Member Typedef Documentation

◆ BaseT

template<typename Meta , typename Derived , typename Child >
using convex::ConvexSet< Meta, Derived, Child >::BaseT = Atom<Meta, ConvexSet<Meta, Derived, Child>, Child>

alias to extract type traits from Domain convex set

Definition at line 27 of file convex_set.hpp.

Constructor & Destructor Documentation

◆ ConvexSet()

template<typename Meta , typename Derived , typename Child >
constexpr convex::ConvexSet< Meta, Derived, Child >::ConvexSet ( const Child &  child_in)
inlineexplicitconstexpr

CTOR.

Parameters
children

Definition at line 39 of file convex_set.hpp.

Member Function Documentation

◆ canonicalize_impl()

template<typename Meta , typename Derived , typename Child >
template<AtomType Type, conic::BuilderLike Builder>
constexpr auto convex::ConvexSet< Meta, Derived, Child >::canonicalize_impl ( const Builder &  builder) const
inlineconstexpr

canonicalize

P^{-1}(C) -> K

Returns
cone block

Definition at line 115 of file convex_set.hpp.

References convex::dom_size_v, and convex::ConvexSet< Meta, Derived, Child >::self().

◆ contains()

template<typename Meta , typename Derived , typename Child >
constexpr bool convex::ConvexSet< Meta, Derived, Child >::contains ( const PointT &  x,
T  tol = 1e-8 
) const
inlineconstexpr

contains to check if the point lies in the convex set

Parameters
point(n-dim vector)
optionaltolerance
Returns
T/F

Definition at line 62 of file convex_set.hpp.

References convex::dom_size_v, and convex::ConvexSet< Meta, Derived, Child >::self().

◆ operator!=()

inequality comparison overload

Parameters
convexset
Returns
T/F

Definition at line 102 of file convex_set.hpp.

References convex::dom_size_v, and convex::ConvexSet< Meta, Derived, Child >::self().

◆ operator==()

template<typename Meta , typename Derived , typename Child >
constexpr bool convex::ConvexSet< Meta, Derived, Child >::operator== ( const ConvexSet< Meta, OtherDerived, OtherChild > &  other) const
inlineconstexpr

equality comparison overload

Parameters
convexset
Returns
T/F

Definition at line 89 of file convex_set.hpp.

References convex::dom_size_v, and convex::ConvexSet< Meta, Derived, Child >::self().

◆ self()

◆ transform()

template<typename Meta , typename Derived , typename Child >
template<linalg::MatrixContainer Mat>
constexpr auto convex::ConvexSet< Meta, Derived, Child >::transform ( const affine::AffineMap< Mat > &  map) const
inlineconstexpr

transform convex set by affine map

This is applied to convex sets like ellipsoid, polyhedron, simplex, etc... its image is another convex set

Parameters
affinemap
Returns
transformed set

Definition at line 77 of file convex_set.hpp.

References convex::ConvexSet< Meta, Derived, Child >::self().

◆ validate_domain_impl()

template<typename Meta , typename Derived , typename Child >
constexpr void convex::ConvexSet< Meta, Derived, Child >::validate_domain_impl ( ) const
inlineconstexpr

is_well_formed

Check to see if the underlying convex set is valid

Returns
T/F

Definition at line 49 of file convex_set.hpp.

References convex::dom_size_v, and convex::ConvexSet< Meta, Derived, Child >::self().


The documentation for this struct was generated from the following files: