cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
declarations.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_DECLARATIONS_H
4#define pRC_CORE_TENSOR_DECLARATIONS_H
5
9
10namespace pRC
11{
12 template<class T, Size... Ns>
13 requires(IsValue<T> || IsComplex<T> || IsBool<T>) &&
14 requires { Sizes<Ns...>::size(); }
15 class Tensor;
16
17 namespace TensorViews
18 {
19 template<class T, class N, class F>
20 class View;
21
22 template<class T, class N, class F>
23 class Assignable;
24 }
25
26 template<class T>
27 concept IsTensor = !IsReference<T> && requires {
28 {
29 []<class U, Size... Ns>(Tensor<U, Ns...> const &&)
30 {
31 }(std::declval<T>())
32 };
33 };
34
35 template<class T>
36 concept IsTensorView = !IsReference<T> && requires {
37 {
38 []<class U, class N, class F>(TensorViews::View<U, N, F> const &&)
39 {
40 }(std::declval<T>())
41 };
42 };
43
44 template<class T>
46
47 template<class T>
48 concept IsScalar = IsTensor<T> && T::Dimension == 0;
49
50 template<class T>
51 concept IsScalarish = IsTensorish<T> && T::Dimension == 0;
52
53 template<class T>
54 concept IsVector = IsTensor<T> && T::Dimension == 1;
55
56 template<class T>
57 concept IsVectorish = IsTensorish<T> && T::Dimension == 1;
58
59 template<class T>
60 concept IsMatrix = IsTensor<T> && T::Dimension == 2;
61
62 template<class T>
63 concept IsMatrixish = IsTensorish<T> && T::Dimension == 2;
64}
65#endif // pRC_CORE_TENSOR_DECLARATIONS_H
static constexpr auto size()
Definition sequence.hpp:69
Definition assignable.hpp:21
Definition declarations.hpp:20
Definition declarations.hpp:60
Definition declarations.hpp:63
Definition concepts.hpp:19
Definition declarations.hpp:48
Definition declarations.hpp:51
Definition declarations.hpp:36
Definition declarations.hpp:27
Definition declarations.hpp:45
Definition declarations.hpp:54
Definition declarations.hpp:57
pRC::Float<> T
Definition externs_nonTT.hpp:1
Definition cholesky.hpp:10
std::size_t Size
Definition basics.hpp:31
Tensor(TensorViews::View< T, Sizes< Ns... >, F > const &) -> Tensor< T, Ns... >