5#include <guanaqo/tag-invoke.hpp>
8#if CYQLONE_QUADRUPLE_SUM_LINE_SEARCH
18 [[gnu::always_inline, nodiscard]] real_t
α()
const {
return t *
δ; }
21#if CYQLONE_QUADRUPLE_SUM_LINE_SEARCH
22using ABSum_t = std::float128_t;
23#elif CYQLONE_COMPENSATE_SUM_LINE_SEARCH
32 return {.a = lhs.
a + rhs.
a, .b = lhs.
b + rhs.
b};
52 const Vec &Ad,
const Vec &Ax,
const Vec &b_min,
const Vec &b_max);
59 template <
class Backend>
60 using vec_t =
typename std::remove_cvref_t<Backend>::ineq_constr_vec_t;
62 template <
class Backend>
66 typename Backend::Context &, std::vector<Breakpoint> &,
70 auto operator()(Backend &backend,
typename Backend::Context &ctx,
79 return guanaqo::guanaqo_tag_invoke(*
this, backend, ctx, breakpoints, Σ, y, Ad, Ax, b_min,
83 template <
class Backend>
86 typename Backend::Context &, std::vector<Breakpoint> &,
87 const vec_t<Backend> &,
const vec_t<Backend> &,
88 const vec_t<Backend> &,
const vec_t<Backend> &,
89 const vec_t<Backend> &,
const vec_t<Backend> &>)
90 auto operator()(Backend &,
typename Backend::Context &ctx, std::vector<Breakpoint> &breakpoints,
94 ctx.arrive_and_wait();
95 return ctx.call_broadcast(
98}
inline constexpr compute_breakpoints;
101 template <
class Backend>
102 using vec_t =
typename std::remove_cvref_t<Backend>::ineq_constr_vec_t;
104 template <
class Backend>
108 typename Backend::Context &, std::vector<Breakpoint> &,
122 return guanaqo::guanaqo_tag_invoke(*
this, backend, ctx, breakpoints, Σ, y, Ad, Ax, b_min,
126 template <
class Backend>
129 typename Backend::Context &, std::vector<Breakpoint> &,
130 const vec_t<Backend> &,
const vec_t<Backend> &,
131 const vec_t<Backend> &,
const vec_t<Backend> &,
132 const vec_t<Backend> &,
const vec_t<Backend> &>)
142}
inline constexpr get_partitioned_breakpoints;
145 template <
class Backend>
146 using vec_t =
typename std::remove_cvref_t<Backend>::ineq_constr_vec_t;
148 template <
class Backend>
156 auto operator()(Backend &backend,
typename Backend::Context &ctx,
165 return guanaqo::guanaqo_tag_invoke(*
this, backend, ctx, breakpoints, Σ, y, Ad, Ax, b_min,
169 template <
class Backend>
172 std::vector<Breakpoint> &,
const vec_t<Backend> &,
173 const vec_t<Backend> &,
const vec_t<Backend> &,
174 const vec_t<Backend> &,
const vec_t<Backend> &,
175 const vec_t<Backend> &>)
185}
inline constexpr get_breakpoints;
Kahan-Babuška-Neumaier compensated summation.
constexpr bool is_nothrow_tag_invocable_v
struct cyqlone::qpalm::get_partitioned_breakpoints_fn get_partitioned_breakpoints
std::span< Breakpoint > neg_bp
ABSums partial_sum_negative(PartitionedBreakpoints breakpoints, real_t η=0, real_t β=0)
PartitionedBreakpoints partition_breakpoints_default(std::span< Breakpoint > breakpoints)
Moves any non-finite elements in t to the end of the range, and all negative elements to the front.
std::span< Breakpoint > pos_bp
struct cyqlone::qpalm::compute_breakpoints_fn compute_breakpoints
PartitionedBreakpoints bp
std::span< Breakpoint > compute_breakpoints_default(std::vector< Breakpoint > &breakpoints, const Vec &Σ, const Vec &y, const Vec &Ad, const Vec &Ax, const Vec &b_min, const Vec &b_max)
Compute the break points t[i] using formula (3.6) in the QPALM paper.
Kahan-Babuška-Neumaier compensated summation.
constexpr friend ABSums operator+(const ABSums &lhs, const ABSums &rhs)
typename std::remove_cvref_t< Backend >::ineq_constr_vec_t vec_t
typename std::remove_cvref_t< Backend >::ineq_constr_vec_t vec_t
typename std::remove_cvref_t< Backend >::ineq_constr_vec_t vec_t