aligator  0.12.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
 
Loading...
Searching...
No Matches
unary-function.hpp
Go to the documentation of this file.
1
3#pragma once
4
6
7namespace aligator {
8
11template <typename _Scalar>
13 using Scalar = _Scalar;
17
18 using Base::Base;
19
20 virtual void evaluate(const ConstVectorRef &x, Data &data) const = 0;
21 virtual void computeJacobians(const ConstVectorRef &x, Data &data) const = 0;
22 virtual void computeVectorHessianProducts(const ConstVectorRef & /*x*/,
23 const ConstVectorRef & /*lbda*/,
24 Data & /*data*/) const {}
25
26 void evaluate(const ConstVectorRef &x, const ConstVectorRef &,
27 Data &data) const override {
28 this->evaluate(x, data);
29 }
30
31 void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &,
32 Data &data) const override {
33 this->computeJacobians(x, data);
34 }
35
36 void computeVectorHessianProducts(const ConstVectorRef &x,
37 const ConstVectorRef &,
38 const ConstVectorRef &lbda,
39 Data &data) const override {
40 this->computeVectorHessianProducts(x, lbda, data);
41 }
42};
43
44#define ALIGATOR_UNARY_FUNCTION_INTERFACE(Scalar) \
45 using Base = UnaryFunctionTpl<Scalar>; \
46 using Base::evaluate; \
47 using Base::computeJacobians; \
48 using Base::computeVectorHessianProducts
49
50} // namespace aligator
51
52#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
53#include "./unary-function.txx"
54#endif
Base definitions for ternary functions.
Main package namespace.
Base struct for function data.
StageFunctionTpl(const int ndx, const int nu, const int nr)
Represents unary functions of the form , with no control (or next-state) arguments.
void evaluate(const ConstVectorRef &x, const ConstVectorRef &, Data &data) const override
Evaluate the function.
virtual void evaluate(const ConstVectorRef &x, Data &data) const =0
void computeVectorHessianProducts(const ConstVectorRef &x, const ConstVectorRef &, const ConstVectorRef &lbda, Data &data) const override
Compute the vector-hessian products of this function.
virtual void computeJacobians(const ConstVectorRef &x, Data &data) const =0
virtual void computeVectorHessianProducts(const ConstVectorRef &, const ConstVectorRef &, Data &) const
void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &, Data &data) const override
Compute Jacobians of this function.
StageFunctionDataTpl< Scalar > Data
StageFunctionTpl< Scalar > Base