pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
block.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_FUNCTORS_BLOCK_H
4#define pRC_CORE_FUNCTORS_BLOCK_H
5
8
9namespace pRC
10{
11 template<Size... Bs>
12 struct Block
13 {
14 template<class X, class... Os,
15 If<True<decltype(block<Bs...>(declval<X>(), declval<Os>()...))>> =
16 0>
17 constexpr decltype(auto) operator()(X &&a, Os const... offsets) const
18 {
19 return block<Bs...>(forward<X>(a), offsets...);
20 }
21 };
22}
23#endif // pRC_CORE_FUNCTORS_BLOCK_H
Definition cholesky.hpp:18
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
std::size_t Size
Definition type_traits.hpp:20
static constexpr auto block(X &&a, Os const ... offsets)
Splits a Tensor into equal-sized blocks and returns one block specified by indices.
Definition block.hpp:41
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
Definition block.hpp:13
constexpr decltype(auto) operator()(X &&a, Os const ... offsets) const
Definition block.hpp:17
Definition type_traits.hpp:38