1 /* pps.c */
2 /* plethysm p_I[S_J] in the basis of schur function */
3 
4 #include "def.h"
5 #include "macro.h"
6 
7 
8 
pps_ende()9 INT pps_ende()
10 {
11     INT erg = OK;
12     ENDR("pps_ende");
13 }
14 
15 extern INT pps_integer_partition_();
16 extern INT pps_integer_hashtable_();
17 extern INT pps_integer_integer_();
18 extern INT pps___();
19 extern INT tsm___faktor();
20 
pps_null__(b,c,f)21 INT pps_null__(b,c,f) OP b,c,f;
22 {
23     INT mxx_null__();
24     return mxx_null__(b,c,f);
25 }
26 
pps_integer__(a,b,c,f)27 INT pps_integer__(a,b,c,f) OP a,b,c; OP f;
28 /* AK 051201 */
29 {
30     INT erg = OK;
31     OP ff,p,z;
32     INT i;
33     INT mms_hashtable__(), tsm___faktor();
34 
35     CTO(INTEGER,"pps_integer__(1)",a);
36     CTTTTO(INTEGER,HASHTABLE,PARTITION,SCHUR,"pps_integer__(2)",b);
37     CTTO(HASHTABLE,SCHUR,"pps_integer__(3)",c);
38     SYMCHECK((S_I_I(a) < 0),"pps_integer__:integer < 0");
39     if (S_I_I(a) == 0)
40         {
41         erg += pps_null__(b,c,f);
42         goto ende;
43         }
44 
45     ff = CALLOCOBJECT();
46     erg += init_hashtable(ff);
47     tsm___faktor(b,ff,f);
48     FORALL(z,ff,{
49         for (i=0;i<S_PA_LI(S_MO_S(z));i++)
50             M_I_I(S_I_I(a)*S_PA_II(S_MO_S(z),i), S_PA_I(S_MO_S(z),i));
51         });
52     p = CALLOCOBJECT();
53     first_partition(cons_null,p);
54     mms_hashtable__(ff,p,c,cons_eins);
55 
56     FREEALL(p);
57     FREEALL(ff);
58 ende:
59     CTTO(HASHTABLE,SCHUR,"pps_integer__(3-end)",c);
60     ENDR("pps_integer__");
61 }
62 
63 INT pps_null_partition_();
64 
pps_partition__(a,b,c,f)65 INT pps_partition__(a,b,c,f) OP a,b,c; OP f;
66 {
67     INT erg = OK;
68     CTO(PARTITION,"pps_partition__(1)",a);
69     CTTTO(HASHTABLE,SCHUR,PARTITION,"pps_partition__(2)",b);
70     CTTO(HASHTABLE,SCHUR,"pps_partition__(3)",c);
71 
72     if (S_PA_LI(a) == 0) {
73         erg += pps_null__(b,c,f);
74         }
75     else if (S_PA_LI(a) == 1) {
76         erg += pps_integer__(S_PA_I(a,0),b,c,f);
77         }
78     else{
79         INT mss_hashtable_hashtable_();
80         INT p_splitpart();
81         erg += p_splitpart(a,b,c,f,pps_partition__,
82                                    mss_hashtable_hashtable_);
83         }
84     CTTO(HASHTABLE,SCHUR,"pps_partition__(3-end)",c);
85     ENDR("pps_partition__");
86 }
87 
88 
89 
pps_powsym__(a,b,c,f)90 INT pps_powsym__(a,b,c,f) OP a,b,c,f;
91 /* AK 051201 */
92 /* c += p_a [s_b]  \times f */
93 {
94     INT erg = OK;
95     CTO(POWSYM,"pps_powsym__(1)",a);
96     CTTTO(HASHTABLE,PARTITION,SCHUR,"pps_powsym__(2)",b);
97     CTTO(HASHTABLE,SCHUR,"pps_powsym__(3)",c);
98     M_FORALL_MONOMIALS_IN_A(a,b,c,f,pps_partition__);
99     ENDR("pps_powsym__");
100 }
101 
pps_hashtable__(a,b,c,f)102 INT pps_hashtable__(a,b,c,f) OP a,b,c,f;
103 /* AK 051201 */
104 /* c += p_a [s_b]  \times f */
105 {
106     INT erg = OK;
107     CTO(HASHTABLE,"pps_hashtable__(1)",a);
108     CTTTO(HASHTABLE,PARTITION,SCHUR,"pps_hashtable__(2)",b);
109     CTTO(HASHTABLE,SCHUR,"pps_hashtable__(3)",c);
110     M_FORALL_MONOMIALS_IN_A(a,b,c,f,pps_partition__);
111     ENDR("pps_hashtable__");
112 }
113 
pps_hashtable_hashtable_(a,b,c,f)114 INT pps_hashtable_hashtable_(a,b,c,f) OP a,b,c,f;
115 /* AK 051201 */
116 /* c += p_a [s_b]  \times f */
117 {
118     INT erg = OK;
119     CTO(HASHTABLE,"pps_hashtable_hashtable_(1)",a);
120     CTO(HASHTABLE,"pps_hashtable_hashtable_(2)",b);
121     CTTO(HASHTABLE,SCHUR,"pps_hashtable_hashtable_(3)",c);
122     NYI("pps_hashtable_hashtable_");
123     ENDR("pps_hashtable_hashtable_");
124 }
125 
pps_null_partition_(b,c,f)126 INT pps_null_partition_(b,c,f) OP b,c,f;
127 /* AK 061201 */
128 {
129     INT erg = OK;
130     CTO(PARTITION,"pps_null_partition(1)",b);
131     CTTO(SCHUR,HASHTABLE,"pps_null_partition(2)",c);
132     _NULL_PARTITION_(b,c,f);
133     ENDR("pps_null_partition");
134 }
135 
plet_powsym_schur(a,b,c)136 INT plet_powsym_schur(a,b,c) OP a,b,c;
137 /* AK 051201
138 */
139 {
140     INT erg = OK;
141     INT t=0; /* is 1 if transfer HASHTABLE->POWSYM necessary */
142     CTTTTO(HASHTABLE,INTEGER,PARTITION,POWSYM,"plet_powsym_schur(1)",a);
143     CTTTTO(INTEGER,HASHTABLE,PARTITION,SCHUR,"plet_powsym_schur(2)",b);
144     CTTTO(EMPTY,HASHTABLE,SCHUR,"plet_powsym_schur(3)",c);
145 
146     if (S_O_K(c) == EMPTY)
147         { t=1; init_hashtable(c); }
148 
149     pps___(a,b,c,cons_eins);
150     if (t==1) t_HASHTABLE_SCHUR(c,c);
151     ENDR("plet_powsym_schur");
152 }
153 
pps___(a,b,c,f)154 INT pps___(a,b,c,f) OP a,b,c,f;
155 {
156     INT erg = OK;
157     CTTTTO(HASHTABLE,INTEGER,PARTITION,POWSYM,"pps___(1)",a);
158     CTTTTO(INTEGER,HASHTABLE,PARTITION,SCHUR,"pps___(2)",b);
159     CTTO(HASHTABLE,SCHUR,"pps___(3)",c);
160     if (S_O_K(b) == INTEGER) /* AK 090703 */
161         {
162         OP d = CALLOCOBJECT();
163         erg += m_i_pa(b,d);
164         erg += pps___(a,d,c,f);
165         FREEALL(d);
166         }
167     else if (S_O_K(a) == INTEGER)
168         {
169         erg += pps_integer__(a,b,c,f);
170         }
171     else if (S_O_K(a) == PARTITION)
172         {
173         erg += pps_partition__(a,b,c,f);
174         }
175     else if (S_O_K(a) == POWSYM)
176         {
177         erg += pps_powsym__(a,b,c,f);
178         }
179     else /* if (S_O_K(a) == HASHTABLE) */
180         {
181         erg += pps_hashtable__(a,b,c,f);
182         }
183 
184     ENDR("pps___");
185 }
186 
plet_powsym_schur_via_ppm(a,b,c)187 INT plet_powsym_schur_via_ppm(a,b,c) OP a,b,c;
188 /* AK 061201
189 */
190 {
191     INT t=0,erg = OK;
192     CTTTTO(HASHTABLE,INTEGER,PARTITION,POWSYM,"plet_powsym_schur(1)",a);
193     CTTTTO(INTEGER,HASHTABLE,PARTITION,SCHUR,"plet_powsym_schur(2)",b);
194     CTTTO(EMPTY,HASHTABLE,SCHUR,"plet_powsym_schur(3)",c);
195 
196 /*
197     if (S_O_K(c) == EMPTY)
198          { t=1; init_hashtable(c); }
199     pse___(a,b,c,cons_eins);
200 */
201     {
202     /* via ppm with change of basis */
203     OP f = CALLOCOBJECT();
204     OP d = CALLOCOBJECT();
205     erg += init_hashtable(f);
206     erg += init_hashtable(d);
207     erg += tsm___faktor(b,f,cons_eins);
208     erg += ppm___(a,f,d,cons_eins);
209     FREEALL(f);
210     erg += t_MONOMIAL_SCHUR(d,c,cons_eins);
211     FREEALL(d);
212     }
213 /*
214     if (t==1) t_HASHTABLE_SCHUR(c,c);
215 */
216     ENDR("plet_powsym_schur");
217 }
218 
219 
220