52 virtual unsigned int row_size(
unsigned int row)
const=0;
53 virtual unsigned int column_size(
unsigned int col)
const;
54 virtual void add_box(
unsigned int row)=0;
57 virtual void clear()=0;
62 unsigned long hook_length(
unsigned int row,
unsigned int col)
const;
70 virtual unsigned int row_size(
unsigned int row)
const;
71 virtual void add_box(
unsigned int row);
90 virtual unsigned int row_size(
unsigned int row)
const;
91 virtual void add_box(
unsigned int row);
93 std::pair<int, int>
find(
const T&)
const;
98 T&
operator()(
unsigned int row,
unsigned int col);
99 const T&
operator()(
unsigned int row,
unsigned int col)
const;
100 const T&
operator[](
unsigned int boxnum)
const;
101 void add_box(
unsigned int rownum, T val);
112 template<
class StrictWeakOrdering>
void sort_columns(StrictWeakOrdering comp);
113 template<
class StrictWeakOrdering>
void canonicalise(StrictWeakOrdering comp,
bool only_col_ex=
false);
190 template<
class OutputIterator>
191 OutputIterator
Garnir_set(OutputIterator,
unsigned int,
unsigned int)
const;
217 bool legal_box(
const std::vector<std::pair<int,int> >& prev,
218 const std::vector<std::pair<int,int> >& ths,
219 int colpos,
int trypos);
233 typename tableau_container_t::iterator it=storage.begin();
234 while(it!=storage.end()) {
235 if(it->has_nullifying_trace())
236 it=storage.erase(it);
279 return (rows==other.
rows);
315 for(
unsigned int ir=0; ir<rows.size(); ++ir) {
316 for(
unsigned int ic=0; ic<rows[ir].size(); ++ic) {
317 if(rows[ir][ic]==obj)
318 return std::pair<int,int>(ir, ic);
321 return std::pair<int,int>(-1,-1);
328 sort_within_columns(comp);
346 template<
class StrictWeakOrdering>
350 if(number_of_rows()==0)
return;
351 for(
unsigned int c=0; c<row_size(0); ++c) {
352 std::sort(begin_column(c), end_column(c), comp);
358 template<
class StrictWeakOrdering>
361 for(
unsigned int c1=0; c1<row_size(0); ++c1) {
362 for(
unsigned int c2=c1; c2<row_size(0); ++c2) {
363 if(column_size(c1)==column_size(c2)) {
364 if(comp((*
this)(0,c2), (*
this)(0,c1)))
372 template<
class StrictWeakOrdering>
376 sort_within_columns(comp);
385 : tab(t), column_number(c), row_number(r)
414 return (*tab)(row_number,column_number);
420 return &((*tab)(row_number,column_number));
506 return !((*this)==other);
514 : tab(t), column_number(c), row_number(r)
543 return (*tab)(row_number,column_number);
549 return &((*tab)(row_number,column_number));
555 if(++column_number==tab->rows[row_number].size()) {
566 if(++column_number==tab->rows[row_number]) {
578 if(column_number==0) {
580 column_number=tab->rows[row_number].size()-1;
582 else --column_number;
590 if(column_number==0) {
592 column_number=tab->rows[row_number].size()-1;
594 else --column_number;
603 if(++column_number==tab->rows[row_number]) {
616 if(column_number==0) {
618 column_number=tab->rows[row_number].size()-1;
620 else --column_number;
651 return !((*this)==other);
692 template<
class OutputIterator>
696 unsigned int r=row, c=col;
723 for(
unsigned int c=0; c<
row_size(r)-1; ++c) {
724 if((*
this)(r,c) > (*
this)(r,c+1) )
725 return std::pair<int, int>(r,c);
728 return std::pair<int,int>(-1,-1);
734 bool already_standard=
true;
736 typename tableau_container_t::iterator thetab=storage.begin();
737 while(thetab!=storage.end()) {
738 (*thetab).sort_within_columns();
739 std::pair<int,int> where=(*thetab).nonstandard_loc();
740 if(where.first!=-1) {
741 already_standard=
false;
743 for(
unsigned int i1=where.first; i1<(*thetab).column_size(where.second); ++i1)
744 com.
original.push_back((*thetab)(i1,where.second));
745 for(
unsigned int i1=0; i1<=(
unsigned int)(where.first); ++i1)
746 com.
original.push_back((*thetab)(i1,where.second+1));
747 com.
sublengths.push_back((*thetab).column_size(where.second)-where.first);
750 for(
unsigned int tabi=1; tabi<com.
size(); ++tabi) {
752 unsigned int offset=0;
753 for(
unsigned int i1=where.first; i1<(*thetab).column_size(where.second); ++i1, ++offset)
754 ntab(i1,where.second)=com[tabi][offset];
755 for(
unsigned int i1=0; i1<=(
unsigned int)(where.first); ++i1, ++offset)
756 ntab(i1,where.second+1)=com[tabi][offset];
757 ntab.multiplicity*=-1*com.
ordersign(tabi);
760 thetab=storage.erase(thetab);
764 return already_standard;
770 typename tableau_container_t::iterator it=storage.begin();
771 while(it!=storage.end()) {
772 if((*it).compare_without_multiplicity(ntab)) {
773 (*it).multiplicity+=ntab.multiplicity;
774 if((*it).multiplicity==0)
780 storage.push_back(ntab);
796 for(
unsigned int c=0; c<
row_size(r); ++c)
799 unsigned int offset=0;
806 for(
unsigned int c=0; c<
row_size(r); ++c)
812 if(modulo_monoterm) {
814 for(
unsigned int c=0; c<
row_size(0); ++c)
816 for(
unsigned int i=0; i<sym.
size(); ++i)
821 for(
unsigned int c=0; c<
row_size(0); ++c) {
840 for(
unsigned int c=0; c<
row_size(r); ++c)
843 unsigned int offset=0;
850 for(
unsigned int c=0; c<
row_size(r); ++c)
856 for(
unsigned int c=0; c<
row_size(0); ++c) {
924 typename tableau_container_t::const_iterator it=storage.begin();
925 while(it!=storage.end()) {
926 totdim+=(*it).dimension(dim);
932 template<
class T,
class OutputIterator>
934 OutputIterator out,
bool alltabs=
false)
937 while(it!=tabs1.
storage.end()) {
938 LR_tensor((*it), tab2, maxrows, out, alltabs);
943 template<
class T1,
class T2>
945 const T2& tab2,
unsigned int row2,
unsigned int col2)
947 tab1.add_box(row1, tab2(row2,col2));
952 const tableau& tab2,
unsigned int row2,
unsigned int col2)
959 template<
class Tab,
class OutputIterator>
961 unsigned int currow2,
unsigned int curcol2,
unsigned int startrow,
962 unsigned int maxrows,
963 OutputIterator outit,
968 if((++curcol2)==tab2.row_size(currow2)) {
970 if((++currow2)==tab2.number_of_rows()) {
979 for(
unsigned int rowpos=startrow; rowpos<std::min(newtab.number_of_rows()+1,maxrows); ++rowpos) {
981 if(rowpos>0 && rowpos<newtab.number_of_rows())
982 if(newtab.row_size(rowpos-1)==newtab.row_size(rowpos))
986 unsigned int colpos=(rowpos==newtab.number_of_rows())?0:newtab.row_size(rowpos);
989 for(
unsigned int rr=0; rr<rowpos; ++rr)
990 if(Ycurrent(rr,colpos).first==(
int)(currow2))
995 for(
unsigned int cc=0; cc<colpos; ++cc)
996 if(Ycurrent(rowpos,cc).second==(
int)(curcol2))
1000 if(!alltabs && currow2>0) {
1001 int numi=0, numimin1=0;
1003 for(
unsigned int sr=0; sr<rowpos; ++sr)
1004 for(
unsigned int sc=0; sc<Ycurrent.
row_size(sr); ++sc) {
1006 if(Ycurrent(sr,sc).first==(int)(currow2)) ++numi;
1007 if(Ycurrent(sr,sc).first==(int)(currow2)-1) ++numimin1;
1016 for(
int sc=Ycurrent.
row_size(sr)-1; sc>=0; --sc) {
1017 if(Ycurrent(sr,sc).first==(int)(currow2)) ++numi;
1018 if(Ycurrent(sr,sc).first==(int)(currow2)-1) ++numimin1;
1026 Ycurrent.
add_box(rowpos, std::pair<int,int>(currow2, curcol2));
1027 add_box(newtab, rowpos, tab2, currow2, curcol2);
1028 LR_add_box(tab2, newtab, currow2, curcol2, alltabs?0:rowpos, maxrows,
1029 outit, Ycurrent, alltabs);
1032 newtab.remove_box(rowpos);
1039 template<
class Tab,
class OutputIterator>
1040 void LR_tensor(
const Tab& tab1,
const Tab& tab2,
unsigned int maxrows,
1041 OutputIterator outit,
bool alltabs=
false)
1054 while(yi!=Ycurrent.
end()) {
1055 (*yi)=std::pair<int,int>(-2,-2);
1059 LR_add_box(tab2, newtab, 0, -1, 0, maxrows, outit, Ycurrent, alltabs);
1062 template<
class T,
class OutputIterator>
1070 std::ostream&
operator<<(std::ostream&,
const tableau& );
1073 std::ostream& operator<<(std::ostream&, const tableaux<T>& );
1076 std::ostream& operator<<(std::ostream&, const filled_tableau<T>& );
1087 assert(num<
rows.size());
1088 return rows[num].size();
1094 assert(row<
rows.size());
1095 assert(col<
rows[row].size());
1096 return rows[row][col];
1102 assert(row<
rows.size());
1103 assert(col<
rows[row].size());
1104 return rows[row][col];
1111 assert(this->row<
rows.size());
1112 assert(this->col<
rows[this->row].size());
1113 return rows[this->row][this->col];
1124 if(rownum>=
rows.size())
1125 rows.resize(rownum+1);
1126 assert(rownum<
rows.size());
1127 rows[rownum].push_back(T());
1133 if(rownum>=
rows.size())
1134 rows.resize(rownum+1);
1135 assert(rownum<
rows.size());
1136 rows[rownum].push_back(val);
1145 T tmp=(*this)(r,c1);
1146 (*this)(r,c1)=(*
this)(r,c2);
1154 assert(rownum<
rows.size());
1155 assert(
rows[rownum].size()>0);
1156 rows[rownum].pop_back();
1157 if(
rows[rownum].size()==0)
1169 std::ostream& operator<<(std::ostream& str, const tableaux<T>& tabs)
1172 while(it!=tabs.
storage.end()) {
1173 str << (*it) << std::endl << std::endl;
1180 std::ostream& operator<<(std::ostream& str, const filled_tableau<T>& tab)
1182 for(
unsigned int i=0; i<tab.number_of_rows(); ++i) {
1183 for(
unsigned int j=0; j<tab.row_size(i); ++j) {
1188 str <<
" " << tab.dimension(10);
1189 if(tab.has_nullifying_trace()) str <<
" null";
1191 if(i!=tab.number_of_rows()-1)
1194 str <<
" (" << tab.multiplicity <<
")" << std::endl;
const T & operator[](unsigned int boxnum) const
Definition: YoungTab.hh:1108
in_column_iterator(unsigned int r, unsigned int c, filled_tableau< T > *)
Definition: YoungTab.hh:384
std::vector< int > rows
Definition: YoungTab.hh:77
An iterator over all boxes of a tableau, left to right, top to bottom.
Definition: YoungTab.hh:159
bool compare_without_multiplicity(const filled_tableau< T > &other) const
Definition: YoungTab.hh:277
T & operator*() const
Definition: YoungTab.hh:541
T * operator->() const
Definition: YoungTab.hh:547
std::pair< int, int > nonstandard_loc() const
Definition: YoungTab.hh:717
bool operator==(const iterator &) const
Definition: YoungTab.hh:627
range_vector_t sublengths_scattered
Definition: Combinatorics.hh:167
virtual unsigned int row_size(unsigned int row) const
Definition: YoungTab.hh:1085
virtual unsigned int number_of_rows() const
Definition: YoungTab.hh:1079
virtual unsigned int number_of_rows() const
Definition: YoungTab.cc:110
unsigned int column_number
Definition: YoungTab.hh:155
std::vector< T > box_row
Definition: YoungTab.hh:193
unsigned int row_number
Definition: YoungTab.hh:155
unsigned long hook_length(unsigned int row, unsigned int col) const
Definition: YoungTab.cc:72
std::list< T > tableau_container_t
Definition: YoungTab.hh:209
bool has_nullifying_trace() const
Definition: YoungTab.hh:283
in_column_iterator & operator++()
Definition: YoungTab.hh:424
mpq_class yngrat_t
Definition: YoungTab.hh:39
yngrat_t projector_normalisation() const
Definition: YoungTab.hh:785
An iterator which stays inside a given column of a tableau.
Definition: YoungTab.hh:131
ptrdiff_t difference_type
Definition: YoungTab.hh:126
T & operator()(unsigned int row, unsigned int col)
Definition: YoungTab.hh:1092
in_column_iterator & operator--()
Definition: YoungTab.hh:438
Definition: Combinatorics.hh:125
virtual void add_box(unsigned int row)=0
Definition: YoungTab.hh:81
bool operator!=(const iterator &) const
Definition: YoungTab.hh:649
int permutation_sign
Definition: Combinatorics.hh:163
void copy_shape(const tableau &)
Definition: YoungTab.hh:267
void sort_columns()
Definition: YoungTab.hh:332
bool legal_box(const std::vector< std::pair< int, int > > &prev, const std::vector< std::pair< int, int > > &ths, int colpos, int trypos)
yngint_t total_dimension(unsigned int dim)
Definition: YoungTab.hh:921
in_column_iterator operator-(unsigned int)
virtual unsigned int row_size(unsigned int row) const
Definition: YoungTab.cc:115
virtual void clear()
Definition: YoungTab.hh:1162
virtual void add_box(unsigned int row)
Definition: YoungTab.hh:1122
unsigned long factorial(unsigned int x)
Definition: Combinatorics.cc:23
virtual void add_row(unsigned int row_size)
Definition: YoungTab.cc:39
unsigned int block_length
Definition: Combinatorics.hh:160
OutputIterator Garnir_set(OutputIterator, unsigned int, unsigned int) const
Definition: YoungTab.hh:693
unsigned int row_number
Definition: YoungTab.hh:181
iterator & operator--()
Definition: YoungTab.hh:576
tableau_base()
Definition: YoungTab.cc:26
std::vector< unsigned int > permute_blocks
Definition: Combinatorics.hh:161
virtual void add_box(unsigned int row)
Definition: YoungTab.cc:91
bool standard_form()
Put the set of tableaux into standard form by using Garnir symmetries.
Definition: YoungTab.hh:732
int ordersign(unsigned int) const
Definition: Combinatorics.hh:456
tableau_container_t storage
Definition: YoungTab.hh:210
virtual unsigned int row_size(unsigned int row) const =0
T value_type
Definition: YoungTab.hh:122
void permute(long start=-1, long end=-1)
Definition: Combinatorics.hh:349
filled_tableau< T > * tab
Definition: YoungTab.hh:154
std::ostream & operator<<(std::ostream &str, const tableau &tab)
Definition: YoungTab.cc:132
int selfdual_column
Definition: YoungTab.hh:60
unsigned int size() const
Definition: Combinatorics.hh:427
T * operator->() const
Definition: YoungTab.hh:418
iterator operator+(unsigned int)
Definition: YoungTab.hh:519
bool operator<(const in_column_iterator &other) const
Definition: YoungTab.hh:490
void symmetrise(const T &tabsym)
Definition: YoungTab.hh:242
iterator & operator++()
Definition: YoungTab.hh:553
std::vector< T > value_permute
Definition: Combinatorics.hh:162
Definition: YoungTab.hh:66
unsigned int column_number
Definition: YoungTab.hh:181
std::vector< unsigned int > sublengths
Definition: Combinatorics.hh:74
iterator end() const
Definition: YoungTab.hh:664
void remove_nullifying_traces()
Definition: YoungTab.hh:231
yngint_t hook_length_prod() const
Definition: YoungTab.cc:82
Definition: YoungTab.hh:84
Definition: YoungTab.hh:120
virtual void clear()
Definition: YoungTab.cc:121
bool operator<(const iterator &other) const
Definition: YoungTab.hh:635
std::pair< int, int > find(const T &) const
Definition: YoungTab.hh:313
T * pointer
Definition: YoungTab.hh:123
T & operator*() const
Definition: YoungTab.hh:412
bool operator!=(const in_column_iterator &) const
Definition: YoungTab.hh:504
void sort_within_columns()
Definition: YoungTab.hh:325
std::vector< T > original
Definition: Combinatorics.hh:159
row_stack rows
Definition: YoungTab.hh:195
virtual ~tableau()
Definition: YoungTab.cc:35
iterator & operator-=(unsigned int)
Definition: YoungTab.hh:613
virtual void remove_box(unsigned int row)
Definition: YoungTab.cc:102
tableau & operator=(const tableau &)
Definition: YoungTab.cc:126
T & reference
Definition: YoungTab.hh:124
in_column_iterator operator+(unsigned int)
Definition: YoungTab.hh:390
yngint_t dimension(unsigned int) const
Definition: YoungTab.cc:47
filled_tableau< T > & operator=(const filled_tableau< T > &)
Definition: YoungTab.hh:913
in_column_iterator & operator-=(unsigned int)
Definition: YoungTab.hh:461
virtual unsigned int number_of_rows() const =0
mpz_class yngint_t
Definition: YoungTab.hh:38
bool operator==(const in_column_iterator &) const
Definition: YoungTab.hh:468
std::vector< box_row > row_stack
Definition: YoungTab.hh:194
void apply_symmetry(long start=-1, long end=-1)
Definition: Combinatorics.hh:693
iterator operator-(unsigned int)
in_column_iterator & operator+=(unsigned int)
Definition: YoungTab.hh:431
void projector(combin::symmetriser< T > &, bool modulo_monoterm=false) const
Definition: YoungTab.hh:793
std::vector< T > original
Definition: Combinatorics.hh:76
bool operator>=(const in_column_iterator &other) const
Definition: YoungTab.hh:483
std::random_access_iterator_tag iterator_category
Definition: YoungTab.hh:127
unsigned int size() const
Definition: Combinatorics.hh:904
virtual ~filled_tableau()
Definition: YoungTab.hh:1117
void swap_columns(unsigned int c1, unsigned int c2)
Definition: YoungTab.hh:1140
Definition: YoungTab.hh:47
void set_multiplicity(unsigned int pos, int val)
Definition: Combinatorics.hh:1001
bool operator>(const iterator &other) const
Definition: YoungTab.hh:642
yngrat_t multiplicity
Definition: YoungTab.hh:59
int signature(unsigned int) const
Definition: Combinatorics.hh:994
size_t size_type
Definition: YoungTab.hh:125
Definition: Combinatorics.hh:101
std::vector< range_t > range_vector_t
Definition: Combinatorics.hh:40
void canonicalise()
Sort equal-length columns and sort within columns.
Definition: YoungTab.hh:339
void add_tableau(const T &)
Definition: YoungTab.hh:768
back_insert_iterator get_back_insert_iterator()
Definition: YoungTab.hh:225
virtual void remove_box(unsigned int row)
Definition: YoungTab.hh:1152
virtual unsigned int column_size(unsigned int col) const
Definition: YoungTab.cc:61
bool operator<=(const in_column_iterator &other) const
Definition: YoungTab.hh:476
virtual ~tableau_base()
Definition: YoungTab.cc:31
in_column_iterator begin_column(unsigned int column_number)
Definition: YoungTab.hh:670
filled_tableau< T > * tab
Definition: YoungTab.hh:180
bool operator>(const in_column_iterator &other) const
Definition: YoungTab.hh:497
void LR_add_box(const Tab &tab2, Tab &newtab, unsigned int currow2, unsigned int curcol2, unsigned int startrow, unsigned int maxrows, OutputIterator outit, keeptrack_tab_t &Ycurrent, bool alltabs)
Definition: YoungTab.hh:960
std::back_insert_iterator< tableau_container_t > back_insert_iterator
Definition: YoungTab.hh:212
iterator(unsigned int r, unsigned int c, filled_tableau< T > *)
Definition: YoungTab.hh:513
void LR_tensor(const tableaux< T > &tabs1, const T &tab2, unsigned int maxrows, OutputIterator out, bool alltabs=false)
Definition: YoungTab.hh:933
int ordersign(iterator1 b1, iterator1 e1, iterator2 b2, iterator2 e2, int stepsize=1)
Definition: Combinatorics.hh:224
in_column_iterator end_column(unsigned int column_number)
Definition: YoungTab.hh:679
T value_type
Definition: YoungTab.hh:86
iterator & operator+=(unsigned int)
Definition: YoungTab.hh:563
filled_tableau< std::pair< int, int > > keeptrack_tab_t
Definition: YoungTab.hh:957
range_vector_t input_asym
Definition: Combinatorics.hh:166
virtual void remove_box(unsigned int row)=0
iterator begin() const
Definition: YoungTab.hh:658