aligator  0.15.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
negative-orthant.hpp
Go to the documentation of this file.
1
3#pragma once
4
6
7namespace aligator {
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
47} // namespace aligator
Main package namespace.
Eigen::Matrix< bool, Eigen::Dynamic, 1 > ActiveType
typename Base::ActiveType ActiveType
NegativeOrthantTpl(NegativeOrthantTpl &&)=default
void projection(const ConstVectorRef &z, VectorRef zout) const
Compute projection of variable z onto the constraint set.
NegativeOrthantTpl(const NegativeOrthantTpl &)=default
NegativeOrthantTpl & operator=(const 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 .
NegativeOrthantTpl & operator=(NegativeOrthantTpl &&)=default
void computeActiveSet(const ConstVectorRef &z, Eigen::Ref< ActiveType > out) const
The elements of the active set are the components such that .
ConstraintSetTpl< Scalar > Base