POV-Ray : Newsgroups : povray.advanced-users : function optimization question Server Time
29 Jul 2024 16:33:35 EDT (-0400)
  function optimization question (Message 11 to 20 of 65)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Jan Walzer
Subject: Re: function optimization question
Date: 16 Mar 2002 14:32:21
Message: <3c939dc5$1@news.povray.org>
>   Naturally if some type of iterative loop is implemented, then recursion
> will not be needed.

And you can't tell if these loops will terminate, if it's turing complete ...
so one could lock up the render, without knowing it ....

probably one have to include something like a "maxiteration" for loops (if they were
available) .. so to cancel an infinite loop
after, maybe, 10000 times going over a specified "label" .... (just an idea) ...


Post a reply to this message

From: Lutz-Peter Hooge
Subject: Re: function optimization question
Date: 16 Mar 2002 15:21:55
Message: <MPG.16fdc81e3ce92ec49896ea@news.povray.org>
In article <3c939dc5$1@news.povray.org>, jan### [at] lzernet says...

> And you can't tell if these loops will terminate, if it's turing complete ...
> so one could lock up the render, without knowing it ....

Whats the problem? A sufficienty complicated object (preferrably with a 
glas material and filled with scattering media...) can do practically the 
same.

Lutz-Peter


Post a reply to this message

From: Jan Walzer
Subject: Re: function optimization question
Date: 16 Mar 2002 16:10:46
Message: <3c93b4d6$1@news.povray.org>
Yeah ... but it WILL terminate ...

and even if recursion-depth will be 2^32 .... it WILL terminate ...

you can't tell this for every function if the "machine" is turing-complete

... or better the other way around:

If  a function terminates, then: fine...
but if it is running, there's no algorithmic way, to determine if this function will
ever terminate or not ...
Your only chance is to wait and see ...

of course, there are trivial ones, but for every function you find, that is possible
to tell, there are infinite other functions,
where you can't tell ...


Post a reply to this message

From: Warp
Subject: Re: function optimization question
Date: 16 Mar 2002 16:11:03
Message: <3c93b4e7@news.povray.org>
Jan Walzer <jan### [at] lzernet> wrote:
> And you can't tell if these loops will terminate, if it's turing complete ...
> so one could lock up the render, without knowing it ....

  So can a #while. So what?
  That's not the problem here.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Jan Walzer
Subject: Re: function optimization question
Date: 16 Mar 2002 16:57:45
Message: <3c93bfd9$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote:
> Jan Walzer <jan### [at] lzernet> wrote:
> > And you can't tell if these loops will terminate, if it's turing complete ...
> > so one could lock up the render, without knowing it ....
>
>   So can a #while. So what?
>   That's not the problem here.

but it happens at parse-stage ... there's no image rendered yet, and you can debug it
by using the debug-stream ...

functions can get evaluated at rendertime ...
you can't debug them by writing some intermediate-values to some stream ...

you see my prob ?


Post a reply to this message

From: Lutz-Peter Hooge
Subject: Re: function optimization question
Date: 16 Mar 2002 17:30:54
Message: <MPG.16fde65b9dbc8c219896eb@news.povray.org>
In article <3c93b4d6$1@news.povray.org>, jan### [at] lzernet says...

> and even if recursion-depth will be 2^32 .... it WILL terminate ...

But that's only relevant in theory because you won't wait that long 
anyway.

Lutz-Peter


Post a reply to this message

From: Warp
Subject: Re: function optimization question
Date: 16 Mar 2002 20:46:08
Message: <3c93f560@news.povray.org>
Jan Walzer <jan### [at] lzernet> wrote:
> but it happens at parse-stage ... there's no image rendered yet, and you can debug
it by using the debug-stream ...

  You can do the same thing with functions.

> functions can get evaluated at rendertime ...
> you can't debug them by writing some intermediate-values to some stream ...

  Yes, you can.

> you see my prob ?

  No.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: function optimization question
Date: 16 Mar 2002 20:49:30
Message: <chrishuff-5A16DA.20492316032002@netplex.aussie.org>
In article <3c93bfd9$1@news.povray.org>, "Jan Walzer" <jan### [at] lzernet> 
wrote:

> but it happens at parse-stage ... there's no image rendered yet, and you can 
> debug it by using the debug-stream ...
> 
> functions can get evaluated at rendertime ...
> you can't debug them by writing some intermediate-values to some stream ...

Why not? Just make an equivalent to #debug that operates at function 
evaluation time, whether while parsing or rendering.

If you set an arbitrary limit, it will either be too low and get in 
people's way (like the recursion limit for macros), or be too high and 
not be useful. Why bother?

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Slime
Subject: Re: function optimization question
Date: 16 Mar 2002 22:22:17
Message: <3c940be9$1@news.povray.org>
>   What you want is simple: Support for defining variables inside
functions.

Hmm, I suppose you're right. Is that difficult? I'd think you'd only need
some sort of array attached to the function internally, holding all the
values and their respective variable names.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]


Post a reply to this message

From: Peter Popov
Subject: Re: function optimization question
Date: 17 Mar 2002 01:49:19
Message: <2re89uo42pdv7nstepkrs12id6b055ukoj@4ax.com>
On Sat, 16 Mar 2002 20:49:23 -0600, Christopher James Huff
<chr### [at] maccom> wrote:

>If you set an arbitrary limit, it will either be too low and get in 
>people's way (like the recursion limit for macros), or be too high and 
>not be useful. Why bother?

Only if you make it built-in. If you can change it in the scene or in
the ini file, there will not be such a problem.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

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

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