started implementation of tensor index names

This commit is contained in:
2025-11-04 17:00:11 +01:00
parent 8ee8cb16e8
commit 7941b7a7e2
3 changed files with 81 additions and 17 deletions

4
t.cc
View File

@@ -3893,6 +3893,9 @@ INDEXGROUP shape;
}
Tensor<double> t(shape);
t.clear();
INDEXNAME list[3]={"i1","i2","i3"};
t.names=list;
//t.names= {"i1","i2","i3"}; does not compile
for(int i=0; i<n; ++i)
for(int j=0; j<n; ++j)
for(int k=0; k<n; ++k)
@@ -3909,6 +3912,7 @@ for(int k=0; k<n; ++k)
cout <<(t2(i,j,k)+t2(j,k,i)+t2(k,i,j)-t2(j,i,k)-t2(i,k,j)-t2(k,j,i))-6*t(i,j,k)<<endl;
}
cout<<t2;
}