test_finite_differences.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement
4  *
5  * Copyright (c) 2020,
6  * TU Dortmund - Institute of Control Theory and Systems Engineering.
7  * All rights reserved.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  *
22  * Authors: Christoph Rösmann
23  *********************************************************************/
24 
26 
27 #include <corbo-core/console.h>
28 #include <corbo-core/macros.h>
30 
31 #include <functional>
32 
33 #include "gtest/gtest.h"
34 
38 
39 class TestFiniteDifferences : public testing::Test
40 {
41  protected:
42  // You can do set-up work for each test here.
44  // You can do clean-up work that doesn't throw exceptions here.
46  // If the constructor and destructor are not enough for setting up
47  // and cleaning up each test, you can define the following methods:
48 
49  // Code here will be called immediately after the constructor (right
50  // before each test).
51  virtual void SetUp()
52  {
53  // problem 1
54  // x + 2y + 3z
55  // 4y
56  // 5y + 6z
57  x1 << 1, 2, 3;
58  jacobian1_sol << 1, 2, 3, 0, 4, 0, 0, 5, 6;
59 
60  // problem 2
61  // x^2 + y^3 + x^2*y
62  x2 << 2, 3;
63  jacobian2_sol << 2 * x2[0] + 2 * x2[0] * x2[1], 3 * x2[1] * x2[1] + x2[0] * x2[0];
64  hessian2_sol << 2 + 2 * x2[1], 2 * x2[0], 2 * x2[0], 6 * x2[1];
65 
66  // problem 3
67  // x^2 + 2*y^2 + 3*z^2
68  // x*y + 2*x*z
69  x3 << 1, 1, 1;
70  jacobian3_sol << 2 * x3[0], 4 * x3[1], 6 * x3[2], x3[1] + 2 * x3[2], x3[0], 2 * x3[0];
71  hessian3_sol_a << 2, 0, 0, 0, 4, 0, 0, 0, 6;
72  hessian3_sol_b << 0, 1, 2, 1, 0, 0, 2, 0, 0;
73  }
74  // Code here will be called immediately after each test (right
75  // before the destructor).
76  // virtual void TearDown();
77 
78  Eigen::Vector3d x1;
79  Eigen::Matrix3d jacobian1;
80  Eigen::Matrix3d jacobian1_sol;
81  Eigen::Matrix3d hessian1;
82  void incX1(int idx, double inc) { x1[idx] += inc; }
83  void fun1(Eigen::VectorXd& values)
84  {
85  values[0] = x1[0] + 2 * x1[1] + 3 * x1[2];
86  values[1] = 4 * x1[1];
87  values[2] = 5 * x1[1] + 6 * x1[2];
88  }
89  double multipliers1[3] = {2, 3, 4};
91 
92  Eigen::Vector2d x2;
95  Eigen::Matrix2d hessian2;
96  Eigen::Matrix2d hessian2_sol;
97  void incX2(int idx, double inc) { x2[idx] += inc; }
98  void fun2(Eigen::VectorXd& values) { values[0] = x2[0] * x2[0] + x2[1] * x2[1] * x2[1] + x2[0] * x2[0] * x2[1]; }
99  double multipliers2[1] = {10};
101 
102  Eigen::Vector3d x3;
105  Eigen::Matrix3d hessian3;
106  Eigen::Matrix3d hessian3_sol_a;
107  Eigen::Matrix3d hessian3_sol_b;
108  void incX3(int idx, double inc) { x3[idx] += inc; }
109  void fun3(Eigen::VectorXd& values)
110  {
111  values[0] = x3[0] * x3[0] + 2 * x3[1] * x3[1] + 3 * x3[2] * x3[2]; // x^2 + 2*y^2 + 3*z^2
112  values[1] = x3[0] * x3[1] + 2 * x3[0] * x3[2]; // x*y + 2*x*z
113  }
114  double multipliers3[2] = {2, 4};
116 };
117 
118 TEST_F(TestFiniteDifferences, forward_differences_jacobian)
119 {
121  // problem 1
122  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
123  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
124  fd.computeJacobian2(linc1, lfun1, jacobian1);
125  EXPECT_EQ_MATRIX(jacobian1, jacobian1_sol, 1e-5);
126 
127  // problem 2
128  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
129  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
130  fd.computeJacobian2(linc2, lfun2, jacobian2);
131  EXPECT_EQ_MATRIX(jacobian2, jacobian2_sol, 1e-5);
132 
133  // problem 3
134  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
135  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
136  fd.computeJacobian2(linc3, lfun3, jacobian3);
137  EXPECT_EQ_MATRIX(jacobian3, jacobian3_sol, 1e-5);
138 }
139 
140 TEST_F(TestFiniteDifferences, central_differences_jacobian)
141 {
143  // problem 1
144  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
145  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
146  fd.computeJacobian2(linc1, lfun1, jacobian1);
147  EXPECT_EQ_MATRIX(jacobian1, jacobian1_sol, 1e-5);
148 
149  // problem 2
150  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
151  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
152  fd.computeJacobian2(linc2, lfun2, jacobian2);
153  EXPECT_EQ_MATRIX(jacobian2, jacobian2_sol, 1e-5);
154 
155  // problem 3
156  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
157  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
158  fd.computeJacobian2(linc3, lfun3, jacobian3);
159  EXPECT_EQ_MATRIX(jacobian3, jacobian3_sol, 1e-5);
160 }
161 
162 TEST_F(TestFiniteDifferences, forward_differences_hessian)
163 {
165  // problem 1
166  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
167  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
168  fd.computeHessian2(linc1, lfun1, 3, hessian1);
169  EXPECT_ZERO_MATRIX(hessian1, 1e-3);
170 
171  // problem 2
172  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
173  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
174  fd.computeHessian2(linc2, lfun2, 1, hessian2);
175  EXPECT_EQ_MATRIX(hessian2, hessian2_sol, 1e-5);
176 
177  // problem 3
178  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
179  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
180  fd.computeHessian2(linc3, lfun3, 2, hessian3);
181  EXPECT_EQ_MATRIX(hessian3, hessian3_sol_a + hessian3_sol_b, 1e-5);
182 }
183 
184 TEST_F(TestFiniteDifferences, central_differences_hessian)
185 {
187  // problem 1
188  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
189  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
190  fd.computeHessian2(linc1, lfun1, 3, hessian1);
191  EXPECT_ZERO_MATRIX(hessian1, 1e-5);
192 
193  // problem 2
194  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
195  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
196  fd.computeHessian2(linc2, lfun2, 1, hessian2);
197  EXPECT_EQ_MATRIX(hessian2, hessian2_sol, 1e-5);
198 
199  // problem 3
200  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
201  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
202  fd.computeHessian2(linc3, lfun3, 2, hessian3);
203  EXPECT_EQ_MATRIX(hessian3, hessian3_sol_a + hessian3_sol_b, 1e-5);
204 }
205 
206 TEST_F(TestFiniteDifferences, forward_differences_hessian_multipliers)
207 {
209  // problem 1
210  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
211  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
212  fd.computeHessian2(linc1, lfun1, 3, hessian1, multipliers1);
213  EXPECT_ZERO_MATRIX(hessian1, 1e-3);
214 
215  // problem 2
216  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
217  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
218  fd.computeHessian2(linc2, lfun2, 1, hessian2, multipliers2);
219  EXPECT_EQ_MATRIX(hessian2, multipliers2[0] * hessian2_sol, 1e-5);
220 
221  // problem 3
222  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
223  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
224  fd.computeHessian2(linc3, lfun3, 2, hessian3, multipliers3);
225  EXPECT_EQ_MATRIX(hessian3, multipliers3[0] * hessian3_sol_a + multipliers3[1] * hessian3_sol_b, 1e-5);
226 }
227 
228 TEST_F(TestFiniteDifferences, central_differences_hessian_multipliers)
229 {
231  // problem 1
232  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
233  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
234  fd.computeHessian2(linc1, lfun1, 3, hessian1, multipliers1);
235  EXPECT_ZERO_MATRIX(hessian1, 1e-4);
236 
237  // problem 2
238  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
239  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
240  fd.computeHessian2(linc2, lfun2, 1, hessian2, multipliers2);
241  EXPECT_EQ_MATRIX(hessian2, multipliers2[0] * hessian2_sol, 1e-5);
242 
243  // problem 3
244  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
245  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
246  fd.computeHessian2(linc3, lfun3, 2, hessian3, multipliers3);
247  EXPECT_EQ_MATRIX(hessian3, multipliers3[0] * hessian3_sol_a + multipliers3[1] * hessian3_sol_b, 1e-5);
248 }
249 
250 TEST_F(TestFiniteDifferences, forward_differences_jacobian_hessian)
251 {
253  // problem 1
254  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
255  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
256  fd.computeJacobianAndHessian2(linc1, lfun1, jacobian1, hessian1);
257  EXPECT_EQ_MATRIX(jacobian1, jacobian1_sol, 1e-5);
258  EXPECT_ZERO_MATRIX(hessian1, 1e-3);
259 
260  // problem 2
261  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
262  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
263  fd.computeJacobianAndHessian2(linc2, lfun2, jacobian2, hessian2);
264  EXPECT_EQ_MATRIX(jacobian2, jacobian2_sol, 1e-5);
265  EXPECT_EQ_MATRIX(hessian2, hessian2_sol, 1e-5);
266 
267  // problem 3
268  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
269  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
270  fd.computeJacobianAndHessian2(linc3, lfun3, jacobian3, hessian3);
271  EXPECT_EQ_MATRIX(jacobian3, jacobian3_sol, 1e-5);
272  EXPECT_EQ_MATRIX(hessian3, hessian3_sol_a + hessian3_sol_b, 1e-5);
273 }
274 
275 TEST_F(TestFiniteDifferences, central_differences_jacobian_hessian)
276 {
278  // problem 1
279  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
280  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
281  fd.computeJacobianAndHessian2(linc1, lfun1, jacobian1, hessian1);
282  EXPECT_EQ_MATRIX(jacobian1, jacobian1_sol, 1e-5);
283  EXPECT_ZERO_MATRIX(hessian1, 1e-5);
284 
285  // problem 2
286  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
287  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
288  fd.computeJacobianAndHessian2(linc2, lfun2, jacobian2, hessian2);
289  EXPECT_EQ_MATRIX(jacobian2, jacobian2_sol, 1e-5);
290  EXPECT_EQ_MATRIX(hessian2, hessian2_sol, 1e-5);
291 
292  // problem 3
293  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
294  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
295  fd.computeJacobianAndHessian2(linc3, lfun3, jacobian3, hessian3);
296  EXPECT_EQ_MATRIX(jacobian3, jacobian3_sol, 1e-5);
297  EXPECT_EQ_MATRIX(hessian3, hessian3_sol_a + hessian3_sol_b, 1e-5);
298 }
299 
300 TEST_F(TestFiniteDifferences, forward_differences_jacobian_hessian_multipliers)
301 {
303  // problem 1
304  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
305  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
306  fd.computeJacobianAndHessian2(linc1, lfun1, jacobian1, hessian1, multipliers1);
307  Eigen::MatrixXd jacob1_scaled_sol = jacobian1_sol.array().colwise() * multipliers1_vec.array();
308  EXPECT_EQ_MATRIX(jacobian1, jacob1_scaled_sol, 1e-5);
309  EXPECT_ZERO_MATRIX(hessian1, 1e-3);
310 
311  // problem 2
312  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
313  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
314  fd.computeJacobianAndHessian2(linc2, lfun2, jacobian2, hessian2, multipliers2);
315  Eigen::MatrixXd jacob2_scaled_sol = jacobian2_sol.array().colwise() * multipliers2_vec.array();
316  EXPECT_EQ_MATRIX(jacobian2, jacob2_scaled_sol, 1e-5);
317  EXPECT_EQ_MATRIX(hessian2, multipliers2[0] * hessian2_sol, 1e-5);
318 
319  // problem 3
320  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
321  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
322  fd.computeJacobianAndHessian2(linc3, lfun3, jacobian3, hessian3, multipliers3);
323  Eigen::MatrixXd jacob3_scaled_sol = jacobian3_sol.array().colwise() * multipliers3_vec.array();
324  EXPECT_EQ_MATRIX(jacobian3, jacob3_scaled_sol, 1e-5);
325  EXPECT_EQ_MATRIX(hessian3, multipliers3[0] * hessian3_sol_a + multipliers3[1] * hessian3_sol_b, 1e-5);
326 }
327 
328 TEST_F(TestFiniteDifferences, central_differences_jacobian_hessian_multipliers)
329 {
331  // problem 1
332  auto linc1 = [this](int idx, double inc) { incX1(idx, inc); };
333  auto lfun1 = [this](Eigen::VectorXd& values) { fun1(values); };
334  fd.computeJacobianAndHessian2(linc1, lfun1, jacobian1, hessian1, multipliers1);
335  Eigen::MatrixXd jacob1_scaled_sol = jacobian1_sol.array().colwise() * multipliers1_vec.array();
336  EXPECT_EQ_MATRIX(jacobian1, jacob1_scaled_sol, 1e-5);
337  EXPECT_ZERO_MATRIX(hessian1, 1e-4);
338 
339  // problem 2
340  auto linc2 = [this](int idx, double inc) { incX2(idx, inc); };
341  auto lfun2 = [this](Eigen::VectorXd& values) { fun2(values); };
342  fd.computeJacobianAndHessian2(linc2, lfun2, jacobian2, hessian2, multipliers2);
343  Eigen::MatrixXd jacob2_scaled_sol = jacobian2_sol.array().colwise() * multipliers2_vec.array();
344  EXPECT_EQ_MATRIX(jacobian2, jacob2_scaled_sol, 1e-5);
345  EXPECT_EQ_MATRIX(hessian2, multipliers2[0] * hessian2_sol, 1e-5);
346 
347  // problem 3
348  auto linc3 = [this](int idx, double inc) { incX3(idx, inc); };
349  auto lfun3 = [this](Eigen::VectorXd& values) { fun3(values); };
350  fd.computeJacobianAndHessian2(linc3, lfun3, jacobian3, hessian3, multipliers3);
351  Eigen::MatrixXd jacob3_scaled_sol = jacobian3_sol.array().colwise() * multipliers3_vec.array();
352  EXPECT_EQ_MATRIX(jacobian3, jacob3_scaled_sol, 1e-5);
353  EXPECT_EQ_MATRIX(hessian3, multipliers3[0] * hessian3_sol_a + multipliers3[1] * hessian3_sol_b, 1e-5);
354 }
corbo::ForwardDifferences::computeJacobian2
void computeJacobian2(std::function< void(int, const double &)> inc_fun, std::function< void(Eigen::VectorXd &)> eval_fun, Eigen::Ref< Eigen::MatrixXd > jacobian) override
Compute Jacobian of a desired function (overload which accepts a slightly different callback function...
Definition: finite_differences.cpp:57
TestFiniteDifferences::fun2
void fun2(Eigen::VectorXd &values)
Definition: test_finite_differences.cpp:98
TestFiniteDifferences::~TestFiniteDifferences
virtual ~TestFiniteDifferences()
Definition: test_finite_differences.cpp:45
corbo::CentralDifferences::computeJacobianAndHessian2
void computeJacobianAndHessian2(std::function< void(int, const double &)> inc_fun, std::function< void(Eigen::VectorXd &)> eval_fun, Eigen::Ref< Eigen::MatrixXd > jacobian, Eigen::Ref< Eigen::MatrixXd > hessian, const double *multipliers=nullptr) override
Compute Jacobian and Hessian of a desired function (overload which accepts a slightly different callb...
Definition: finite_differences.cpp:120
corbo::FiniteDifferencesInterface
Interface class for finite difference approaches.
Definition: finite_differences_interface.h:82
corbo::ForwardDifferences
Finite differences via forward differences.
Definition: finite_differences.h:71
corbo::ForwardDifferences::computeJacobianAndHessian2
void computeJacobianAndHessian2(std::function< void(int, const double &)> inc_fun, std::function< void(Eigen::VectorXd &)> eval_fun, Eigen::Ref< Eigen::MatrixXd > jacobian, Eigen::Ref< Eigen::MatrixXd > hessian, const double *multipliers=nullptr) override
Compute Jacobian and Hessian of a desired function (overload which accepts a slightly different callb...
Definition: finite_differences.cpp:82
EXPECT_ZERO_MATRIX
#define EXPECT_ZERO_MATRIX(A, tol)
Definition: macros.h:75
TestFiniteDifferences::multipliers2_vec
Eigen::Map< const Eigen::Matrix< double, 1, 1 > > multipliers2_vec
Definition: test_finite_differences.cpp:100
TestFiniteDifferences::hessian2
Eigen::Matrix2d hessian2
Definition: test_finite_differences.cpp:95
macros.h
TestFiniteDifferences::jacobian2_sol
Eigen::Matrix< double, 1, 2 > jacobian2_sol
Definition: test_finite_differences.cpp:94
console.h
TestFiniteDifferences::x1
Eigen::Vector3d x1
Definition: test_finite_differences.cpp:78
TestFiniteDifferences::jacobian2
Eigen::Matrix< double, 1, 2 > jacobian2
Definition: test_finite_differences.cpp:93
TestFiniteDifferences::fun3
void fun3(Eigen::VectorXd &values)
Definition: test_finite_differences.cpp:109
TestFiniteDifferences::incX1
void incX1(int idx, double inc)
Definition: test_finite_differences.cpp:82
TestFiniteDifferences::incX3
void incX3(int idx, double inc)
Definition: test_finite_differences.cpp:108
value_comparison.h
corbo::CentralDifferences::computeHessian2
void computeHessian2(std::function< void(int, const double &)> inc_fun, std::function< void(Eigen::VectorXd &)> eval_fun, int dim_f, Eigen::Ref< Eigen::MatrixXd > hessian, const double *multipliers=nullptr) override
Compute Hessian of a desired function (overload which accepts a slightly different callback function)
Definition: finite_differences.cpp:107
corbo::CentralDifferences
Finite differences via central differences.
Definition: finite_differences.h:179
TestFiniteDifferences::TestFiniteDifferences
TestFiniteDifferences()
Definition: test_finite_differences.cpp:43
TestFiniteDifferences::multipliers1
double multipliers1[3]
Definition: test_finite_differences.cpp:89
corbo::ForwardDifferences::computeHessian2
void computeHessian2(std::function< void(int, const double &)> inc_fun, std::function< void(Eigen::VectorXd &)> eval_fun, int dim_f, Eigen::Ref< Eigen::MatrixXd > hessian, const double *multipliers=nullptr) override
Compute Hessian of a desired function (overload which accepts a slightly different callback function)
Definition: finite_differences.cpp:69
TestFiniteDifferences::hessian2_sol
Eigen::Matrix2d hessian2_sol
Definition: test_finite_differences.cpp:96
corbo::CentralDifferences::computeJacobian2
void computeJacobian2(std::function< void(int, const double &)> inc_fun, std::function< void(Eigen::VectorXd &)> eval_fun, Eigen::Ref< Eigen::MatrixXd > jacobian) override
Compute Jacobian of a desired function (overload which accepts a slightly different callback function...
Definition: finite_differences.cpp:95
TestFiniteDifferences::multipliers3_vec
Eigen::Map< const Eigen::Vector2d > multipliers3_vec
Definition: test_finite_differences.cpp:115
TestFiniteDifferences::jacobian3_sol
Eigen::Matrix< double, 2, 3 > jacobian3_sol
Definition: test_finite_differences.cpp:104
TestFiniteDifferences::SetUp
virtual void SetUp()
Definition: test_finite_differences.cpp:51
TestFiniteDifferences::fun1
void fun1(Eigen::VectorXd &values)
Definition: test_finite_differences.cpp:83
Eigen::Map< const Eigen::Vector3d >
EXPECT_EQ_MATRIX
#define EXPECT_EQ_MATRIX(A, B, tol)
Definition: macros.h:61
TestFiniteDifferences::multipliers3
double multipliers3[2]
Definition: test_finite_differences.cpp:114
finite_differences.h
TestFiniteDifferences::hessian1
Eigen::Matrix3d hessian1
Definition: test_finite_differences.cpp:81
TestFiniteDifferences::jacobian3
Eigen::Matrix< double, 2, 3 > jacobian3
Definition: test_finite_differences.cpp:103
TestFiniteDifferences::incX2
void incX2(int idx, double inc)
Definition: test_finite_differences.cpp:97
TestFiniteDifferences::hessian3_sol_a
Eigen::Matrix3d hessian3_sol_a
Definition: test_finite_differences.cpp:106
TestFiniteDifferences::hessian3
Eigen::Matrix3d hessian3
Definition: test_finite_differences.cpp:105
TestFiniteDifferences::jacobian1
Eigen::Matrix3d jacobian1
Definition: test_finite_differences.cpp:79
Eigen::Matrix< double, 1, 2 >
TestFiniteDifferences::multipliers1_vec
Eigen::Map< const Eigen::Vector3d > multipliers1_vec
Definition: test_finite_differences.cpp:90
TestFiniteDifferences::jacobian1_sol
Eigen::Matrix3d jacobian1_sol
Definition: test_finite_differences.cpp:80
TEST_F
TEST_F(TestFiniteDifferences, forward_differences_jacobian)
Definition: test_finite_differences.cpp:118
TestFiniteDifferences::multipliers2
double multipliers2[1]
Definition: test_finite_differences.cpp:99
TestFiniteDifferences::x2
Eigen::Vector2d x2
Definition: test_finite_differences.cpp:92
TestFiniteDifferences::hessian3_sol_b
Eigen::Matrix3d hessian3_sol_b
Definition: test_finite_differences.cpp:107
TestFiniteDifferences
Definition: test_finite_differences.cpp:39
TestFiniteDifferences::x3
Eigen::Vector3d x3
Definition: test_finite_differences.cpp:102


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:07:06