pretty formatting of Sn table

This commit is contained in:
Jiri Pittner 2021-06-09 11:22:04 +02:00
parent d3215e46fd
commit 74835e5264
2 changed files with 27 additions and 10 deletions

View File

@ -1371,7 +1371,7 @@ static T _antparity;
template <typename T>
void symetr(T ilin, T iel)
static void symetr(T ilin, T iel)
{
if(ilin > (*_tyou_cols<T>)[1])
@ -1398,7 +1398,7 @@ else
template <typename T>
void antisym(T icol,T iel)
static void antisym(T icol,T iel)
{
if(icol > (*_tyou_rows<T>)[1])
@ -1569,13 +1569,30 @@ return true;
template <typename T>
std::ostream & operator<<(std::ostream &s, const Sn_characters<T> &c)
{
//@@@improve formatting
s<<"S"<<c.n<<" "<<c.classsizes;
for(int i=1; i<=c.classes.size(); ++i) s<<"("<<c.classes[i]<<") "; s<<std::endl;
const int w=4+c.n; //some reasonable width
s<<"S"<<c.n<<" "<<c.classes.size()<<std::endl;
s.width(w); s<<" ";
for(int i=1; i<=c.classes.size(); ++i)
{
s.width(w);
s<<c.classsizes[i]<<" ";
}
s<<std::endl;
s.width(w); s<<" ";
for(int i=1; i<=c.classes.size(); ++i)
{
std::ostringstream classlabel;
classlabel<<"("<<c.classes[i]<<")";
s.width(w);
s<<classlabel.str()<<" ";
}
s<<std::endl;
for(int i=1; i<=c.chi.nrows(); ++i)
{
s<<"["<<c.irreps[i]<<"] ";
for(int j=1; j<=c.chi.ncols(); ++j) s<<c.chi(i,j)<<" ";
std::ostringstream irrep;
irrep<<"["<<c.irreps[i]<<"] ";
s.width(w); s<<irrep.str();
for(int j=1; j<=c.chi.ncols(); ++j) {s.width(w); s<<c.chi(i,j)<<" ";}
s<<std::endl;
}

6
t.cc
View File

@ -2146,19 +2146,19 @@ int tot=p.generate_all_lex(printme);
cout <<"generated "<<tot<<endl;
}
if(1)
if(0)
{
int n;
cin >>n >>unitary_n;
Partition<int> p(n);
space_dim=0;
int tot=p.generate_all(pprintme,0);
cout <<"generated "<<tot<<endl;
cout <<"partitions generated "<<tot<<endl;
if(tot!=partitions(n)) laerror("internal error in partition generation or enumerations");
if(space_dim!=longpow(unitary_n,n)) {cout<<space_dim<<" "<<ipow(unitary_n,n)<<endl;laerror("integer overflow or internal error in space dimensions");}
}
if(0)
if(1)
{
int n;
cin >>n ;