/* klc - for computations of type A Kazhdan-Lusztig polys * Copyright (C) 2010 Gregory S. Warrington * email: gwar@alumni.princeton.edu * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ Compile to a binary via "gcc -O3 *.c" or its equivalent. Run as ./a.out n filename where n - determines which symmetric group S_n we are computing in. filename - identifies a file consisting of pairs x,w, one pair per line for which we wish to compute the K-L polynomial P_{x,w}. For example, given the file "test-file" in this folder, running ./a.out 10 test-file will produce the output: ~/code/ccode/fr2/kl% ./a.out 10 test-file 0432187659 4678091235 MU 4 wlen: 23 xlen: 12 1,14,60,96,43,4 0432817659 4678901235 MU 4 wlen: 24 xlen: 13 1,15,67,109,50,4 0532187649 5678091234 MU 4 wlen: 24 xlen: 13 1,15,67,109,50,4 0532817649 5678901234 MU 4 wlen: 25 xlen: 14 1,16,75,124,58,4 4321098765 9467182350 MU 4 wlen: 31 xlen: 20 1,7,19,26,17,4 4321908765 9467812350 MU 4 wlen: 32 xlen: 21 1,8,24,34,22,4 5321098764 9567182340 MU 4 wlen: 32 xlen: 21 1,8,24,34,22,4 5321908764 9567812340 MU 4 wlen: 33 xlen: 22 1,9,30,45,28,4 0123456789 3458760129 wlen: 21 xlen: 0 1,6,13,10,1 9876543210 0123456789 wlen: 0 xlen: 45 0 0123456789 0213456789 MU 1 wlen: 1 xlen: 0 1 We describe the entries in the first line: 0432187659 = x 4678091235 = w MU only included if mu(x,w) > 0 4 mu(x,w) if > 0, otherwise not listed wlen: 23 l(w) xlen: 12 l(x) 1,14,60,96,43,4 P_{x,w} = 1 + 14q + 60q^2 + 96q^3 + 43q^4 + 4q^5 Note that in this case mu(x,w) > 0 and indeed, deg(P_{x,w}) = (23 - 12 - 1)/2 = 5. For working in S_n, n > 10, use the corresponding ASCII symbols just above 9, so 10 <--> : 11 <--> ; 12 <--> < 13 <--> = 14 <--> > 15 <--> ? ... The input code could easily be rewritten to use 10 <--> a, 11 <--> b, etc., but I haven't bothered.