Directory: | ./ |
---|---|
File: | include/ndcurves/optimization/quadratic_problem.h |
Date: | 2025-03-05 17:18:30 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 7 | 13 | 53.8% |
Branches: | 4 | 16 | 25.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /** | ||
2 | * \file bezier_curve.h | ||
3 | * \brief class allowing to create a Bezier curve of dimension 1 <= n <= 3. | ||
4 | * \author Steve T. | ||
5 | * \version 0.1 | ||
6 | * \date 06/17/2013 | ||
7 | */ | ||
8 | |||
9 | #ifndef _CLASS_LINEAR_PROBLEM | ||
10 | #define _CLASS_LINEAR_PROBLEM | ||
11 | |||
12 | #include <Eigen/Core> | ||
13 | |||
14 | #include "ndcurves/optimization/definitions.h" | ||
15 | #include "ndcurves/optimization/details.h" | ||
16 | #include "ndcurves/optimization/integral_cost.h" | ||
17 | |||
18 | namespace ndcurves { | ||
19 | namespace optimization { | ||
20 | |||
21 | template <typename Point, typename Numeric, bool Safe> | ||
22 | ✗ | quadratic_problem<Point, Numeric> generate_problem( | |
23 | const problem_definition<Point, Numeric>& pDef, | ||
24 | const quadratic_variable<Numeric>& cost) { | ||
25 | ✗ | quadratic_problem<Point, Numeric> prob; | |
26 | ✗ | problem_data<Point, Numeric> pData = | |
27 | setup_control_points<Point, Numeric, Safe>(pDef); | ||
28 | ✗ | initInequalityMatrix<Point, Numeric>(pDef, pData, prob); | |
29 | ✗ | prob.cost = cost; | |
30 | ✗ | return prob; | |
31 | } | ||
32 | |||
33 | template <typename Point, typename Numeric, bool Safe> | ||
34 | 2 | quadratic_problem<Point, Numeric> generate_problem( | |
35 | const problem_definition<Point, Numeric>& pDef, | ||
36 | const integral_cost_flag costFlag) { | ||
37 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | quadratic_problem<Point, Numeric> prob; |
38 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | problem_data<Point, Numeric> pData = |
39 | setup_control_points<Point, Numeric, Safe>(pDef); | ||
40 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | initInequalityMatrix<Point, Numeric>(pDef, pData, prob); |
41 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | prob.cost = compute_integral_cost<Point, Numeric>(pData, costFlag); |
42 | 4 | return prob; | |
43 | 2 | } | |
44 | } // namespace optimization | ||
45 | } // namespace ndcurves | ||
46 | #endif //_CLASS_LINEAR_PROBLEM | ||
47 |