#tries again to minimize the determinants of the Psi matrix for irregular sampling. #Vertices vary within the cell around where they should be (excluding points of intersection of these cells. #Search is performed at increasing depths (i.e. phatlvls) to see how the minimum varies. read "itall.txt": with(LinearAlgebra); mindet:=proc(T,baselvl,lvl,funclist,listverts,tol) local l, m, n, d, oldlow, cycles, lowdet,i,j,k, newlist, tmpverts, nbs; #make_neighbors(T,lvl,T[lvl,-1]); l:=nops(listverts); nbs:=[seq([],i=1..l)]; for i from 1 to l do for vertex in T[lvl,-1] do if(sameCell((baselvl+2),listverts[i],vertex)) then nbs[i]:=[op(nbs[i]),vertex]; end if; end do; end do; newverts:=listverts; m:=Matrix([seq([seq(T[newverts[i],funclist[j]],j=1..l)],i=1..l)]); lowdet:=abs(Determinant(m)); cycles:=0; oldlow:=lowdet+10*tol; while (lowdet < oldlow - tol) do oldlow:=lowdet; for i from 1 to l do for vertex in nbs[i] do tmpverts:=subsop(i=vertex,newverts); m:=Matrix([seq([seq(T[tmpverts[n],funclist[k]],k=1..l)],n=1..l)]); d:=abs(Determinant(m)); if (d