tensor: operator== and hash

This commit is contained in:
jiri committed 2026-11-26 20:46:53 +01:00
1 parent ed96821e0a
commit e91d4d0036
4 files changed
+28 -3

No files matched your search

+2 -1
View File
@@ -351,4 +351,5 @@ std::unordered_map<NRVec<int>,double> a;
std::unordered_map<NRPerm<int>,double,LA::Hash> b;
\end{lstlisting}
A key stored in such a container shares its data with the object it was copied from, which therefore must not be
modified afterwards without \code{copyonwrite()}. \code{Tensor} has no \code{operator==} and cannot be a key.
modified afterwards without \code{copyonwrite()}. \code{std::hash} is specialized also for \code{Tensor} (by its
\code{hash()} without the names of the indices).