|
akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
|
forward declaration - abs fn More...
#include <abs.hpp>
Public Types | |
| using | ConvexBase = Atom< Meta, Abs< Meta, Child >, Child > |
| bring into scope convex fn alias / helpers | |
| using | Space = dom_space_t< meta_dom_t< Meta > > |
| alias to extract space type | |
Public Types inherited from convex::Atom< Meta, Abs< Meta, 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 | Abs (const Child &child_in) |
| CTOR. | |
| constexpr | Abs (const Child &child_in, const affine::AffineMap< LiftedVarMat< T > > &map_in) |
| CTOR. | |
| constexpr MonotonicityType | monotonicity () const |
| mono | |
| constexpr T | operator() (const PointT &x) const |
| eval via operator overload | |
| constexpr T | eval (const PointT &x) const |
| eval impl | |
| template<T Scalar> | |
| constexpr auto | mul () const |
| mul | |
| constexpr auto | add (T beta) const |
| add | |
| template<AtomType Type, conic::BuilderLike Builder> | |
| constexpr auto | canonicalize_impl (const Builder &builder) const |
| canonicalize_impl | |
Public Member Functions inherited from convex::Atom< Meta, Abs< Meta, 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 Abs< Meta, Child > & | self () const |
| Return this object as the CRTP-derived atom type. | |
Public Attributes | |
| affine::AffineMap< LiftedVarMat< T > > | lift_map |
| member vars | |
| const int | idx {-1} |
Public Attributes inherited from convex::Atom< Meta, Abs< Meta, Child >, Child > | |
| ChildrenT | children |
| Tuple of normalized child atoms. | |
Static Public Attributes | |
| static constexpr CurvatureType | Tag = meta_curv_v<Meta> |
| curvature tag | |
Static Public Attributes inherited from convex::Atom< Meta, Abs< Meta, 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. | |
forward declaration - abs fn
abs function
f(x) = |x|, x in R
| using convex::Abs< Meta, Child >::Space = dom_space_t<meta_dom_t<Meta> > |
|
inlineexplicitconstexpr |
|
inlineexplicitconstexpr |
|
inlineconstexpr |
add
| scalar |
Definition at line 159 of file abs.hpp.
References convex::dom_size_v.
|
inlineconstexpr |
canonicalize_impl
(1) abs(x) -> epi -> cones f(x) = |x| K_epi = { (x,t) | |x| <= t }
let u >= |x|... first convex constraint 0 <= t - u... second convex constraint u >= 0... third convex constraint t >= 0... fourth convex constraint
-u <= x <= u 0 <= u + x... nonneg orthant cone 0 <= u - x... nonneg orthant cone 0 <= t - u... nonneg orthant cone u >= 0... nonneg orthant cone t >= 0... nonneg orthant cone
[ a^T 1 0 ] [ x; u; t ] + [ b; -b; 0; 0; 0 ] [ -a^T 1 0 ] [ 0 -1 1 ] [ 0 1 0 ] [ 0 0 1 ]
(2) -abs(x) -> hypo -> cones f(x) = - |x| K_hypo = { (x,t) | -|x| >= t, t <= 0}
let u >= |x|... first convex constraint let t <= -u... second convex constraint u >= 0... third convex constraint t <= 0... fourth convex constraint
0 <= u + x... nonneg orthant cone 0 <= u - x... nonneg orthant cone 0 <= -u - t... nonneg orthant cone u >= 0... nonneg orthant cone -t >= 0... nonneg orthant cone
[ a^T 1 0 ] [ x; u; t ] + [ b; -b; 0; 0; 0 ] [ -a^T 1 0 ] [ 0 -1 -1 ] [ 0 1 0 ] [ 0 0 -1 ]
| cone | block builder |
Definition at line 216 of file abs.hpp.
References convex::CONVEX, and convex::dom_size_v.
eval impl
| x | in R |
Definition at line 120 of file abs.hpp.
References convex::CONVEX, and convex::dom_size_v.
|
inlineconstexpr |
mono
Definition at line 82 of file abs.hpp.
References convex::CONVEX, convex::dom_size_v, convex::NONDEC, convex::NONINC, convex::NONNEG, convex::NONPOS, and convex::UNKNOWN.
|
inlineconstexpr |
mul
Definition at line 134 of file abs.hpp.
References convex::CONCAVE, and convex::dom_size_v.
|
inlineconstexpr |
| affine::AffineMap<LiftedVarMat<T> > convex::Abs< Meta, Child >::lift_map |
|
staticconstexpr |