SimiLie
Loading...
Searching...
No Matches
prime.hpp
1// SPDX-FileCopyrightText: 2024 Baptiste Legouix
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include <ddc/ddc.hpp>
7
8#include <similie/misc/specialization.hpp>
9
10#include "character.hpp"
11
12namespace sil {
13
14namespace tensor {
15
16template <TensorNatIndex Index, std::size_t I = 1>
17struct prime : Index
18{
19};
20
21template <TensorNatIndex Index>
23
24namespace detail {
25
26template <class Indices, std::size_t I>
27struct Primes;
28
29template <class... Index, std::size_t I>
30struct Primes<ddc::detail::TypeSeq<Index...>, I>
31{
32 using type = ddc::detail::TypeSeq<prime<Index, I>...>;
33};
34
35template <class... Index, std::size_t I>
36struct Primes<ddc::detail::TypeSeq<Contravariant<Index>...>, I>
37{
38 using type = ddc::detail::TypeSeq<Contravariant<prime<Index, I>>...>;
39};
40
41template <class... Index, std::size_t I>
42struct Primes<ddc::detail::TypeSeq<Covariant<Index>...>, I>
43{
44 using type = ddc::detail::TypeSeq<Covariant<prime<Index, I>>...>;
45};
46
47} // namespace detail
48
49template <misc::Specialization<ddc::detail::TypeSeq> Indices, std::size_t I = 1>
50using primes = detail::Primes<Indices, I>::type;
51
52template <misc::Specialization<ddc::detail::TypeSeq> Indices>
54
55} // namespace tensor
56
57} // namespace sil
detail::Primes< Indices, I >::type primes
Definition prime.hpp:50
primes< Indices, 2 > seconds
Definition prime.hpp:53
The top-level namespace of SimiLie.
Definition csr.hpp:14