template //看不懂
void array::print(void)
{
if(dim_3==1)
{
int i,j,k;
bool threeD = (dim_2==1?false:true);
for (k = 0; k< dim_2; k++)
{
if (threeD)
cout<<endl<<"ans(:,:,"<<k+1<<") = "<<endl;
for(i=0; i<dim_0; i++)
{
for(j=0; j<dim_1; j++)
{
if((*this)(i,j,k)*(*this)(i,j,k)<1e-12)
{
cout << " 0 ";
}
else
{
cout << " " << (*this)(i,j,k) << " ";
}
}
cout << endl;
}
if (threeD)
cout<<endl;
}
}
else
{
cout << "ERROR: Can only print an array of dimension three or less ...." << endl;
}
}