1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-12 20:27:06 +01:00

Grid tensor serialisation fully implemented and tested

This commit is contained in:
2018-03-08 19:12:03 +00:00
parent caf2f6b274
commit 360cface33
6 changed files with 519 additions and 441 deletions

View File

@ -55,5 +55,38 @@ LOGICAL_BINOP(&);
LOGICAL_BINOP(||);
LOGICAL_BINOP(&&);
template <class T>
strong_inline bool operator==(const iScalar<T> &t1, const iScalar<T> &t2)
{
return (t1._internal == t2._internal);
}
template <class T, int N>
strong_inline bool operator==(const iVector<T, N> &t1, const iVector<T, N> &t2)
{
bool res = true;
for (unsigned int i = 0; i < N; ++i)
{
res = (res && (t1._internal[i] == t2._internal[i]));
}
return res;
}
template <class T, int N>
strong_inline bool operator==(const iMatrix<T, N> &t1, const iMatrix<T, N> &t2)
{
bool res = true;
for (unsigned int i = 0; i < N; ++i)
for (unsigned int j = 0; j < N; ++j)
{
res = (res && (t1._internal[i][j] == t2._internal[i][j]));
}
return res;
}
}
#endif