#include #include #include #include "l.h" R const pi = 3.1415926535897932385; static R fac(R n){if(n == 0) return 1; if(n==-0.5) return sqrt(pi); return n*fac(n-1);} int main(){ void ne(bp a, bp b){ int const k = a.d + b.d - 1; R* vog(R x) {R* op=malloc(k*sizeof(R)); {int j=k; while(j--) op[j] = 0;} op[0] = x; return op;} mat ob(mat m, bp x, R * vo){ R * a = (R*)malloc(sizeof(R)*x.vc*k); mm((mat){a, x.vc, k}, (mat){x.wh, x.vc, x.d}, m); {int j=x.vc; while(j--) {int m=k; while(m--) a[j*k+m] += vo[m];}} return (mat){a, x.vc, k};} void di(R dc){mat at = ({R tr[a.d][k]; {int i=a.d; while(i--){int j=k; while(j--) tr[i][j] = i==j;}} ob((mat){(R*)tr, a.d, k}, a, vog(0));}); mat bt = ({R tr[b.d][k]; {int i=b.d; while(i--){ int j=k; while(j--) tr[i][j] = (!i && !j) || i && (i+a.d-1==j);}} ob((mat){(R*)tr, b.d, k}, b, vog(dc));}); R D[k*k]; R intg = 0; R pw(R r2){R rk = k&1?sqrt(r2):r2; {int q=(k-1)/2; while (q--) rk *= r2;} return rk;} {int i=a.sc; while(i--){int j=b.sc; while(j--){R * dp = D; {int iv=a.d; while(iv-->1) { int y=k; while(y--) dp[y] = at.a[k*a.c[i*a.d+iv] + y] - at.a[k*a.c[i*a.d] + y]; dp += k;}} {int iv=b.d; while(iv-->1) { int y=k; while(y--) dp[y] = bt.a[k*b.c[j*b.d+iv] + y] - bt.a[k*b.c[j*b.d] + y]; dp += k;}} {{int y=k; while(y--) dp[y] = at.a[k*a.c[i*a.d] + y] - bt.a[k*b.c[j*b.d] + y];} int const sz = 10000; R ave = 0; {int sn=sz; while(sn--) ave += 1./pw(smp((R*)D, a.d-1, b.d-1)); intg += det(D, k, k)*ave/sz;}}}} {R t = a.d+b.d-1, th = dc<2?t*pow(pi, t/2)/fac(t/2):0; printf("%d-brane and %d-brane dc=%4.1f calc = %14.9f, theory = %14.9f\n", a.d-1, b.d-1, dc, intg/(fac(a.d-1)*fac(b.d-1)), th);}}} di(1); di(3);} {bp bps[] = {g1(), g2(20), g3t(), gcp(3), gcp(4)}; void dl(int i, int j){ne(bps[i], bps[j]);} dl(0, 1); dl(1, 1); dl(1, 2); dl(2, 2); dl(1, 3); dl(2, 3); dl(4, 1); dl(2, 4);} return 0;}