// MATRIX LABORATORY ON LINE // HADAMARD MATRIX SEARCH PROCEDURE // n=16, 20, 32, 40, 52, 64, 68 if (tick==0) { n=20; hf=1.05; hf2=2.2; v=n/2; v1=(v+4)/4; w1=v-1-2*v1; sn=sqrt(n); hmin=100; } // STADIUM 1: CHOOSE PRETENDENT H // MATRIX ORDER 20, 32, 40, 68, 100, ... H=initmatrix(n,100,8); // bounds ξ // STADIUM 2: DETERMINANT OPTIMISATION // n=rows(H); v=n/2; a0=tr(rowcol(H,0,0,0,v-1)); b0=tr(rowcol(H,0,0,v,n-1)); H=orth(H); m=maxabs(H); h=m*sn; if (h<2.5) { u=line(n); p=0.5; q=100; q2=50; // iterations while(q>1) { q=q-1; p=0.995*p+0.005; // SORT COLUMS ix=maxabsix(H); u=sort(u,ix); H=sort(H,ix); H=sat(H,m*p); H=orth(H); m=maxabs(H); h=m*sn; if (hhf2) q=0; }} h=format(h,1000); hmin=format(hmin,1000); } puts('tick='+abs(tick)+' h/hmin='+h+'/'+hmin+' max='+minx); if (tick>=0) { // HYSTOGRAM AND RESTART // G=sort(absm(colline(H))); mesh(G); // m2=maxabs(H2); puts(m2*sn); restart(0); }else{ // RESULT H=resort(H,u); H=divp(H,m); if (h0) { q=q-1; getAB(); if (maxxISM) { b=equal(a); ISM=IS;}} return b; } function getish(a) { // get index of hamming symmetry var i,v,IS; v=rows(a); IS=1; for (i=1;iISM) { b=equal(a); ISM=IS;}} return b; } n=rows(H); v=n/2; v2=v/2; a=tr(rowcol(H,0,0,0,v-1)); if (sum(a)<0) a=minp(a); b=tr(rowcol(H,0,0,v,n-1)); if (sum(b)<0) b=minp(b); // INDECES a=setmaxish(a); b=setmaxish(b); IS3=getish(a); IS4=getish(b); a=setmaxis(a); b=setmaxis(b); IS1=getis(a); IS2=getis(b); STR='n='+n+' sym='+IS1+','+IS2; puts(STR+' d='+(v2-IS3)+','+(v2-IS4)); putm("a=["+a+"];"); putm("b=["+b+"];"); A=circul(a); B=circul(b); // P=triu(A); {{r1=P*a}} puts('autocorrelation a '+r1); // R=triu(B); {{r2=R*b}} puts('autocorrelation b '+r2); H=twocircul(a,b); // } // MATCHSCINET.RU