|
akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
|
forward declaration - geo mean fn More...
#include <geo_mean.hpp>
Public Types | |
| using | ConvexBase = Atom< Meta, GeoMean< Meta, Child >, Child > |
| bring into scope the concave fn alias / helpers | |
| using | Space = dom_space_t< meta_dom_t< Meta > > |
| alias to extract space type | |
Public Types inherited from convex::Atom< Meta, GeoMean< 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 | GeoMean (const Child &child_in) |
| CTOR. | |
| constexpr | GeoMean (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 |
| evaluation 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, GeoMean< 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 GeoMean< 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, GeoMean< 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, GeoMean< 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 - geo mean fn
geometric mean f(x) = (prod_{i=1}^n x_i)^{1/n} is concave on dom f = R^n_++
Definition at line 49 of file geo_mean.hpp.
bring into scope the concave fn alias / helpers
Definition at line 51 of file geo_mean.hpp.
| using convex::GeoMean< Meta, Child >::Space = dom_space_t<meta_dom_t<Meta> > |
alias to extract space type
Definition at line 57 of file geo_mean.hpp.
|
inlineexplicitconstexpr |
|
inlineexplicitconstexpr |
|
inlineconstexpr |
add
| scalar |
Definition at line 152 of file geo_mean.hpp.
References convex::Atom< Meta, GeoMean< Meta, Child >, Child >::children, convex::dom_size_v, and convex::GeoMean< Meta, Child >::lift_map.
|
inlineconstexpr |
canonicalize_impl
(1) f(x) = prod_i^n(x_i)^{1/n} K_geo = { (x, t) | prod_i^n(x_i)^{1/n} >= t }... x in R_+ power cone = { (x,t) in R_+ x R | prod(x_i)^alpha_i >= |t|, sum(a_i) = 1, a_i >= 0 }
[ A 0 ] [ x; t ] + [ b; 0 ] -> [ A x + b; t ] [ 0 1 ]
(2) f(x) = -prod_i^n(x_i)^{1/n} K_geo = { (x, t) | prod_i^n(x_i)^{1/n} >= -t }... x in R_+
[ A 0 ] [ x; t ] + [ b; 0 ] -> [ A x + b; -t ] [ 0 -1 ]
| cone | map builder |
Definition at line 180 of file geo_mean.hpp.
References convex::Atom< Meta, GeoMean< Meta, Child >, Child >::children, convex::CONVEX, convex::dom_size_v, convex::GeoMean< Meta, Child >::idx, convex::GeoMean< Meta, Child >::lift_map, convex::Atom< Meta, GeoMean< Meta, Child >, Child >::N, and convex::GeoMean< Meta, Child >::Tag.
evaluation impl
| x | in dom f |
Definition at line 108 of file geo_mean.hpp.
References convex::CONVEX, convex::dom_size_v, convex::GeoMean< Meta, Child >::lift_map, convex::Atom< Meta, GeoMean< Meta, Child >, Child >::N, and convex::GeoMean< Meta, Child >::Tag.
Referenced by convex::GeoMean< Meta, Child >::operator()().
|
inlineconstexpr |
mono
Definition at line 86 of file geo_mean.hpp.
References convex::CONCAVE, convex::NONDEC, convex::NONINC, and convex::GeoMean< Meta, Child >::Tag.
|
inlineconstexpr |
mul
Definition at line 124 of file geo_mean.hpp.
References convex::Atom< Meta, GeoMean< Meta, Child >, Child >::children, convex::CONCAVE, convex::dom_size_v, convex::GeoMean< Meta, Child >::lift_map, and convex::GeoMean< Meta, Child >::Tag.
|
inlineconstexpr |
eval via operator overload
| point | x |
Definition at line 99 of file geo_mean.hpp.
References convex::GeoMean< Meta, Child >::eval().
Definition at line 216 of file geo_mean.hpp.
Referenced by convex::GeoMean< Meta, Child >::canonicalize_impl().
| affine::AffineMap<LiftedVarMat<T> > convex::GeoMean< Meta, Child >::lift_map |
member vars
Definition at line 215 of file geo_mean.hpp.
Referenced by convex::GeoMean< Meta, Child >::add(), convex::GeoMean< Meta, Child >::canonicalize_impl(), convex::GeoMean< Meta, Child >::eval(), and convex::GeoMean< Meta, Child >::mul().
|
staticconstexpr |
curvature tag
Definition at line 60 of file geo_mean.hpp.
Referenced by convex::GeoMean< Meta, Child >::canonicalize_impl(), convex::GeoMean< Meta, Child >::eval(), convex::GeoMean< Meta, Child >::monotonicity(), and convex::GeoMean< Meta, Child >::mul().