| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <algorithm> | ||
| 4 | #include <cmath> | ||
| 5 | #include <cstddef> | ||
| 6 | #include <string> | ||
| 7 | #include <tuple> | ||
| 8 | #include <vector> | ||
| 9 | |||
| 10 | #include "task/include/task.hpp" | ||
| 11 | |||
| 12 | namespace guseva_crs { | ||
| 13 | |||
| 14 | 192 | struct CRS { | |
| 15 | std::size_t nz{}; | ||
| 16 | std::size_t nrows{}; | ||
| 17 | std::size_t ncols{}; | ||
| 18 | std::vector<double> values; | ||
| 19 | std::vector<std::size_t> cols; | ||
| 20 | std::vector<std::size_t> row_ptrs; | ||
| 21 | }; | ||
| 22 | |||
| 23 | using InType = std::tuple<CRS, CRS>; | ||
| 24 | using OutType = CRS; | ||
| 25 | using TestType = std::string; | ||
| 26 | using BaseTask = ppc::task::Task<InType, OutType>; | ||
| 27 | |||
| 28 | constexpr double kZERO = 10e-5; | ||
| 29 | |||
| 30 | 96 | inline bool Equal(const CRS &a, const CRS &b) { | |
| 31 |
3/6✓ Branch 0 taken 96 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 96 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 96 times.
✗ Branch 5 not taken.
|
96 | return a.nz == b.nz && a.ncols == b.ncols && a.nrows == b.nrows && |
| 32 |
1/2✓ Branch 0 taken 8176 times.
✗ Branch 1 not taken.
|
8176 | std::ranges::equal(a.values, b.values, [](double a, double b) { return std::fabs(a - b) < kZERO; }); |
| 33 | } | ||
| 34 | |||
| 35 | } // namespace guseva_crs | ||
| 36 |