1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Test nested std::vector<grid tensor>

This commit is contained in:
Michael Marshall 2021-06-08 00:05:35 +01:00
parent 33d2df46a0
commit 0c4f585496

View File

@ -48,8 +48,9 @@ public:
std::vector<double>, array, std::vector<double>, array,
std::vector<std::vector<double> >, twodimarray, std::vector<std::vector<double> >, twodimarray,
std::vector<std::vector<std::vector<std::complex<double>> > >, cmplx3darray, std::vector<std::vector<std::vector<std::complex<double>> > >, cmplx3darray,
SpinColourMatrix, scm,
std::vector<std::vector<std::vector<int> > >, ragged, std::vector<std::vector<std::vector<int> > >, ragged,
SpinColourMatrix, scm std::vector<std::vector<SpinColourMatrix> >, vscm
); );
myclass() {} myclass() {}
myclass(int i) myclass(int i)
@ -60,6 +61,7 @@ public:
, ragged( {{{i+1},{i+2,i+3}}, // ragged , ragged( {{{i+1},{i+2,i+3}}, // ragged
{{i+4,i+5,i+6,i+7},{i+8,i+9,i+10,i+11},{i+12,i+13,i+14,i+15}}, // block {{i+4,i+5,i+6,i+7},{i+8,i+9,i+10,i+11},{i+12,i+13,i+14,i+15}}, // block
{{i+16,i+17},{i+18,i+19,i+20}}} ) //ragged {{i+16,i+17},{i+18,i+19,i+20}}} ) //ragged
, vscm(3, std::vector<SpinColourMatrix>(5))
{ {
e=myenum::red; e=myenum::red;
x=i; x=i;
@ -72,6 +74,13 @@ public:
scm()(0, 2)(1, 1) = 6.336; scm()(0, 2)(1, 1) = 6.336;
scm()(2, 1)(2, 2) = 7.344; scm()(2, 1)(2, 2) = 7.344;
scm()(1, 1)(2, 0) = 8.3534; scm()(1, 1)(2, 0) = 8.3534;
int Counter = i;
for( auto & v : vscm ) {
for( auto & j : v ) {
j = std::complex<double>(Counter, -Counter);
Counter++;
}
}
} }
}; };