pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
lower_triangular.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_LOWER_TRIANGULAR_H
4#define pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_LOWER_TRIANGULAR_H
5
9
10namespace pRC
11{
19 template<class X, class R = RemoveReference<X>, If<IsTensorish<R>> = 0,
20 If<IsInvocable<View, X>> = 0,
21 If<IsSatisfied<(typename R::Dimension() == 2)>> = 0>
22 static inline constexpr auto lowerTriangular(X &&a)
23 {
25 return TensorViews::LowerTriangular<typename R::Type, typename R::Sizes,
26 V>(view(forward<X>(a)));
27 }
28
39 template<class X, class R = RemoveReference<X>, If<IsTensorish<R>> = 0,
40 If<Not<IsInvocable<View, X>>> = 0,
41 If<IsInvocable<LowerTriangular, X &>> = 0>
42 static inline constexpr auto lowerTriangular(X &&a)
43 {
44 return eval(lowerTriangular(a));
45 }
46}
47#endif // pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_LOWER_TRIANGULAR_H
Definition lower_triangular.hpp:13
Definition cholesky.hpp:18
static constexpr X eval(X &&a)
Definition eval.hpp:11
static constexpr X view(X &&a)
Returns a TensorView obtained from a TensorView.
Definition view.hpp:22
static constexpr auto lowerTriangular(X &&a)
Transforms a Tensor into lower triangular form.
Definition lower_triangular.hpp:22
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13