aligator  0.9.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>
12struct UnaryFunctionTpl : StageFunctionTpl<_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.
Definition fwd.hpp:62
Class representing ternary functions .
Definition fwd.hpp:56
virtual void computeVectorHessianProducts(const ConstVectorRef &, const ConstVectorRef &, Data &) const
virtual void evaluate(const ConstVectorRef &x, Data &data) const =0
void computeVectorHessianProducts(const ConstVectorRef &x, const ConstVectorRef &, const ConstVectorRef &lbda, Data &data) const override
void evaluate(const ConstVectorRef &x, const ConstVectorRef &, Data &data) const override
void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &, Data &data) const override
virtual void computeJacobians(const ConstVectorRef &x, Data &data) const =0