|
|
in arrays.inc, in the ARRAYS_HybridQuickSortStep macro, we have :
#local X = Array[FInd];
that does not seem to serve any purpose but causes troubles when I try to
adapt the sort macros to a muli-dimensionnal array by modifying only
Sort_Compare and Sort_Swap_Data. It works when I comment the "#local X
(...)" line out. (Actually the X variable is used nowhere in the code.)
Sys info :
POV-Ray 3.5 b6
Win 2k pro sp2
Ahtlon 1.2 GHz
512 MB DDR
Povingly,
Philippe
Post a reply to this message
|
|
|
|
Philippe Debar <phd### [at] belgacomnet> wrote:
: #local X = Array[FInd];
That's a relic.
My original sorting code used that X like this:
#local J = J-1; #while(Array[J] > X) #local J = J-1; #end
#local I = I+1; #while(Array[I] < X) #local I = I+1; #end
However, the modified (ie. generalized) version does it this way:
#local J = J-1; #while(Sort_Compare(Array, FInd, J)) #local J = J-1; #end
#local I = I+1; #while(Sort_Compare(Array, I, FInd)) #local I = I+1; #end
Thus, the declaration of X has become obsolete and should be removed.
Good point.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
|