pretty formatting of Sn table
This commit is contained in:
		
							parent
							
								
									d3215e46fd
								
							
						
					
					
						commit
						74835e5264
					
				@ -1371,7 +1371,7 @@ static T _antparity;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
template <typename T>
 | 
					template <typename T>
 | 
				
			||||||
void symetr(T ilin, T iel)
 | 
					static void symetr(T ilin, T iel)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(ilin > (*_tyou_cols<T>)[1])
 | 
					if(ilin > (*_tyou_cols<T>)[1])
 | 
				
			||||||
@ -1398,7 +1398,7 @@ else
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
template <typename T>
 | 
					template <typename T>
 | 
				
			||||||
void antisym(T icol,T iel)
 | 
					static void antisym(T icol,T iel)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(icol > (*_tyou_rows<T>)[1])
 | 
					if(icol > (*_tyou_rows<T>)[1])
 | 
				
			||||||
@ -1569,13 +1569,30 @@ return true;
 | 
				
			|||||||
template <typename T>
 | 
					template <typename T>
 | 
				
			||||||
std::ostream & operator<<(std::ostream &s, const Sn_characters<T> &c)
 | 
					std::ostream & operator<<(std::ostream &s, const Sn_characters<T> &c)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
//@@@improve formatting
 | 
					const int w=4+c.n; //some reasonable width
 | 
				
			||||||
s<<"S"<<c.n<<" "<<c.classsizes;
 | 
					s<<"S"<<c.n<<" "<<c.classes.size()<<std::endl;
 | 
				
			||||||
for(int i=1; i<=c.classes.size(); ++i) s<<"("<<c.classes[i]<<") "; s<<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)
 | 
					for(int i=1; i<=c.chi.nrows(); ++i)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
	s<<"["<<c.irreps[i]<<"] ";
 | 
						std::ostringstream irrep;
 | 
				
			||||||
	for(int j=1; j<=c.chi.ncols(); ++j) s<<c.chi(i,j)<<" ";
 | 
						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;
 | 
						s<<std::endl;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								t.cc
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								t.cc
									
									
									
									
									
								
							@ -2146,19 +2146,19 @@ int tot=p.generate_all_lex(printme);
 | 
				
			|||||||
cout <<"generated "<<tot<<endl;
 | 
					cout <<"generated "<<tot<<endl;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(1)
 | 
					if(0)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
int n;
 | 
					int n;
 | 
				
			||||||
cin >>n >>unitary_n;
 | 
					cin >>n >>unitary_n;
 | 
				
			||||||
Partition<int> p(n);
 | 
					Partition<int> p(n);
 | 
				
			||||||
space_dim=0;
 | 
					space_dim=0;
 | 
				
			||||||
int tot=p.generate_all(pprintme,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(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(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;
 | 
					int n;
 | 
				
			||||||
cin >>n ;
 | 
					cin >>n ;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user