aligator
0.19.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Toggle main menu visibility
Loading...
Searching...
No Matches
negative-orthant.hpp
Go to the documentation of this file.
1
3
#pragma once
4
5
#include "
aligator/core/constraint-set.hpp
"
6
7
namespace
aligator
{
8
18
template
<
typename
_Scalar>
19
struct
NegativeOrthantTpl
:
ConstraintSetTpl
<_Scalar> {
20
using
Scalar
= _Scalar;
21
ALIGATOR_DYNAMIC_TYPEDEFS
(
Scalar
);
22
23
NegativeOrthantTpl
() =
default
;
24
NegativeOrthantTpl
(
const
NegativeOrthantTpl
&) =
default
;
25
NegativeOrthantTpl
&
operator=
(
const
NegativeOrthantTpl
&) =
default
;
26
NegativeOrthantTpl
(
NegativeOrthantTpl
&&) =
default
;
27
NegativeOrthantTpl
&
operator=
(
NegativeOrthantTpl
&&) =
default
;
28
29
using
Base
=
ConstraintSetTpl<Scalar>
;
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
constraint-set.hpp
aligator
Main package namespace.
Definition
action-model-wrap.hpp:14
aligator::ConstraintSetTpl::ConstraintSetTpl
ConstraintSetTpl()=default
aligator::ConstraintSetTpl< Scalar >::ActiveType
Eigen::Matrix< bool, Eigen::Dynamic, 1 > ActiveType
Definition
constraint-set.hpp:20
aligator::NegativeOrthantTpl::ActiveType
typename Base::ActiveType ActiveType
Definition
negative-orthant.hpp:30
aligator::NegativeOrthantTpl::NegativeOrthantTpl
NegativeOrthantTpl(NegativeOrthantTpl &&)=default
aligator::NegativeOrthantTpl::ALIGATOR_DYNAMIC_TYPEDEFS
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
aligator::NegativeOrthantTpl::projection
void projection(const ConstVectorRef &z, VectorRef zout) const
Compute projection of variable z onto the constraint set.
Definition
negative-orthant.hpp:32
aligator::NegativeOrthantTpl::NegativeOrthantTpl
NegativeOrthantTpl(const NegativeOrthantTpl &)=default
aligator::NegativeOrthantTpl::operator=
NegativeOrthantTpl & operator=(const NegativeOrthantTpl &)=default
aligator::NegativeOrthantTpl::normalConeProjection
void normalConeProjection(const ConstVectorRef &z, VectorRef zout) const
Compute projection of z onto the normal cone to the set. The default implementation is just .
Definition
negative-orthant.hpp:36
aligator::NegativeOrthantTpl::operator=
NegativeOrthantTpl & operator=(NegativeOrthantTpl &&)=default
aligator::NegativeOrthantTpl::NegativeOrthantTpl
NegativeOrthantTpl()=default
aligator::NegativeOrthantTpl::computeActiveSet
void computeActiveSet(const ConstVectorRef &z, Eigen::Ref< ActiveType > out) const
The elements of the active set are the components such that .
Definition
negative-orthant.hpp:41
aligator::NegativeOrthantTpl::Scalar
_Scalar Scalar
Definition
negative-orthant.hpp:20
aligator::NegativeOrthantTpl::Base
ConstraintSetTpl< Scalar > Base
Definition
negative-orthant.hpp:29
include
aligator
modelling
constraints
negative-orthant.hpp
Generated by
1.17.0