tensor: shares_index implemented

This commit is contained in:
2026-01-28 15:36:53 +01:00
parent 375e690296
commit 097677ef3f
2 changed files with 10 additions and 0 deletions

View File

@@ -2485,6 +2485,13 @@ for(int i=0; i<I.size(); ++i) if(zero_in_index(I[i])) return true;
return false;
}
bool shares_index(const FLATINDEX &I, const FLATINDEX &J)
{
for(int i=0; i<I.size(); ++i) for(int j=0; j<J.size(); ++j)
if(I[i]==J[j]) return true;
return false;
}
template class Tensor<double>;
template class Tensor<std::complex<double> >;