GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 8 / 0 / 8
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 10 / 0 / 10

src/conv/min_plus/cv_cv/lib.hpp
Line Branch Exec Source
1 #pragma once
2
3 #include "../../../util/alias/others/lib.hpp"
4
5 namespace tifa_libs {
6
7 //! assume a and b are convex, aka. $a_{i-1} - a_{i-2} \leq a_i - a_{i-1}$ and it also holds for b
8 template <class T>
9 34 CEXP vec<T> conv_minplus_cv_cv(vec<T> CR a, vec<T> CR b) NE {
10 34 cu32 n = (u32)a.size(), m = (u32)b.size();
11 34 vec<T> c(n + m - 1);
12 34 c[0] = a[0] + b[0];
13
2/2
✓ Branch 0 taken 16270627 times.
✓ Branch 1 taken 34 times.
16270661 flt_ (u32, k, 0, n + m - 2, i = 0)
14
8/8
✓ Branch 0 taken 15662925 times.
✓ Branch 1 taken 607702 times.
✓ Branch 2 taken 15116496 times.
✓ Branch 3 taken 546429 times.
✓ Branch 8 taken 7377645 times.
✓ Branch 9 taken 7738851 times.
✓ Branch 10 taken 7985347 times.
✓ Branch 11 taken 8285280 times.
16270627 if (cu32 j = k - i; j == m - 1 || (i < n - 1 && a[i + 1] + b[j] < a[i] + b[j + 1])) c[k + 1] = a[++i] + b[j];
15 8285280 else c[k + 1] = a[i] + b[j + 1];
16 34 return c;
17 }
18
19 } // namespace tifa_libs
20