- 3.0.2 core module.
TestHessian.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
9 
10 namespace ct {
11 namespace core {
12 namespace generated {
13 
14 class TestHessian : public core::Derivatives<3, 2, double>
15 {
16 public:
17  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
18 
19  typedef Eigen::Matrix<double, 3, 3> HES_TYPE;
20  typedef Eigen::Matrix<double, 3, 1> X_TYPE;
21 
23  {
24  hessian_.setZero();
25  v_.fill(0.0);
26  };
27 
28  TestHessian(const TestHessian& other)
29  {
30  hessian_.setZero();
31  v_.fill(0.0);
32  }
33 
34  virtual ~TestHessian(){};
35 
36  TestHessian* clone() const override { return new TestHessian(*this); }
37  HES_TYPE hessian(const Eigen::VectorXd& x_in, const Eigen::VectorXd& w_in) override;
38 
39 private:
40  HES_TYPE hessian_;
41  std::array<double, 0> v_;
42 };
43 
44 } // namespace generated
45 } // namespace core
46 } // namespace ct
HES_TYPE hessian(const Eigen::VectorXd &x_in, const Eigen::VectorXd &w_in) override
Evaluates the hessian (2nd order derivatives with respect to input) of the method. In case of a vector valued function, the method returns the weighted sum of the hessians with weights w.
Definition: TestHessian.cpp:15
Definition: TestHessian.h:14
virtual ~TestHessian()
Definition: TestHessian.h:34
TestHessian()
Definition: TestHessian.h:22
Eigen::Matrix< double, 3, 1 > X_TYPE
Definition: TestHessian.h:20
General interface class for a Derivatives.
Definition: Derivatives.h:24
TestHessian * clone() const override
deep copy for derived classes
Definition: TestHessian.h:36
TestHessian(const TestHessian &other)
Definition: TestHessian.h:28
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Eigen::Matrix< double, 3, 3 > HES_TYPE
Definition: TestHessian.h:19