Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 6e77684

Browse files
committed
Refactor Vc plugin
1 parent df4e6e9 commit 6e77684

29 files changed

Lines changed: 88 additions & 199 deletions

common/include/algebra/matrix.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ namespace algebra::storage {
2020
/// Generic matrix type that can take vectors as columns
2121
template <template <typename, std::size_t> class array_t,
2222
concepts::scalar scalar_t, std::size_t ROW, std::size_t COL>
23-
struct ALGEBRA_ALIGN(alignof(storage::vector<ROW, scalar_t, array_t>)) matrix {
23+
struct ALGEBRA_ALIGN(
24+
alignof(algebra::storage::vector<ROW, scalar_t, array_t>)) matrix {
2425

2526
// The matrix consists of column vectors
26-
using vector_type = storage::vector<ROW, scalar_t, array_t>;
27+
using vector_type = algebra::storage::vector<ROW, scalar_t, array_t>;
2728
// Value type: Can be simd types
2829
using scalar_type = scalar_t;
2930

common/include/algebra/vector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ struct is_storage_vector : public std::false_type {};
287287

288288
template <std::size_t N, concepts::scalar scalar_t,
289289
template <typename, std::size_t> class array_t>
290-
struct is_storage_vector<storage::vector<N, scalar_t, array_t>>
290+
struct is_storage_vector<algebra::storage::vector<N, scalar_t, array_t>>
291291
: public std::true_type {};
292292

293293
template <typename T>

frontend/vc_aos/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ message(STATUS "Building the Vc AoS algebra plugin")
99
# Set up the library.
1010
algebra_add_library( algebra_vc_aos vc_aos
1111
"include/algebra/vc_aos.hpp"
12+
"include/algebra/impl/*.hpp"
1213
)
1314

1415
target_link_libraries(
1516
algebra_vc_aos
16-
INTERFACE
17-
algebra::common
18-
algebra::vc_aos_storage
19-
algebra::vc_aos_math
20-
algebra::generic_math
17+
INTERFACE Vc::Vc algebra::common algebra::utils algebra::generic_math
2118
)
2219

2320
algebra_test_public_headers( algebra_vc_aos

storage/vc_aos/include/algebra/storage/impl/vc_aos_approximately_equal.hpp renamed to frontend/vc_aos/include/algebra/impl/vc_aos_approximately_equal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Algebra plugins, part of the ACTS project
22
*
3-
* (c) 2025 CERN for the benefit of the ACTS project
3+
* (c) 2025-2026 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/

storage/vc_aos/include/algebra/storage/impl/vc_aos_concepts.hpp renamed to frontend/vc_aos/include/algebra/impl/vc_aos_concepts.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Algebra plugins library, part of the ACTS project
22
*
3-
* (c) 2024 CERN for the benefit of the ACTS project
3+
* (c) 2024-2026 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/

storage/vc_aos/include/algebra/storage/impl/vc_aos_getter.hpp renamed to frontend/vc_aos/include/algebra/impl/vc_aos_getter.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Algebra plugins library, part of the ACTS project
22
*
3-
* (c) 2020-2024 CERN for the benefit of the ACTS project
3+
* (c) 2020-2026 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/

math/vc_aos/include/algebra/math/impl/vc_aos_matrix.hpp renamed to frontend/vc_aos/include/algebra/impl/vc_aos_matrix.hpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Algebra plugins library, part of the ACTS project
22
*
3-
* (c) 2024 CERN for the benefit of the ACTS project
3+
* (c) 2024-2026 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/
@@ -15,33 +15,37 @@
1515

1616
namespace algebra::vc_aos::math {
1717

18-
using storage::identity;
19-
using storage::set_identity;
20-
using storage::set_zero;
21-
using storage::transpose;
22-
using storage::zero;
18+
using algebra::storage::identity;
19+
using algebra::storage::set_identity;
20+
using algebra::storage::set_zero;
21+
using algebra::storage::transpose;
22+
using algebra::storage::zero;
2323

2424
/// @returns the determinant
2525
template <std::size_t N, concepts::value value_t,
2626
template <typename, std::size_t> class array_t>
2727
ALGEBRA_HOST_DEVICE constexpr value_t determinant(
28-
const storage::matrix<array_t, value_t, N, N> &m) noexcept {
28+
const algebra::storage::matrix<array_t, value_t, N, N> &m) noexcept {
2929
return algebra::generic::math::determinant(m);
3030
}
3131

3232
/// @returns the inverse
3333
template <std::size_t ROW, std::size_t COL, concepts::value value_t,
3434
template <typename, std::size_t> class array_t>
35-
ALGEBRA_HOST_DEVICE constexpr storage::matrix<array_t, value_t, COL, ROW>
36-
inverse(const storage::matrix<array_t, value_t, ROW, COL> &m) noexcept {
35+
ALGEBRA_HOST_DEVICE constexpr algebra::storage::matrix<array_t, value_t, COL,
36+
ROW>
37+
inverse(
38+
const algebra::storage::matrix<array_t, value_t, ROW, COL> &m) noexcept {
3739
return algebra::generic::math::inverse(m);
3840
}
3941

4042
/// @returns the transpose
4143
template <std::size_t ROW, std::size_t COL, concepts::value value_t,
4244
template <typename, std::size_t> class array_t>
43-
ALGEBRA_HOST_DEVICE constexpr storage::matrix<array_t, value_t, COL, ROW>
44-
transpose(const storage::matrix<array_t, value_t, ROW, COL> &m) noexcept {
45+
ALGEBRA_HOST_DEVICE constexpr algebra::storage::matrix<array_t, value_t, COL,
46+
ROW>
47+
transpose(
48+
const algebra::storage::matrix<array_t, value_t, ROW, COL> &m) noexcept {
4549
return algebra::generic::math::transpose(m);
4650
}
4751

math/vc_aos/include/algebra/math/impl/vc_aos_transform3.hpp renamed to frontend/vc_aos/include/algebra/impl/vc_aos_transform3.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Algebra plugins library, part of the ACTS project
22
*
3-
* (c) 2020-2024 CERN for the benefit of the ACTS project
3+
* (c) 2020-2026 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/
@@ -9,11 +9,11 @@
99

1010
// Project include(s).
1111
#include "algebra/concepts.hpp"
12+
#include "algebra/impl/vc_aos_approximately_equal.hpp"
1213
#include "algebra/math.hpp"
1314
#include "algebra/matrix.hpp"
1415
#include "algebra/matrix_getter.hpp"
1516
#include "algebra/qualifiers.hpp"
16-
#include "algebra/storage/impl/vc_aos_approximately_equal.hpp"
1717
#include "algebra/utils/approximately_equal.hpp"
1818
#include "algebra/vector.hpp"
1919

@@ -63,18 +63,18 @@ struct transform3 {
6363
using array_type = array_t<scalar_type, N>;
6464

6565
/// 3-element "vector" type (does not observe translations)
66-
using vector3 = storage::vector<3u, scalar_type, array_t>;
66+
using vector3 = algebra::storage::vector<3u, scalar_type, array_t>;
6767
/// Point in 3D space (does observe translations)
6868
using point3 = vector3;
6969
/// Point in 2D space
70-
using point2 = storage::vector<2u, scalar_type, array_t>;
70+
using point2 = algebra::storage::vector<2u, scalar_type, array_t>;
7171

7272
/// 4x4 matrix type (Last row is {0, 0, 0, 1} and can be omitted)
73-
using matrix44 = storage::matrix<array_t, scalar_type, 3u, 4u>;
73+
using matrix44 = algebra::storage::matrix<array_t, scalar_type, 3u, 4u>;
7474
using column_t = typename matrix44::vector_type;
7575

7676
/// Function (object) used for accessing a matrix element
77-
using element_getter = storage::element_getter;
77+
using element_getter = algebra::storage::element_getter;
7878

7979
/// Helper type to cast this to another floating point precision
8080
template <concepts::scalar o_scalar_t>
@@ -92,8 +92,8 @@ struct transform3 {
9292
/// Default constructor: identity
9393
ALGEBRA_HOST_DEVICE
9494
constexpr transform3()
95-
: _data{storage::identity<matrix44>()},
96-
_data_inv{storage::identity<matrix44>()} {}
95+
: _data{algebra::storage::identity<matrix44>()},
96+
_data_inv{algebra::storage::identity<matrix44>()} {}
9797

9898
/// Contructor with arguments: t, x, y, z
9999
///
@@ -261,7 +261,7 @@ struct transform3 {
261261
ALGEBRA_HOST_DEVICE
262262
constexpr auto rotation() const {
263263

264-
using matrix_t = storage::matrix<array_t, scalar_type, 3u, 3u>;
264+
using matrix_t = algebra::storage::matrix<array_t, scalar_type, 3u, 3u>;
265265

266266
matrix_t submatrix;
267267
for (unsigned int icol = 0; icol < 3; ++icol) {

storage/vc_aos/include/algebra/storage/vc_aos.hpp renamed to frontend/vc_aos/include/algebra/impl/vc_aos_types.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Algebra plugins library, part of the ACTS project
22
*
3-
* (c) 2020-2024 CERN for the benefit of the ACTS project
3+
* (c) 2020-2026 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/
@@ -9,10 +9,10 @@
99

1010
// Project include(s).
1111
#include "algebra/concepts.hpp"
12+
#include "algebra/impl/vc_aos_approximately_equal.hpp"
13+
#include "algebra/impl/vc_aos_concepts.hpp"
14+
#include "algebra/impl/vc_aos_getter.hpp"
1215
#include "algebra/matrix.hpp"
13-
#include "algebra/storage/impl/vc_aos_approximately_equal.hpp"
14-
#include "algebra/storage/impl/vc_aos_concepts.hpp"
15-
#include "algebra/storage/impl/vc_aos_getter.hpp"
1616
#include "algebra/type_traits.hpp"
1717
#include "algebra/vector.hpp"
1818

math/vc_aos/include/algebra/math/impl/vc_aos_vector.hpp renamed to frontend/vc_aos/include/algebra/impl/vc_aos_vector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Algebra plugins library, part of the ACTS project
22
*
3-
* (c) 2020-2025 CERN for the benefit of the ACTS project
3+
* (c) 2020-2026 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/
@@ -9,9 +9,9 @@
99

1010
// Project include(s).
1111
#include "algebra/concepts.hpp"
12+
#include "algebra/impl/vc_aos_types.hpp"
1213
#include "algebra/math.hpp"
1314
#include "algebra/qualifiers.hpp"
14-
#include "algebra/storage/vc_aos.hpp"
1515
#include "algebra/vector.hpp"
1616

1717
// Vc include(s).

0 commit comments

Comments
 (0)