| bool syten::DenseProduct::is_trivial_order_r | ( | std::array< Index, frank > const & | dims_a, |
| std::array< Index, srank > const & | dims_b, | ||
| std::array< int, frank > const & | c_a, | ||
| std::array< int, srank > const & | c_b | ||
| ) |
Returns true if r calculated as the contraction of tensors a and b defined by their dimensions and contraction specifiers does not have to be transposed according to those specifiers.
That is, this function assumes that c_a/dims_a and c_b/dims_b are suitable to directly GEMM and then checks whether the result has to be transposed to conform to c_a and c_b.
For example, assume c_a = {1, -2, -4} and c_b = {-1, -3, 1}. Then neither a nor b have to be transposed to call GEMM, but r will then have leg order -1, -3, -2, -4 so we still have to transpose legs 2 and 3.
References syten::LimVec< Type, max, MaxType, type >::begin(), syten::LimVec< Type, max, MaxType, type >::end(), std::is_sorted(), syten::LimVec< Type, max, MaxType, type >::push_back(), and syten::LimVec< Type, max, MaxType, type >::size().
Here is the call graph for this function: