2 pfaffian(integ,list):=block([sgn:-1,ans:0,pdum,ldum],
6 and length(list)=integ*(integ+1)/2)
7 then error((errexp:[integ,list],"invalid arg to pfaffian.merrexp holds the offending expression.")),
8 if integ =1 then return(first(list)),
12 then return(list[1]*list[6]-list[2]*list[5]+list[3]*list[4])
13 else for kzero thru integ do
15 inpart(list,kzero)*(sgn:-sgn)*
19 if listp(pdum:pfaffm[integ,kzero])
21 else pfaffm[integ,kzero]:(ldum:(kzero+1)*(2*integ-kzero)/2,
23 if kzero#1 then for mdum:2 thru kzero do
24 pdum:endcons(kzero+(mdum-1)*(2*integ-mdum)/2,pdum),
25 for mdum:kzero*(2*integ-kzero+1)/2+1 thru ldum do
26 pdum:endcons(mdum,pdum),