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

forward declaration of hyperplane More...

#include <hyperplane.hpp>

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

Public Types

using ConvexBase = ConvexSet< Meta, Hyperplane< Meta, Child >, Child >
 bring into scope the type traits from the base class
 
- Public Types inherited from convex::ConvexSet< Meta, Hyperplane< Meta, Child >, Child >
using BaseT = Atom< Meta, ConvexSet< Meta, Hyperplane< 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 Hyperplane (const PointT &a_in, T b_in, const Child &child_in)
 CTOR for hyperplane.
 
constexpr bool contains_impl (const PointT &x, T tol) const
 contains function to see if x lies in the hyerplane defined by a^T x = b
 
constexpr bool is_well_formed () const
 is well formed checks to see if the hyperplane is valid
 
template<linalg::SquareMatrix Mat>
requires (linalg::mat_cols_v<Mat> == N && std::same_as<linalg::matrix_scalar_t<Mat>, T>)
constexpr auto transform_impl (const affine::AffineMap< Mat > &map) const
 transform implementation
 
template<typename Other >
constexpr bool is_equal_impl (const Other &other) const
 is_equal implementation
 
template<AtomType Type, conic::BuilderLike Builder>
constexpr auto canonicalize_set (const Builder &builder) const
 canonicalize impl
 
- Public Member Functions inherited from convex::ConvexSet< Meta, Hyperplane< 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

PointT a
 member var in hyperplane
 
T 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.
 

Detailed Description

template<typename Meta, typename Child>
struct convex::Hyperplane< Meta, Child >

forward declaration of hyperplane

Hyperplane defition defined on valid vector space.

H = { x | a^T x = b } equivalent to { x | a^T x - b = 0 }

Definition at line 32 of file hyperplane.hpp.

Member Typedef Documentation

◆ ConvexBase

template<typename Meta , typename Child >
using convex::Hyperplane< Meta, Child >::ConvexBase = ConvexSet<Meta, Hyperplane<Meta, Child>, Child>

bring into scope the type traits from the base class

Definition at line 34 of file hyperplane.hpp.

Constructor & Destructor Documentation

◆ Hyperplane()

template<typename Meta , typename Child >
constexpr convex::Hyperplane< Meta, Child >::Hyperplane ( const PointT &  a_in,
T  b_in,
const Child &  child_in 
)
inlineexplicitconstexpr

CTOR for hyperplane.

Parameters
Point(i.e., n-dim vec of type T)
bbias scalar

Definition at line 45 of file hyperplane.hpp.

Member Function Documentation

◆ canonicalize_set()

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

canonicalize impl

Apply P^{-1}(C) -> K and map K to cone block

a^T x = b

Returns
cone block

Definition at line 116 of file hyperplane.hpp.

References convex::Hyperplane< Meta, Child >::a, convex::Hyperplane< Meta, Child >::b, convex::Atom< Meta, Derived, Cs >::children, convex::dom_size_v, and convex::Atom< Meta, Derived, Cs >::N.

◆ contains_impl()

template<typename Meta , typename Child >
constexpr bool convex::Hyperplane< Meta, Child >::contains_impl ( const PointT &  x,
T  tol 
) const
inlineconstexpr

contains function to see if x lies in the hyerplane defined by a^T x = b

Parameters
pointx of type T (n-dim)
tolerance
Returns
T/F

Definition at line 58 of file hyperplane.hpp.

References convex::Hyperplane< Meta, Child >::a, convex::Hyperplane< Meta, Child >::b, and convex::dom_size_v.

◆ is_equal_impl()

template<typename Meta , typename Child >
template<typename Other >
constexpr bool convex::Hyperplane< Meta, Child >::is_equal_impl ( const Other &  other) const
inlineconstexpr

is_equal implementation

Returns
T/F

Definition at line 102 of file hyperplane.hpp.

References convex::Hyperplane< Meta, Child >::a, convex::Hyperplane< Meta, Child >::b, and convex::dom_size_v.

◆ is_well_formed()

template<typename Meta , typename Child >
constexpr bool convex::Hyperplane< Meta, Child >::is_well_formed ( ) const
inlineconstexpr

is well formed checks to see if the hyperplane is valid

Returns
T/F

Definition at line 67 of file hyperplane.hpp.

References convex::Hyperplane< Meta, Child >::a.

◆ transform_impl()

template<typename Meta , typename Child >
template<linalg::SquareMatrix Mat>
requires (linalg::mat_cols_v<Mat> == N && std::same_as<linalg::matrix_scalar_t<Mat>, T>)
constexpr auto convex::Hyperplane< Meta, Child >::transform_impl ( const affine::AffineMap< Mat > &  map) const
inlineconstexpr

transform implementation

H = { x | a^T x = b } f(H) = { y = f(x) | x in H } y = U x + t -> x = U^{-1} (y - t) a^T U^{-1} (y - t) = b to a^T U^{-1} y = b + a^T U^{-1}

Parameters
affinemap
Returns
transformed hyperplane

Definition at line 87 of file hyperplane.hpp.

References convex::Hyperplane< Meta, Child >::a, convex::Hyperplane< Meta, Child >::b, and convex::dom_size_v.

Member Data Documentation

◆ a

◆ b


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