|
akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
|
variable atom More...
#include <variable.hpp>
Public Types | |
| using | BaseT = Atom< Meta, Variable< Meta > > |
| extract aliases from types above useful for this class | |
| using | LinearMatT = linalg::Matrix< T, N, N > |
| using | TransT = linalg::Vector< T, N > |
| using | ScalarDom = ConvexDomain< linalg::RowVector< T, 1 >, DomSign > |
| using | ScalarMeta = ConvexAtomMeta< ScalarDom, ScalarDom, CurvatureType::AFFINE > |
| using | ScalarViewT = ScalarView< ScalarMeta, Variable< Meta > > |
Public Types inherited from convex::Atom< Meta, Variable< Meta > > | |
| 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 | Variable () |
| CTOR (default) | |
| constexpr | Variable (const affine::AffineMap< LinearMatT > &map_in) |
| CTOR. | |
| constexpr ScalarViewT | operator() (std::size_t idx) const |
| operator overload for index | |
| constexpr auto | mul (T alpha) const |
| mul (scalar) | |
| constexpr auto | mul (const LinearMatT &alpha) const |
| mul (scalar) | |
| constexpr auto | add (const TransT &beta) const |
| add (scalar) | |
| template<AtomType Type, conic::BuilderLike Builder> | |
| constexpr auto | canonicalize_impl (const Builder &builder) const |
| canonicalize | |
| constexpr auto | split () const |
| split | |
| template<AtomType Type, conic::BuilderLike Builder> | |
| constexpr auto | add_var_block (const Builder &builder) const |
| add_var_block | |
Public Member Functions inherited from convex::Atom< Meta, Variable< Meta > > | |
| 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 Variable< Meta > & | self () const |
| Return this object as the CRTP-derived atom type. | |
Public Attributes | |
| affine::AffineMap< LinearMatT > | map |
| member vars | |
Public Attributes inherited from convex::Atom< Meta, Variable< Meta > > | |
| ChildrenT | children |
| Tuple of normalized child atoms. | |
Additional Inherited Members | |
Static Public Attributes inherited from convex::Atom< Meta, Variable< Meta > > | |
| 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. | |
variable atom
Holds the decision var in R^n
Definition at line 163 of file variable.hpp.
| using convex::Variable< Meta >::BaseT = Atom<Meta, Variable<Meta> > |
extract aliases from types above useful for this class
Definition at line 165 of file variable.hpp.
Definition at line 171 of file variable.hpp.
| using convex::Variable< Meta >::ScalarDom = ConvexDomain<linalg::RowVector<T, 1>, DomSign> |
Definition at line 174 of file variable.hpp.
| using convex::Variable< Meta >::ScalarMeta = ConvexAtomMeta<ScalarDom, ScalarDom, CurvatureType::AFFINE> |
Definition at line 175 of file variable.hpp.
| using convex::Variable< Meta >::ScalarViewT = ScalarView<ScalarMeta, Variable<Meta> > |
Definition at line 177 of file variable.hpp.
| using convex::Variable< Meta >::TransT = linalg::Vector<T, N> |
Definition at line 172 of file variable.hpp.
|
inlineexplicitconstexpr |
CTOR (default)
Definition at line 182 of file variable.hpp.
Referenced by convex::Variable< Meta >::add(), convex::Variable< Meta >::mul(), and convex::Variable< Meta >::mul().
|
inlineexplicitconstexpr |
|
inlineconstexpr |
add (scalar)
| beta | (scalar) |
Definition at line 241 of file variable.hpp.
References convex::dom_size_v, convex::Variable< Meta >::map, and convex::Variable< Meta >::Variable().
|
inlineconstexpr |
add_var_block
Instead of canonicalization adding the variable to the block it is treated specially by this function to manually add it to F
| builder | (CanonicalFormBuilder) |
Definition at line 288 of file variable.hpp.
References convex::dom_size_v.
|
inlineconstexpr |
canonicalize
Almost treated as a no-op as var will always be leaf node but need to pass its map and cone block
| builder | (CanonicalFormBuilder) |
Definition at line 258 of file variable.hpp.
References convex::Variable< Meta >::map.
|
inlineconstexpr |
mul (scalar)
| alpha | (linear mat) |
Definition at line 228 of file variable.hpp.
References convex::dom_size_v, convex::Variable< Meta >::map, and convex::Variable< Meta >::Variable().
|
inlineconstexpr |
mul (scalar)
| alpha | (scalar that scales var) |
Definition at line 215 of file variable.hpp.
References convex::dom_size_v, convex::Variable< Meta >::map, and convex::Variable< Meta >::Variable().
|
inlineconstexpr |
operator overload for index
| index |
Definition at line 200 of file variable.hpp.
References convex::dom_size_v, convex::Variable< Meta >::map, and convex::Atom< Meta, Variable< Meta > >::N.
|
inlineconstexpr |
split
x -> (x(0), x(1), ...) tuple
Definition at line 270 of file variable.hpp.
References convex::dom_size_v.
| affine::AffineMap<LinearMatT> convex::Variable< Meta >::map |
member vars
Definition at line 294 of file variable.hpp.
Referenced by convex::Variable< Meta >::add(), convex::Variable< Meta >::canonicalize_impl(), convex::Variable< Meta >::mul(), convex::Variable< Meta >::mul(), and convex::Variable< Meta >::operator()().