proxsuite-nlp  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
Loading...
Searching...
No Matches
negative-orthant.hpp
Go to the documentation of this file.
1
2#pragma once
3
5
6namespace proxsuite {
7namespace nlp {
8
18template <typename _Scalar>
20 using Scalar = _Scalar;
22
23 NegativeOrthantTpl() = default;
28
30 using ActiveType = typename Base::ActiveType;
31
32 void projection(const ConstVectorRef &z, VectorRef zout) const {
33 zout = z.cwiseMin(static_cast<Scalar>(0.));
34 }
35
36 void normalConeProjection(const ConstVectorRef &z, VectorRef zout) const {
37 zout = z.cwiseMax(static_cast<Scalar>(0.));
38 }
39
41 void computeActiveSet(const ConstVectorRef &z,
42 Eigen::Ref<ActiveType> out) const {
43 out.array() = (z.array() > static_cast<Scalar>(0.));
44 }
45};
46
47template <typename Scalar>
48using NegativeOrthant PROXSUITE_NLP_DEPRECATED_MESSAGE(
49 "Use NegativeOrthantTpl<T> instead") = NegativeOrthantTpl<Scalar>;
50
51#ifdef PROXSUITE_NLP_ENABLE_TEMPLATE_INSTANTIATION
52extern template struct PROXSUITE_NLP_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI
53 NegativeOrthantTpl<context::Scalar>;
54#endif
55
56} // namespace nlp
57} // namespace proxsuite
58
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
Definition math.hpp:26
Main package namespace.
Definition bcl-params.hpp:5
Base constraint set type.
Definition fwd.hpp:104
Eigen::Matrix< bool, Eigen::Dynamic, 1 > ActiveType
Negative orthant, for constraints .
typename Base::ActiveType ActiveType
NegativeOrthantTpl(const NegativeOrthantTpl &)=default
NegativeOrthantTpl(NegativeOrthantTpl &&)=default
void projection(const ConstVectorRef &z, VectorRef zout) const
Compute projection of variable z onto the constraint set.
NegativeOrthantTpl & operator=(const NegativeOrthantTpl &)=default
void computeActiveSet(const ConstVectorRef &z, Eigen::Ref< ActiveType > out) const
The elements of the active set are the components such that .
NegativeOrthantTpl & operator=(NegativeOrthantTpl &&)=default
void normalConeProjection(const ConstVectorRef &z, VectorRef zout) const
Compute projection of z onto the normal cone to the set. The default implementation is just .