pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
zero.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_TENSOR_TRAIN_TENSOR_ZERO_H
4#define pRC_TENSOR_TRAIN_TENSOR_ZERO_H
5
9
10namespace pRC
11{
12 template<class T>
13 struct Zero<T, If<TensorTrain::IsTensorView<T>>> : Zero<ResultOf<Eval, T>>
14 {
15 };
16
17 template<class T>
18 struct Zero<T, If<TensorTrain::IsTensor<T>>>
19 {
20 constexpr auto operator()()
21 {
22 auto const f = []<Index C>()
23 {
25 };
26
27 using F = RemoveConstReference<decltype(f)>;
28 using N = typename T::N;
29 using Ranks = typename T::Ranks;
30
31 return TensorTrain::TensorViews::Enumerate<typename T::Type, N,
32 Ranks, F>(f);
33 }
34 };
35}
36#endif // pRC_TENSOR_TRAIN_TENSOR_ZERO_H
Definition enumerate.hpp:19
Definition cholesky.hpp:18
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
RemoveConst< RemoveReference< T > > RemoveConstReference
Definition type_traits.hpp:62
Size Index
Definition type_traits.hpp:21
Definition type_traits.hpp:60
Definition type_traits.hpp:16
constexpr auto operator()()
Definition zero.hpp:20
Definition type_traits.hpp:268