Template Class ActivationModel2NormBarrierTpl
Defined in File 2norm-barrier.hpp
Inheritance Relationships
Base Type
public crocoddyl::ActivationModelAbstractTpl< _Scalar >(Template Class ActivationModelAbstractTpl)
Class Documentation
-
template<typename _Scalar>
class ActivationModel2NormBarrierTpl : public crocoddyl::ActivationModelAbstractTpl<_Scalar> 2-norm barrier activation
This activation function describes a quadratic barrier of the 2-norm of a residual vector, i.e.,
\[\begin{split} \Bigg\{\begin{aligned} &\frac{1}{2} (d - \alpha)^2, &\textrm{if} \,\,\, d < \alpha \\ &0, &\textrm{otherwise}, \end{aligned} \end{split}\]where \(d = \|r\|\) is the norm of the residual, \(\alpha\) the threshold distance from which the barrier is active, \(nr\) is the dimension of the residual vector.The computation of the function and it derivatives are carried out in
calc()andcalcDiff(), respectively.See also
ActivationModelAbstractTpl,calc(),calcDiff(),createData()Public Types
-
typedef MathBaseTpl<Scalar> MathBase
-
typedef ActivationModelAbstractTpl<Scalar> Base
-
typedef ActivationDataAbstractTpl<Scalar> ActivationDataAbstract
-
typedef ActivationData2NormBarrierTpl<Scalar> Data
Public Functions
-
inline explicit ActivationModel2NormBarrierTpl(const std::size_t nr, const Scalar alpha = Scalar(0.1), const bool true_hessian = false)
Initialize the 2-norm barrier activation model.
The default
alphavalue is defined as 0.1.- Parameters:
nr – [in] Dimension of the residual vector
alpha – [in] Threshold factor (default 0.1)
true_hessian – [in] Boolean indicating whether to use the Gauss-Newton approximation or true Hessian in computing the derivatives (default: false)
-
virtual ~ActivationModel2NormBarrierTpl() = default
Compute the 2-norm barrier function.
- Parameters:
data – [in] 2-norm barrier activation data
r – [in] Residual vector \(\mathbf{r}\in\mathbb{R}^{nr}\)
Compute the derivatives of the 2norm-barrier function.
- Parameters:
data – [in] 2-norm barrier activation data
r – [in] Residual vector \(\mathbf{r}\in\mathbb{R}^{nr}\)
-
inline virtual std::shared_ptr<ActivationDataAbstract> createData() override
Create the 2norm-barrier activation data.
- Returns:
the activation data
-
template<typename NewScalar>
inline ActivationModel2NormBarrierTpl<NewScalar> cast() const
-
inline const Scalar &get_alpha() const
Get and set the threshold factor.
-
inline void set_alpha(const Scalar &alpha)
-
inline virtual void print(std::ostream &os) const override
Print relevant information of the 2-norm barrier model.
- Parameters:
os – [out] Output stream object
Public Members
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
-
typedef MathBaseTpl<Scalar> MathBase