tensor: subtensor1()
This commit is contained in:
22
t.cc
22
t.cc
@@ -1084,7 +1084,7 @@ NRMat<complex<double> > b=exp(a);
|
||||
cout <<b;
|
||||
}
|
||||
|
||||
if(1)
|
||||
if(0)
|
||||
{
|
||||
int n;
|
||||
double d;
|
||||
@@ -4746,5 +4746,25 @@ cout <<aa;
|
||||
cout <<"Error = "<<(ax-aa).norm()<<endl;
|
||||
}
|
||||
|
||||
if(1)
|
||||
{
|
||||
int n=3;
|
||||
NRVec<INDEXGROUP> s(4);
|
||||
for(int i=0; i<4; ++i)
|
||||
{
|
||||
s[i].number=1;
|
||||
s[i].symmetry=0;
|
||||
s[i].offset=0;
|
||||
s[i].range=n;
|
||||
}
|
||||
Tensor<double> t(s);
|
||||
t.randomize(1.);
|
||||
INDEXNAME list[4]={"i","j","k","l"};
|
||||
t.names=list;
|
||||
cout <<t;
|
||||
Tensor<double> t1 = t.subtensor1(2);
|
||||
cout <<t1;
|
||||
}
|
||||
|
||||
|
||||
}//main
|
||||
|
||||
Reference in New Issue
Block a user