L <- ADJ_2D(c,c_l,c_r,P,J)c is a section cell in the 1D CAD, c_l is the sector to the left of c, and c_r the section to the right. P is the projection factor set, and J the projection polynomial set. The return value L will be a list of elements of the form ((i,j),(k,l)) indicating an adjacency between cell (i,j) and cell (k,l). More exact information is given below.
Naturally, I try to be clever, and I don't generate all possible solutions and then weed out the bad ones. I generate only those solutions which don't violate my rules.
In the case of a "missing" stack, i.e. a stack which has not been constructed but which is needed by my adjacency method, I take the easy way out: I simply construct the stack. The missing stack will always be a stack over an open interval, so the time required for constructing that stack should b pretty small. Another alternative would be a modified algorithm which deals with two adjacent stacks and not three. The function which determines adjacencies in any situation is:
L <- ADJ_2D(_PARTc,c_l,c_r,P,J)It calls:
ADJ_2D_CONSTRUCT(c,P2)to construct missing stacks. To decide between multiple possible adjacency assignments it uses:
ADJ_2D_DECIDE(Sol,c,c_l,c_r,P,J)