GCC Code Coverage Report


Directory: ./
File: include/hpp/bezier-com-traj/common_solve_methods.inl
Date: 2025-03-18 04:20:50
Exec Total Coverage
Lines: 16 16 100.0%
Branches: 10 16 62.5%

Line Branch Exec Source
1
2 namespace bezier_com_traj {
3
4 template <typename Point>
5 25 std::vector<std::pair<double, Point> > computeDiscretizedWaypoints(
6 const ProblemData& pData, double T, const T_time& timeArray) {
7 typedef std::pair<double, Point> coefs_t;
8 25 std::vector<coefs_t> wps;
9
1/2
✓ Branch 1 taken 25 times.
✗ Branch 2 not taken.
25 std::vector<Point> pi = computeConstantWaypoints(pData, T);
10 // evaluate curve work with normalized time !
11
2/2
✓ Branch 3 taken 414 times.
✓ Branch 4 taken 25 times.
439 for (CIT_time cit = timeArray.begin(); cit != timeArray.end(); ++cit) {
12 414 double t = std::min(cit->first / T, 1.);
13
2/4
✓ Branch 1 taken 414 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 414 times.
✗ Branch 5 not taken.
414 wps.push_back(evaluateCurveAtTime(pData, pi, t));
14 }
15 50 return wps;
16 25 }
17
18 template <typename Point>
19 65 std::vector<std::pair<double, Point> > computeDiscretizedAccelerationWaypoints(
20 const ProblemData& pData, double T, const T_time& timeArray) {
21 typedef std::pair<double, Point> coefs_t;
22 65 std::vector<coefs_t> wps;
23
1/2
✓ Branch 1 taken 65 times.
✗ Branch 2 not taken.
65 std::vector<Point> pi = computeConstantWaypoints(pData, T);
24 // evaluate curve work with normalized time !
25
2/2
✓ Branch 3 taken 1242 times.
✓ Branch 4 taken 65 times.
1307 for (CIT_time cit = timeArray.begin(); cit != timeArray.end(); ++cit) {
26 1242 double t = std::min(cit->first / T, 1.);
27
2/4
✓ Branch 1 taken 1242 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1242 times.
✗ Branch 5 not taken.
1242 wps.push_back(evaluateAccelerationCurveAtTime(pData, pi, T, t));
28 }
29 130 return wps;
30 65 }
31
32 } // end namespace bezier_com_traj
33