Template Class ActivationModelSmooth2NormTpl
Defined in File smooth-2norm.hpp
Inheritance Relationships
Base Type
public crocoddyl::ActivationModelAbstractTpl< _Scalar >(Template Class ActivationModelAbstractTpl)
Class Documentation
-
template<typename _Scalar>
class ActivationModelSmooth2NormTpl : public crocoddyl::ActivationModelAbstractTpl<_Scalar> Smooth-2Norm activation.
This activation function describes a smooth representation of a 2-norm of a residual vector, i.e.
\[ \begin{equation} \sqrt{\epsilon + sum^nr_{i=0} \|r_i\|^2} \end{equation} \]where \(\epsilon\) defines the smoothing factor, \(r_i\) is the scalar residual for the \(i\) constraints, \(nr\) is the dimension of the residual vector.The computation of the function and it derivatives are carried out in
calc()andcaldDiff(), respectively.See also
Public Types
-
typedef MathBaseTpl<Scalar> MathBase
-
typedef ActivationModelAbstractTpl<Scalar> Base
-
typedef ActivationDataAbstractTpl<Scalar> ActivationDataAbstract
Public Functions
-
inline explicit ActivationModelSmooth2NormTpl(const std::size_t nr, const Scalar eps = Scalar(1.))
Initialize the smooth-2Norm activation model.
The default
epsvalue is defined as 1.- Parameters:
nr – [in] Dimension of the residual vector
eps – [in] Smoothing factor (default: 1.)
-
virtual ~ActivationModelSmooth2NormTpl() = default
Compute the smooth-2Norm function.
- Parameters:
data – [in] Smooth-2Norm activation data
r – [in] Residual vector \(\mathbf{r}\in\mathbb{R}^{nr}\)
Compute the derivatives of the smooth-2Norm function.
- Parameters:
data – [in] Smooth-2Norm activation data
r – [in] Residual vector \(\mathbf{r}\in\mathbb{R}^{nr}\)
-
inline virtual std::shared_ptr<ActivationDataAbstract> createData() override
Create the smooth-2norm activation data.
- Returns:
the activation data
-
template<typename NewScalar>
inline ActivationModelSmooth2NormTpl<NewScalar> cast() const
Public Members
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Protected Functions
-
inline virtual void print(std::ostream &os) const override
Print relevant information of the smooth-1norm model.
- Parameters:
os – [out] Output stream object
Protected Attributes
-
Scalar eps_
< Dimension of the residual vector
Smoothing factor
-
typedef MathBaseTpl<Scalar> MathBase