|
akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
|
forward decl for soc More...
#include <soc.hpp>
Public Types | |
| using | ConeBase = Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC > |
| bring into scope alias from cone base | |
Public Types inherited from conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC > | |
| using | T = linalg::vector_element_t< Slack > |
| alias for mat type | |
| using | HessianMat = linalg::Matrix< T, M, M > |
| hessian type | |
Public Member Functions | |
| constexpr Slack | x0_impl () const |
| default interior point | |
| constexpr Slack | y0_impl () const |
| default dual point | |
| constexpr bool | in_cone_impl (const Slack &x) const |
| in interior of K | |
| constexpr bool | in_dual_cone_impl (const Slack &y) const |
| in interior of K^* | |
| constexpr T | alpha_max_impl (const Slack &x, const linalg::Vector< T, M > &p) const |
| fraction to boundary dK | |
| constexpr T | alpha_max_dual_impl (const Slack &y, const linalg::Vector< T, M > &p) const |
| fracto to dK^* | |
| constexpr auto | H_impl (const Slack &x, const Slack &y) const |
| hessian | |
| constexpr auto | grad_impl (const Slack &x) const |
| grad | |
| constexpr T | nu_impl () const |
| barrier param | |
| constexpr auto | e_impl () const |
| e (jordan identity) | |
| constexpr auto | w_impl (const Slack &x, const Slack &y) const |
| w (self-scaled point) | |
| constexpr auto | circ_impl (const Slack &x, const Slack &y) const |
| circ | |
| constexpr T | trace_impl (const Slack &x, const Slack &y) const |
| trace | |
| constexpr auto | gamma_F_impl (const Slack &x, const Slack &y) const |
| gamma_F | |
| constexpr auto | inv_impl (const Slack &x) const |
| inv | |
| constexpr auto | sqrt_impl (const Slack &x) const |
| Event-returning Jordan square root for the common cone implementation. | |
| constexpr auto | sqrt (const Slack &x) const |
| sqrt | |
| constexpr auto | eigs (const Slack &x) const |
| eigs | |
Public Member Functions inherited from conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC > | |
| constexpr Slack | x0 () const |
| default interior point (initial slack in cone space) | |
| constexpr Slack | y0 () const |
| default interior point (initial slack in dual cone) | |
| constexpr bool | in_cone (const Slack &x) const |
| in the interior of k | |
| constexpr bool | in_dual_cone (const Slack &y) const |
| in the interior of K^* | |
| constexpr auto | H (const Slack &x, const Slack &y) const |
| hessian | |
| constexpr T | alpha_max (const Slack &x, const linalg::Vector< T, M > &p) const |
| fraction to boundary dk | |
| constexpr T | alpha_max_dual (const Slack &y, const linalg::Vector< T, M > &p) const |
| fraction to boundary dk^* | |
| constexpr T | nu () const |
| barrier parameter | |
| constexpr auto | grad (const Slack &x) const |
| gradient | |
| constexpr auto | e () const |
| e (jordan identity) | |
| constexpr auto | w (const Slack &x, const Slack &y) const |
| w (self-scaling point) | |
| constexpr auto | circ (const Slack &x, const Slack &y) const |
| circ (jordan map/product operator) | |
| constexpr auto | trace (const Slack &x, const Slack &y) const |
| trace | |
| constexpr auto | inv (const Slack &x) const |
| inv (jordan inverse element) | |
| constexpr T | trace_weight () const |
| Convert Euclidean complementarity to this cone's Jordan trace units. | |
| constexpr auto | scaled_affine_correction (const Slack &x, const Scaling &P, const Slack &px, const Slack &py) const |
| Affine second-order correction in dual coordinates under NT scaling. | |
| constexpr auto | scaled_affine_correction_impl (const Slack &x, const Scaling &P, const Slack &px, const Slack &py) const |
| Common symmetric-cone implementation using Jordan operations. | |
| constexpr auto | gamma_F (const Slack &x, const Slack &y) const |
| gamma_F (functional proximity neighborhood metric) | |
| constexpr auto | self () const |
| self function which returns a const ref to the derived object | |
Additional Inherited Members | |
Static Public Attributes inherited from conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC > | |
| static constexpr std::size_t | M |
| helpers to get M slack size | |
| static constexpr T | eps |
| eps constant | |
forward decl for soc
soc cone class
K_soc = { (x, t) | ||x|| <= t }
| using conic::SecondOrderCone< Slack >::ConeBase = Cone<Slack, SecondOrderCone<Slack>, ConeType::SYMMETRIC> |
|
inlineconstexpr |
fracto to dK^*
| y | in K |
| p | in E^* |
Definition at line 274 of file soc.hpp.
References conic::SecondOrderCone< Slack >::alpha_max_impl().
|
inlineconstexpr |
fraction to boundary dK
let x = (v,t) let p = [ dv; dt ] sigma(alpha) = frac{1}{sup{alpha | (v + alpha p in K, t + alpha dt)}} t(alpha) >= ||v(alpha)||
g(alpha) = t(alpha)^2 - ||v(alpha)||^2 >= 0 t(alpha) >= 0
g(alpha) = (t + alpha dt)^2 - ||v + alpha dv||^2 let a = dt^2 - ||dv||^2 let b = 2(t dt - v^T dv) let c = t^2 - ||v||^2... x in K & c > 0 so g(alpha) = a alpha^2 + b alpha + c
x = -b +- sqrt(b^2 - 4 a c) / 2a Delta = b^2 - 4 a c -> Delta <= 0 ... g(alpha) >= 0 True... alpha = 1 -> Delta > 0 ... calculate roots r1 = (-b - sqrt(Delta)) / 2a r2 = -b + sqrt(Delta) / 2a sort r_min <= r_max
alpha = piecewise{ 1, if x + p in K -c / b, if a == 0 and b < 0 min(r1, r2) if Delta > 0 1, else }
| x | in K |
| p | in E (delta dir) |
(dakre) take max step if update is in cone
(dakre) take smallest positive root (first boundary hit from alpha=0)
(dakre) ensure t + alpha dt > 0
(dakre) clamp alpha [0, 1]
Definition at line 218 of file soc.hpp.
References conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::eps, conic::SecondOrderCone< Slack >::in_cone_impl(), and conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::M.
Referenced by conic::SecondOrderCone< Slack >::alpha_max_dual_impl().
|
inlineconstexpr |
circ
x circ y
| x | in K |
| y | in K^* |
Definition at line 415 of file soc.hpp.
Referenced by conic::SecondOrderCone< Slack >::trace_impl().
|
inlineconstexpr |
e (jordan identity)
e = (0,1) (x,t) circ e = (x,t)
Definition at line 366 of file soc.hpp.
References conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::e(), and conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::M.
Referenced by conic::SecondOrderCone< Slack >::H_impl(), and conic::SecondOrderCone< Slack >::sqrt().
|
inlineconstexpr |
eigs
(v,t) in K or K^*
| v | (vector) |
| t | (scalar) |
Definition at line 531 of file soc.hpp.
References conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::M.
Referenced by conic::SecondOrderCone< Slack >::gamma_F_impl(), and conic::SecondOrderCone< Slack >::sqrt().
|
inlineconstexpr |
gamma_F
| x | in K |
| y | in K^* |
Definition at line 441 of file soc.hpp.
References conic::SecondOrderCone< Slack >::eigs(), conic::SecondOrderCone< Slack >::nu_impl(), and conic::SecondOrderCone< Slack >::trace_impl().
|
inlineconstexpr |
grad
F'(x) = -x^{-1}
| x | in K or y in K^* |
Definition at line 339 of file soc.hpp.
References conic::SecondOrderCone< Slack >::inv_impl().
|
inlineconstexpr |
hessian
w = X^{1/2} (X^{1/2} S X^{1/2})^{-1/2} X^{1/2} PSD congruence map X^{1/2} S X^{1/2} equivalent to quad rep P(x^{1/2}) y for SOC then another congruence map X^{1/2} inner X^{1/2} equivalent to same quad rep
w = P(x^{1/2})(P(x^{-1/2})y)^{1/2}
let w = (x,t) ** cone of squares ** x circ x = hat{x} circ hat{x} = (2xt, x^T x + t^2); t^2 - x^T x >= 0 ** 2-eig / rank-2 jordan algebra ** two eigs: t +- x^T x det(hat{x}) = lam1*lam2 = t^2 - x^T x > 0 ** self-concordant barrier ** F(w) = F(x,t) = -log det(w) F'(w) = -w^{-1} F''(w) = P(w^{-1})
F''(w) x = P(w^{-1}) x
P(w)y = x
let z = w^{-1} P(z) = 2L(z)^2 - L(z^2)
| x | in K |
| y | in K^* |
Definition at line 312 of file soc.hpp.
References conic::SecondOrderCone< Slack >::e_impl(), conic::SecondOrderCone< Slack >::inv_impl(), conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::w(), and conic::SecondOrderCone< Slack >::w_impl().
|
inlineconstexpr |
in interior of K
| slack | vector |
Definition at line 163 of file soc.hpp.
References conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::M.
Referenced by conic::SecondOrderCone< Slack >::alpha_max_impl(), and conic::SecondOrderCone< Slack >::in_dual_cone_impl().
|
inlineconstexpr |
in interior of K^*
| y | in K^* |
Definition at line 177 of file soc.hpp.
References conic::SecondOrderCone< Slack >::in_cone_impl().
|
inlineconstexpr |
inv
Jordan Inverse of x where x = (v,t) x^{-1} = frac{1}{t^2 - v^Tv}(-v,t)... frac{1}{det(A)}*adj(A)
| x | (slack vector) |
Definition at line 466 of file soc.hpp.
References conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::eps, and conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::M.
Referenced by conic::SecondOrderCone< Slack >::grad_impl(), conic::SecondOrderCone< Slack >::H_impl(), and conic::SecondOrderCone< Slack >::w_impl().
|
inlineconstexpr |
barrier param
K = {(x,t) | t >= ||x||} F(x,t) = -log(t^2 - ||x||^2) t^2 - ||x||^2 -> lam1 = t + ||x||, lam2 = t - ||x|| det(x) = lam1*lam2 -> F = -log lam1 - log lam2
^ 2 log terms -> 2 barrier params
Definition at line 356 of file soc.hpp.
Referenced by conic::SecondOrderCone< Slack >::gamma_F_impl(), and conic::SecondOrderCone< Slack >::trace_impl().
|
inlineconstexpr |
sqrt
Jordan Square Root lam1 = t + ||v||_2, lam2 = t - ||v||_2 x^{1/2} = frac{sqrt(lam1) + sqrt(lam2)}{2}e + frac{sqrt(lam1) - sqrt(lam2)}{2}u
| x | (slack vector) |
Definition at line 499 of file soc.hpp.
References conic::SecondOrderCone< Slack >::e_impl(), conic::SecondOrderCone< Slack >::eigs(), conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::eps, and conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::M.
Referenced by conic::SecondOrderCone< Slack >::sqrt_impl(), and conic::SecondOrderCone< Slack >::w_impl().
|
inlineconstexpr |
Event-returning Jordan square root for the common cone implementation.
Definition at line 483 of file soc.hpp.
References conic::SecondOrderCone< Slack >::sqrt().
|
inlineconstexpr |
trace
trace(x circ y) = last elem
| x | in K |
| y | in K^* |
Definition at line 429 of file soc.hpp.
References conic::SecondOrderCone< Slack >::circ_impl(), conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::M, and conic::SecondOrderCone< Slack >::nu_impl().
Referenced by conic::SecondOrderCone< Slack >::gamma_F_impl().
|
inlineconstexpr |
w (self-scaled point)
w = X^{1/2}(X^{1/2} S X^{1/2})^{−1/2} X^{1/2}
Euclidean Jordan Algebra P(x) = 2L(x)^2 - L(x^2) L(x)^2 = L(x) circ L(x) L(x)y = x circ y
where u = (v / ||v||, 0)... primitive idempotent (directional term)
x = lam1 c1 + lam2 c2... c1 & c2 are idempotents (rank-1 dir updates) where x^{1/2} = sqrt{lam1}c1 + sqrt{lam2}c2
w = P(x^{1/2})(P(x^{1/2})y)^{-1/2}
| x | in K |
| y | in K^* |
Definition at line 394 of file soc.hpp.
References conic::SecondOrderCone< Slack >::inv_impl(), and conic::SecondOrderCone< Slack >::sqrt().
Referenced by conic::SecondOrderCone< Slack >::H_impl().
|
inlineconstexpr |
default interior point
Definition at line 143 of file soc.hpp.
References conic::Cone< Slack, SecondOrderCone< Slack >, ConeType::SYMMETRIC >::M.
Referenced by conic::SecondOrderCone< Slack >::y0_impl().
|
inlineconstexpr |
default dual point
Definition at line 154 of file soc.hpp.
References conic::SecondOrderCone< Slack >::x0_impl().