1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-13 04:37:05 +01:00

Only write indices with dimesion!=1

This commit is contained in:
2019-02-03 20:58:58 +00:00
parent bd75b843fa
commit 7eda54bb87
2 changed files with 38 additions and 25 deletions

View File

@ -296,7 +296,7 @@ bool DebugEigenTest()
{
const char pszTestFileName[] = "test_tensor.bin";
std::array<std::string,3> as={"Alpha", "Beta", "Gamma"};
MyTensor x(as, 2,3,4);
MyTensor x(as, 2,1,4);
DebugShowTensor(x, "x");
x.WriteTemporary(pszTestFileName);
// Test initialisation of an array of strings
@ -308,7 +308,8 @@ bool DebugEigenTest()
for( auto a : p.IndexNames )
std::cout << a << std::endl;
// Now see whether we can read a tensor back
MyTensor y(as, 2,3,4);
std::array<std::string,3> a2={"Alpha", "Delta", "Gamma"};
MyTensor y(a2, 2,1,4);
y.ReadTemporary(pszTestFileName);
DebugShowTensor(y, "y");
return true;