@@ -17,7 +17,7 @@ template<typename _T, class _TensorA, class _TensorB, class _TensorC,
1717void contract_211 (const _T& alpha, const _TensorA& A, const btas::DEFAULT::index<_UA>& aA, const _TensorB& B, const btas::DEFAULT::index<_UB>& aB,
1818 const _T& beta, _TensorC& C, const btas::DEFAULT::index<_UC>& aC, const bool conjgA, const bool conjgB) {
1919 assert (aA.size () == 2 && aB.size () == 1 && aC.size () == 1 );
20- assert (A.range (). ordinal (). contiguous () && B.range (). ordinal (). contiguous () && C.range (). ordinal (). contiguous ( ));
20+ assert (is_contiguous ( A.range ()) && is_contiguous ( B.range ()) && is_contiguous ( C.range ()));
2121 if (conjgB) throw std::logic_error (" complex conjugation of 1-index tensors is not considered in contract_211" );
2222
2323 const bool notrans = aB[0 ] == aA[1 ];
@@ -36,7 +36,7 @@ void contract_222(const _T& alpha, const _TensorA& A, const btas::DEFAULT::index
3636 const _T& beta, _TensorC& C, const btas::DEFAULT::index<_UC>& aC, const bool conjgA, const bool conjgB) {
3737 // TODO we do not consider complex matrices yet.
3838 assert (aA.size () == 2 && aB.size () == 2 && aC.size () == 2 );
39- assert (A.range (). ordinal (). contiguous () && B.range (). ordinal (). contiguous () && C.range (). ordinal (). contiguous ( ));
39+ assert (is_contiguous ( A.range ()) && is_contiguous ( B.range ()) && is_contiguous ( C.range ()));
4040 if (std::find (aA.begin (), aA.end (), aC.front ()) != aA.end ()) {
4141 // then multiply A * B -> C
4242 const bool notransA = aA.front () == aC.front ();
@@ -65,10 +65,10 @@ template<typename _T, class _TensorA, class _TensorB, class _TensorC,
6565void contract_323 (const _T& alpha, const _TensorA& A, const btas::DEFAULT::index<_UA>& aA, const _TensorB& B, const btas::DEFAULT::index<_UB>& aB,
6666 const _T& beta, _TensorC& C, const btas::DEFAULT::index<_UC>& aC, const bool conjgA, const bool conjgB) {
6767 assert (aA.size () == 3 && aB.size () == 2 && aC.size () == 3 );
68- assert (A.range (). ordinal (). contiguous () && B.range (). ordinal (). contiguous () && C.range (). ordinal (). contiguous ( ));
68+ assert (is_contiguous ( A.range ()) && is_contiguous ( B.range ()) && is_contiguous ( C.range ()));
6969 if (conjgA) throw std::logic_error (" complex conjugation of 3-index tensors is not considered in contract_323" );
7070
71- // TODO this function is limited to special cases where one of three indices of A will be replaced in C. Permuation is not considered so far.
71+ // TODO this function is limited to special cases where one of three indices of A will be replaced in C. Permutation is not considered so far.
7272 // first idenfity which indices to be rotated
7373 int irot = -1 ;
7474 for (int i = 0 ; i != 3 ; ++i)
@@ -128,7 +128,7 @@ template<typename _T, class _TensorA, class _TensorB, class _TensorC,
128128void contract_332 (const _T& alpha, const _TensorA& A, const btas::DEFAULT::index<_UA>& aA, const _TensorB& B, const btas::DEFAULT::index<_UB>& aB,
129129 const _T& beta, _TensorC& C, const btas::DEFAULT::index<_UC>& aC, const bool conjgA, const bool conjgB) {
130130 assert (aA.size () == 3 && aB.size () == 3 && aC.size () == 2 );
131- assert (A.range (). ordinal (). contiguous () && B.range (). ordinal (). contiguous () && C.range (). ordinal (). contiguous ( ));
131+ assert (is_contiguous ( A.range ()) && is_contiguous ( B.range ()) && is_contiguous ( C.range ()));
132132
133133 const bool back2 = aA[0 ] == aB[0 ] && aA[1 ] == aB[1 ];
134134 const bool front2 = aA[1 ] == aB[1 ] && aA[2 ] == aB[2 ];
0 commit comments