POV-Ray : Newsgroups : povray.beta-test : arrays.inc Server Time
30 Jul 2024 14:18:26 EDT (-0400)
  arrays.inc (Message 1 to 3 of 3)  
From: Philippe Debar
Subject: arrays.inc
Date: 21 Oct 2001 18:42:34
Message: <3bd34f5a@news.povray.org>
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

From: Warp
Subject: Re: arrays.inc
Date: 22 Oct 2001 03:25:01
Message: <3bd3c9cd@news.povray.org>
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

From: Rune
Subject: Re: arrays.inc
Date: 22 Oct 2001 12:03:17
Message: <3bd44345@news.povray.org>
"Warp" wrote:
> That's a relic.
> Thus, the declaration of X has become
> obsolete and should be removed.

Done!

Rune


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.