Radius of inscribed sphere

To allow quick viewing and debugging, temporarily modify ``setup.m'' to work with a problem size of S=[4;6;8;]. Insert the following code block right after the computation of the lengths of the G vectors (where your code says ``G2=...''),

%# Locate edges (assume S's are even!) and determine max 'ok' G2
  printf("Odd dimension in S, cannot continue!\n");
  return;
endif
This block just checks, so that we can assume that the sizes S are always even. After this check, insert the code block
edges=find( ... );
G2mx=min(G2(edges));
where ``...'' is a logical statement identifying the edges of the Fourier box.
Hints: Run ``setup.m'' with S=[4;6;8;] and inspect the basis indices in N. When the S's are even, the edges occur whenever any of N(:,k) equals either S/2 or -S/2+1. You can make a matrix of the values of S/2 of size equal to N by doing ones(size(N,1),1)*S'/2. In octave, the logical ``or'' operation is ``$\vert$''. Finally, if you have a matrix L of logical values and want to know if any element in each row is true, just use any(L,2). The final ``2'' here means to look for any true value along dimension 2.

Tomas Arias 2005-05-04