POV-Ray : Newsgroups : povray.beta-test : Functions more than 65535 Server Time
29 Jul 2024 20:25:38 EDT (-0400)
  Functions more than 65535 (Message 5 to 14 of 34)  
<<< Previous 4 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 12 May 2002 14:50:25
Message: <3cdeb971@news.povray.org>
In article <3cdea2bc@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>> What the hell are you doing with such complex function? ;-)
>
>   65535 functions and 128 recursion levels should be enough for anyone.

Long, long ago the limit was a sufficient 256 operations per function... :-)

> As well as 640 kilobytes of memory. ;)

No, the VM won't be too happy with such a small amount of memory - with 2^16
functions and 2^16 instructions per function and the instructions usually
taking 4 bytes each you end up with 16 GB...

But who needs 64 bit address space? ;-)


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: Functions more than 65535
Date: 12 May 2002 14:54:19
Message: <3CDEBA5B.A6AA7104@gmx.de>
Thorsten Froehlich wrote:
> 
> > BTW, in the list of limits in docs section 6.1.6.2 am missing something
> > about the limit of nesting functions, i quite frequently get the error:
> > 'Maximum function evaluation recursion level reached.'
> 
> It is 128.


User-Defined Float Functions':

Limits: 

- The maximum recursion depth for nesting functions is 128. 

> 
> What the hell are you doing with such complex function? ;-)
> 

Oh come on, povers are commonly not known for their temperance...  

Constructions like the following are very useful, but regularly exceed
this limit.

#while (...)  

  ...
  
  #local fn_new1 = function { fn_1(x, y, z) + fn_foo(x, y, z)
}              
  #undef fn_1                    
  #local fn_1 = function { fn_new1(x, y, z) } 
  #undef fn_new1 

  ...

#end


Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 05 May. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: ingo
Subject: Re: Functions more than 65535
Date: 12 May 2002 15:04:41
Message: <Xns920CD6E78133Aseed7@povray.org>
in news:3CDEBA5B.A6AA7104@gmx.de Christoph Hormann wrote:

> Ingo: I would suggest something like the following in

> 
> Limits: 
> 
> - The maximum recursion depth for nesting functions is 128. 
> 

Unless it changes the meaning completely, I think I'll leave out the word 
"recursion", to prevent the idea that recursive functions are possible.

Ingo


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 12 May 2002 15:06:01
Message: <3cdebd19@news.povray.org>
In article <3CDEBA5B.A6AA7104@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:


> User-Defined Float Functions':
>
> Limits:
>
> - The maximum recursion depth for nesting functions is 128.

In the docs this should be 1024 sand not 128.  Guess why! ;-)

BTW, the parameter limit is 56 and not 40 anymore.  This changed some time
ago. So the entry should be "The maximum number of allowed parameters per
function is 56"

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 12 May 2002 16:50:58
Message: <3cded5b2$1@news.povray.org>
In article <3CDEBA5B.A6AA7104@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> Constructions like the following are very useful, but regularly exceed
> this limit.
>
> #while (...)
>
>   ...
>
>   #local fn_new1 = function { fn_1(x, y, z) + fn_foo(x, y, z)
> }
>   #undef fn_1
>   #local fn_1 = function { fn_new1(x, y, z) }
>   #undef fn_new1
>
>   ...
>
> #end

So essentially what you want is a "sum" function?

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: Functions more than 65535
Date: 12 May 2002 17:10:05
Message: <3CDEDA2C.8504C17C@gmx.de>
Thorsten Froehlich wrote:
> 
> [...]
> 
> So essentially what you want is a "sum" function?
> 

I'm not sure what you mean by 'sum' function, but of course this example
was very simple, usually there are a lot of '#if's etc. too.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 05 May. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 12 May 2002 17:32:45
Message: <3cdedf7d$1@news.povray.org>
In article <3CDEDA2C.8504C17C@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> I'm not sure what you mean by 'sum' function

For example allowing functions equivalent to

10
---
\
 >  i*2+4
/
---
i=1

inside functions, would that help?

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: Functions more than 65535
Date: 12 May 2002 17:58:24
Message: <3CDEE57F.29ECF6D5@gmx.de>
Thorsten Froehlich wrote:
> 
> In article <3CDEDA2C.8504C17C@gmx.de> , Christoph Hormann
> <chr### [at] gmxde>  wrote:
> 
> > I'm not sure what you mean by 'sum' function
> 
> For example allowing functions equivalent to
> 
> 10
> ---
> \
>  >  i*2+4
> /
> ---
> i=1
> 
> inside functions, would that help?
> 

That would be nice but it would not help much in this particular case and
is in fact not necessary since this can already be done using #while
inside functions.  In the example i gave i could have put a 'function {}'
around the while loop, leave out the #declare's and just sum up things
with the loop, this would avoid the recursion problem, but this does not
work if you build several functions in the while loop and don't want to
split into separate loops for speed reasons.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 05 May. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Christoph Hormann
Subject: Re: Functions more than 65535
Date: 12 May 2002 18:00:58
Message: <3CDEE617.73DE8699@gmx.de>
ingo wrote:
> 
> [...]
> 
> Unless it changes the meaning completely, I think I'll leave out the word
> "recursion", to prevent the idea that recursive functions are possible.
> 

All right.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 05 May. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 13 May 2002 02:19:37
Message: <3cdf5af9@news.povray.org>
In article <3CDEE57F.29ECF6D5@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> That would be nice but it would not help much in this particular case and
> is in fact not necessary since this can already be done using #while
> inside functions.

Keep in mind that the "1" and "10" could be expressions and it is also
faster...  ;-)

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

<<< Previous 4 Messages Goto Latest 10 Messages Next 10 Messages >>>

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