File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -35,14 +35,14 @@ struct infinite_bound
3535// / @brief \brief Returns the part of the expression which is lower than value
3636template <typename T, typename Scalar>
3737auto
38- lower_than (T const & expr, const Scalar value) PROXSUITE_DEDUCE_RET(
39- (expr.array() < value).select(expr, T::Zero (expr.rows())));
38+ at_most (T const & expr, const Scalar value) PROXSUITE_DEDUCE_RET(
39+ (expr.array() < value).select(expr, T::Constant (expr.rows(), value )));
4040
4141// / @brief \brief Returns the part of the expression which is greater than value
4242template <typename T, typename Scalar>
4343auto
44- greater_than (T const & expr, const Scalar value) PROXSUITE_DEDUCE_RET(
45- (expr.array() > value).select(expr, T::Zero (expr.rows())));
44+ at_least (T const & expr, const Scalar value) PROXSUITE_DEDUCE_RET(
45+ (expr.array() > value).select(expr, T::Constant (expr.rows(), value )));
4646
4747// / @brief \brief Returns the positive part of an expression
4848template <typename T>
Original file line number Diff line number Diff line change @@ -398,13 +398,13 @@ global_dual_residual(Results<T>& qpresults,
398398
399399 const T zu =
400400 helpers::positive_part (qpresults.z )
401- .dot (helpers::lower_than (qpmodel.u , helpers::infinite_bound<T>::value ()));
401+ .dot (helpers::at_most (qpmodel.u , helpers::infinite_bound<T>::value ()));
402402 rhs_duality_gap = std::max (rhs_duality_gap, std::abs (zu));
403403 duality_gap += zu;
404404
405- const T zl = helpers::negative_part (qpresults. z )
406- . dot ( helpers::greater_than (
407- qpmodel.l , -helpers::infinite_bound<T>::value ()));
405+ const T zl =
406+ helpers::negative_part (qpresults. z )
407+ . dot ( helpers::at_least ( qpmodel.l , -helpers::infinite_bound<T>::value ()));
408408 rhs_duality_gap = std::max (rhs_duality_gap, std::abs (zl));
409409 duality_gap += zl;
410410
Original file line number Diff line number Diff line change @@ -667,12 +667,12 @@ unscaled_primal_dual_residual(
667667 precond.unscale_dual_in_place_in ({ proxsuite::proxqp::from_eigen, z_e });
668668
669669 const T zl = helpers::negative_part (z_e).dot (
670- helpers::greater_than (data.l , -helpers::infinite_bound<T>::value ()));
670+ helpers::at_least (data.l , -helpers::infinite_bound<T>::value ()));
671671 results.info .duality_gap += zl;
672672 rhs_duality_gap = std::max (rhs_duality_gap, std::abs (zl));
673673
674674 const T zu = helpers::positive_part (z_e).dot (
675- helpers::lower_than (data.u , helpers::infinite_bound<T>::value ()));
675+ helpers::at_most (data.u , helpers::infinite_bound<T>::value ()));
676676 results.info .duality_gap += zu;
677677 rhs_duality_gap = std::max (rhs_duality_gap, std::abs (zu));
678678
You can’t perform that action at this time.
0 commit comments