| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // This file is part of Bembel, the higher order C++ boundary element library. | ||
| 2 | // | ||
| 3 | // Copyright (C) 2022 see <http://www.bembel.eu> | ||
| 4 | // | ||
| 5 | // It was written as part of a cooperation of J. Doelz, H. Harbrecht, S. Kurz, | ||
| 6 | // M. Multerer, S. Schoeps, and F. Wolf at Technische Universitaet Darmstadt, | ||
| 7 | // Universitaet Basel, and Universita della Svizzera italiana, Lugano. This | ||
| 8 | // source code is subject to the GNU General Public License version 3 and | ||
| 9 | // provided WITHOUT ANY WARRANTY, see <http://www.bembel.eu> for further | ||
| 10 | // information. | ||
| 11 | #ifndef BEMBEL_SRC_SPLINE_UNROLL_HPP_ | ||
| 12 | #define BEMBEL_SRC_SPLINE_UNROLL_HPP_ | ||
| 13 | |||
| 14 | namespace Bembel { | ||
| 15 | namespace Spl { | ||
| 16 | |||
| 17 | /** | ||
| 18 | * \brief Tiny helper functions. | ||
| 19 | */ | ||
| 20 | |||
| 21 | // Unrolls a matrix into a vector. Y-Dir first. | ||
| 22 | template <typename T> | ||
| 23 | 385 | inline Eigen::Matrix<T, -1, 1> Unroll( | |
| 24 | const Eigen::Matrix<T, -1, -1> &input_matrix) noexcept { | ||
| 25 | 385 | const int nx = input_matrix.cols(); | |
| 26 | 385 | const int ny = input_matrix.rows(); | |
| 27 | // std::cout << "unroll\n"; | ||
| 28 | 385 | Eigen::Matrix<T, -1, 1> out(nx * ny, 1); | |
| 29 |
2/2✓ Branch 0 taken 1368 times.
✓ Branch 1 taken 385 times.
|
1753 | for (int i = 0; i < nx; i++) { |
| 30 |
2/2✓ Branch 2 taken 5740 times.
✓ Branch 3 taken 1368 times.
|
7108 | for (int j = 0; j < ny; j++) out(i * ny + j) = input_matrix(j, i); |
| 31 | } | ||
| 32 | 385 | return out; | |
| 33 | } | ||
| 34 | } // namespace Spl | ||
| 35 | } // namespace Bembel | ||
| 36 | #endif // BEMBEL_SRC_SPLINE_UNROLL_HPP_ | ||
| 37 |